From 43096f29e0b9b04633c74a224b224a24a510202a Mon Sep 17 00:00:00 2001 From: Glitchii Date: Mon, 7 Mar 2022 22:01:09 +0000 Subject: [PATCH] Show selected menu options in menu --- assets/css/index.css | 28 +++++++++++++++++++---- assets/js/script.js | 6 ++--- index.html | 54 ++++++++++++++++++++++++++++++++------------ 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/assets/css/index.css b/assets/css/index.css index b631043..0a2c95f 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -71,6 +71,10 @@ body.no-user .msgEmbed>.contents { display: none; } +.hidden { + display: none; +} + .main { position: absolute; width: 100%; @@ -1865,11 +1869,8 @@ body { transform: translateX(-50%); } -/* .top-btn.menu>.box .item>svg { - transform: translateY(3px); -} */ - -.top-btn.menu>.box .item>* { +.top-btn.menu>.box .item> :is(*, *>svg) { + display: flex; align-self: flex-end; margin: 0; } @@ -1877,6 +1878,23 @@ body { .top-btn.menu>.box .item>input { pointer-events: none; } +.top-btn.menu > .box .item > .icon::after { + display: none; + position: absolute; + content: ""; + width: 4px; + height: 4px; + background: #00bb9c; + z-index: 1000000; + border-radius: 100%; + left: 7px; + transform: translateY(7px); +} + +body.autoUpdateURL .top-btn.menu > .box .item.auto > .icon::after, +body.reversed .top-btn.menu > .box .item.reverse > .icon::after { + display: block; +} .top-btn.menu.active { background: var(--bgc); diff --git a/assets/js/script.js b/assets/js/script.js index bd340d8..12b38dd 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -146,7 +146,7 @@ addEventListener('DOMContentLoaded', () => { if (reverseColumns || localStorage.getItem('reverseColumns')) reverse(); if (autoUpdateURL) - document.querySelector('.top-btn.menu .item.auto input').checked = true; + document.body.classList.add('autoUpdateURL'); if (autoParams) document.querySelector('.auto-params > input').checked = true; document.querySelectorAll('.clickable > img') @@ -931,8 +931,8 @@ addEventListener('DOMContentLoaded', () => { if (input) input.checked = !input.checked; if (e.target.closest('.item.auto')) { - autoUpdateURL = input.checked; - if (input.checked) localStorage.setItem('autoUpdateURL', true); + autoUpdateURL = document.body.classList.toggle('autoUpdateURL'); + if (autoUpdateURL) localStorage.setItem('autoUpdateURL', true); else localStorage.removeItem('autoUpdateURL'); update(json); } else if (e.target.closest('.item.reverse')) { diff --git a/index.html b/index.html index 7c64d90..aac3376 100644 --- a/index.html +++ b/index.html @@ -98,31 +98,55 @@
-