mirror of
https://github.com/AngelJumbo/gruvbox-wallpapers.git
synced 2026-08-08 06:52:30 +00:00
Fix some issues, fix JS, fix meta tag
This commit is contained in:
@@ -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";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ write_header(){
|
||||
|
||||
<head>
|
||||
<meta charset=\"utf-8\">
|
||||
<meta name='viewport' content='idth=device-width, initial-scale=1.0'>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">
|
||||
<title>Gruvbox wallpapers</title>
|
||||
<script src='app.js' defer></script>
|
||||
<script src='app.js'></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -37,7 +37,7 @@ write_header(){
|
||||
}
|
||||
|
||||
write_section_header(){
|
||||
echo "<h2 class=\"clickable\ s$1\" onclick=\"activeSection('$2')\" >" >> $3
|
||||
echo "<h2 class=\"clickable s$1\" onclick=\"activeSection('$2')\" >" >> $3
|
||||
echo "$2" | tr a-z A-Z >> $3
|
||||
echo "</h2>" >> $3
|
||||
}
|
||||
@@ -75,7 +75,7 @@ do
|
||||
subhtml="${section}_page${page}.html"
|
||||
touch ./$subhtml
|
||||
|
||||
echo "<div id=\"$section\" style={display : \"none\"}>" >> ./index.html
|
||||
echo "<div class='section' id=\"$section\">" >> ./index.html
|
||||
|
||||
echo "<div class=\"pager\">" >> ./index.html
|
||||
countImgs=$(find "$subdir" -type f | wc -l)
|
||||
@@ -84,8 +84,8 @@ do
|
||||
echo "<button class=\"clickable\" onclick=\"loadPage('$section', $i)\">$i</button>" >> ./index.html
|
||||
done
|
||||
echo "</div>" >> ./index.html
|
||||
echo "<div id=\"$section-content\">" >> ./index.html
|
||||
echo "<div id=\"c\">" >> ./$subhtml
|
||||
echo "<div id=\"$section-content\">" >> ./index.html
|
||||
echo "<div class='c'>" >> ./$subhtml
|
||||
for wallpaper in ${subdir}/*
|
||||
do
|
||||
if [ "$img_count" -ge $maxPerPage ]; then
|
||||
@@ -96,7 +96,7 @@ do
|
||||
touch ./$subhtml
|
||||
|
||||
|
||||
echo "<div id=\"c\">" >> ./$subhtml
|
||||
echo "<div class='c'>" >> ./$subhtml
|
||||
img_count=0
|
||||
fi
|
||||
|
||||
@@ -117,26 +117,16 @@ done
|
||||
|
||||
echo "<script>
|
||||
window.onload = () => {" >> ./index.html
|
||||
|
||||
echo "console.log('fuck');" >> ./index.html
|
||||
echo "hideAll();" >> ./index.html
|
||||
for section in "${sections[@]}"; do
|
||||
echo " loadPage('$section', 1);
|
||||
document.getElementById('$section').style.display = \"none\";
|
||||
" >> ./index.html
|
||||
echo " loadPage('$section', 1);" >> ./index.html
|
||||
done
|
||||
|
||||
echo "
|
||||
document.getElementById(\"${sections[0]}\").style.display = \"block\";
|
||||
echo "
|
||||
activeSection(\"${sections[0]}\");
|
||||
}
|
||||
function activeSection(section){">> ./index.html
|
||||
|
||||
for section in "${sections[@]}"; do
|
||||
echo "
|
||||
document.getElementById('$section').style.display = \"none\";
|
||||
" >> ./index.html
|
||||
done
|
||||
echo " document.getElementById(section).style.display = \"block\";
|
||||
document.getElementById(section).focus();
|
||||
}
|
||||
</script>" >> ./index.html
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user