diff --git a/app.js b/app.js index 2fb1c4f..68931d5 100644 --- a/app.js +++ b/app.js @@ -21,3 +21,17 @@ function loadPage(section, page) { document.getElementById(section).getElementsByTagName("button")[page - 1].classList.add("sel-btn"); }); } + +function activeSection(section) { + hideAll(); + + const targetSection = document.getElementById(section); + targetSection.style.display = "block"; + targetSection.focus(); +} + +function hideAll() { + document.querySelectorAll(".section").forEach((s) => { + s.style.display = "none"; + }); +} diff --git a/build.sh b/build.sh index 22ffdf1..10f2754 100755 --- a/build.sh +++ b/build.sh @@ -26,10 +26,10 @@ write_header(){ - + Gruvbox wallpapers - + @@ -37,7 +37,7 @@ write_header(){ } write_section_header(){ - echo "

" >> $3 + echo "

" >> $3 echo "$2" | tr a-z A-Z >> $3 echo "

" >> $3 } @@ -75,7 +75,7 @@ do subhtml="${section}_page${page}.html" touch ./$subhtml - echo "
" >> ./index.html + echo "
" >> ./index.html echo "
" >> ./index.html countImgs=$(find "$subdir" -type f | wc -l) @@ -84,8 +84,8 @@ do echo "" >> ./index.html done echo "
" >> ./index.html - echo "
" >> ./index.html - echo "
" >> ./$subhtml + echo "
" >> ./index.html + echo "
" >> ./$subhtml for wallpaper in ${subdir}/* do if [ "$img_count" -ge $maxPerPage ]; then @@ -96,7 +96,7 @@ do touch ./$subhtml - echo "
" >> ./$subhtml + echo "
" >> ./$subhtml img_count=0 fi @@ -117,26 +117,16 @@ done echo "" >> ./index.html diff --git a/style.css b/style.css index 5a8d72f..0216b17 100644 --- a/style.css +++ b/style.css @@ -65,7 +65,7 @@ h2 { background-color: #689d6a; } -#c { +.c { padding: 1em; background-color: var(--bg-color-3); text-align: center; @@ -120,3 +120,7 @@ img:hover { .clickable { cursor: pointer; } + +.section { + display: none; +}