diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index cb529ce..0000000 --- a/deploy.sh +++ /dev/null @@ -1,2 +0,0 @@ -sudo rm -r /var/www/eorzea-songbook -sudo cp -r public/ /var/www/eorzea-songbook \ No newline at end of file diff --git a/static/script.js b/static/script.js index 2e36878..dfe706d 100644 --- a/static/script.js +++ b/static/script.js @@ -1,37 +1,35 @@ window.addEventListener('load', (event) => { const preclicked = window.location.hash.slice(1); - console.log(preclicked); if (! preclicked) return; - const radiobutton = document.getElementById(preclicked); - if (radiobutton){ - radiobutton.checked = true; - const label = document.getElementById(`${preclicked}_label`); - label.scrollIntoView(); + const albumheader = document.getElementById(preclicked); + if (albumheader){ + albumheader.classList.add('open'); + albumheader.scrollIntoView(); } }); function albumselect(code){ - const radiobutton = document.getElementById(code); - if (radiobutton){ - radiobutton.checked = true; - const label = document.getElementById(`${code}_label`); - label.scrollIntoView(); + const albumheader = document.getElementById(code); + for (const other of document.querySelectorAll('.sort-header.album.open')){ + other.classList.remove('open'); } + albumheader.classList.add('open'); document.getElementById('search-input').value = ''; - document.getElementById('search-results').innerHTML = ''; -}; + document.getElementById('search-results').replaceChildren(); +} function albumHeaderClick(clickevent){ - const radiobutton = document.getElementById(clickevent.target.htmlFor); - if (radiobutton.checked){ - radiobutton.checked = false; - clickevent.preventDefault(); + const albumheader = clickevent.target; + // console.log(albumheader); + if (albumheader.classList.contains('open')){ + albumheader.classList.remove('open'); history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${window.location.search}`); } else{ - window.location.hash = radiobutton.id; - const label = clickevent.target; - label.scrollIntoView(); + for (const other of document.querySelectorAll('.sort-header.album.open')){ + other.classList.remove('open'); + } + albumheader.classList.add('open'); + window.location.hash = albumheader.id; } -}; - +} \ No newline at end of file diff --git a/static/style.css b/static/style.css index 4e91452..5aac74a 100644 --- a/static/style.css +++ b/static/style.css @@ -470,10 +470,6 @@ footer{ /* SONG INDEX ALBUM DROPDOWNS */ -.collapse{ - display: none; -} - .sort-list.album{ display: none; } @@ -489,14 +485,15 @@ footer{ color: var(--thin-border); } -.collapse:checked ~ .sort-list.album{ +.sort-header.album.open::after{ + content: "▲"; +} + +.sort-header.album.open ~ .sort-list.album{ display:initial } -.collapse:checked ~ .sort-header.album::after{ - content: "▲"; - color: var(--thin-border); -} + /* ENTRY PAGE TITLES */ diff --git a/templates/album.html b/templates/album.html deleted file mode 100644 index 52e42b6..0000000 --- a/templates/album.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base.html" %} -{% block title %}{{ album_info[0] }}{% endblock %} - -{% block content %} - -
Released: {{ album_info[1] }} - - -