Summary Files Commits Branches @commit @diff @stats
path: root / src / scripts
diff options
context:
space:
mode:
Commitb18a91ed8990d658f2901a4a7b2a2154315ea3b4 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-08-20 08:34:28 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-08-20 08:34:28 +0300
Filesf96edd3682595ddf8b3294542b256b7e59e20b27 /src/scripts
syndamia.com-b18a91ed8990d658f2901a4a7b2a2154315ea3b4.tar
syndamia.com-b18a91ed8990d658f2901a4a7b2a2154315ea3b4.tar.gz
syndamia.com-b18a91ed8990d658f2901a4a7b2a2154315ea3b4.zip
Parentd90f2b3be2e7637fa4b1dbb3fad48da3a5266c6a (diff)
feat(header): Make wide/narrow setting modify the header when folded up
1 files changed, 5 insertions, 2 deletions
-rw-r--r--src/scripts/page-width.js7
diff --git a/src/scripts/page-width.js b/src/scripts/page-width.js
index 353dc4d..4969c45 100644
--- a/src/scripts/page-width.js
+++ b/src/scripts/page-width.js
@@ -1,14 +1,17 @@
const widthBtn = document.getElementById('changeWidthBtn');
const widthLabel = widthBtn.childNodes[0];
const articleElem = document.getElementsByTagName('article')[0];
+const sidebarHeaderElem = document.getElementById('header');
if (localStorage.getItem('width') === 'wide') {
widthLabel.innerText = 'Narrow';
- articleElem.classList.add('article-wide');
+ articleElem.classList.add('wide');
+ sidebarHeaderElem.classList.toggle('wide');
}
widthBtn.onclick = function() {
- articleElem.classList.toggle('article-wide');
+ articleElem.classList.toggle('wide');
+ sidebarHeaderElem.classList.toggle('wide');
if (localStorage.getItem('width') !== 'norm') {
widthLabel.innerText = 'Wide';