mirror of
https://github.com/AngelJumbo/gruvbox-wallpapers.git
synced 2026-10-19 15:46:17 +00:00
mark selected page
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
# Write the header
|
|
||||||
write_header(){
|
write_header(){
|
||||||
echo "<!DOCTYPE html>
|
echo "<!DOCTYPE html>
|
||||||
<html lang=\"en\">
|
<html lang=\"en\">
|
||||||
@@ -31,14 +30,30 @@ write_header(){
|
|||||||
<title>Gruvbox wallpapers</title>
|
<title>Gruvbox wallpapers</title>
|
||||||
<script>
|
<script>
|
||||||
function loadPage(section, page) {
|
function loadPage(section, page) {
|
||||||
|
let buttons = document.getElementById(section ).getElementsByTagName('button');
|
||||||
|
let currSel;
|
||||||
|
for(let i in buttons){
|
||||||
|
if(buttons[i].classList?.contains('sel-btn')){
|
||||||
|
if(page-1 == i)
|
||||||
|
return;
|
||||||
|
else{
|
||||||
|
currSel = buttons[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fetch(section + '_page' + page + '.html')
|
fetch(section + '_page' + page + '.html')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
document.getElementById(section + '-content').innerHTML = data;
|
document.getElementById(section + '-content').innerHTML = data;
|
||||||
|
if (currSel){
|
||||||
|
currSel.classList.remove('sel-btn');
|
||||||
|
}
|
||||||
|
document.getElementById(section).getElementsByTagName('button')[page-1].classList.add('sel-btn');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -130,20 +145,17 @@ echo "<script>
|
|||||||
|
|
||||||
for section in "${sections[@]}"; do
|
for section in "${sections[@]}"; do
|
||||||
echo " loadPage('$section', 1);
|
echo " loadPage('$section', 1);
|
||||||
|
|
||||||
document.getElementById('$section').style.display = \"none\";
|
document.getElementById('$section').style.display = \"none\";
|
||||||
" >> ./index.html
|
" >> ./index.html
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
|
|
||||||
document.getElementById(\"${sections[0]}\").style.display = \"block\";
|
document.getElementById(\"${sections[0]}\").style.display = \"block\";
|
||||||
}
|
}
|
||||||
function activeSection(section){">> ./index.html
|
function activeSection(section){">> ./index.html
|
||||||
|
|
||||||
for section in "${sections[@]}"; do
|
for section in "${sections[@]}"; do
|
||||||
echo "
|
echo "
|
||||||
|
|
||||||
document.getElementById('$section').style.display = \"none\";
|
document.getElementById('$section').style.display = \"none\";
|
||||||
" >> ./index.html
|
" >> ./index.html
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -98,6 +98,16 @@ img:hover {
|
|||||||
/*border-radius: 8px; */
|
/*border-radius: 8px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sel-btn{
|
||||||
|
background-color: #282828 !important;
|
||||||
|
border-color: #ebdbb2 !important;
|
||||||
|
color: #ebdbb2 !important;
|
||||||
|
border-width: thick !important;
|
||||||
|
border-style: solid !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.clickable {
|
.clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user