mirror of
https://github.com/Dvorinka/Portfolio.git
synced 2026-07-29 21:53:47 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
const addEventOnElements = function (elements, eventType, callback) {
|
||||
for (const elem of elements) elem.addEventListener(eventType, callback);
|
||||
}
|
||||
|
||||
|
||||
const searchBox = document.querySelector("[search-box]");
|
||||
const searchTogglers = document.querySelectorAll("[search-toggler]");
|
||||
|
||||
addEventOnElements(searchTogglers, "click", function () {
|
||||
searchBox.classList.toggle("active");
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
const getMovieDetail = function (movieId) {
|
||||
window.localStorage.setItem("movieId", String(movieId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
const getMovieList = function (urlParam, genreName) {
|
||||
window.localStorage.setItem("urlParam", urlParam);
|
||||
window.localStorage.setItem("genreName", genreName);
|
||||
}
|
||||
Reference in New Issue
Block a user