import "./icons.js" import initSlides from "./slides.js" initSlides() const apiKey = "m5nqOoBc4uhAba21gZdCP3z8D3JT4GPxDXL2psd52EA" console.log(apiKey) const testDiv = document.querySelector("main div") function showAlbums() { testDiv.innerHTML } function pathnameCallback(e) { console.log(e) //testDiv.innerHTML = "" //switch (window.location.pathname) { // case "/": // testDiv.innerHTML = "

Hello first page

" // break ;; // case "/albums": // testDiv.innerHTML = "

Hello albums page

" // break ;; // case "/settings": // testDiv.innerHTML = "

Hello settings page

" // break ;; //} } window.addEventListener("popstate", pathnameCallback) pathnameCallback() /* add event listeners for anchor elements in footer */ function softRedirect(e) { e.preventDefault() let a = e.target while (a.tagName !== "A" && a !== null) a = a.parentElement window.history.pushState({}, "", a.href); pathnameCallback() } document.querySelector("#menu").addEventListener("click", softRedirect)