From 6c32e096ebb3e95b73adc09bb51fe5f2178a7e59 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 9 Jul 2023 15:19:09 +0300 Subject: (page-width.js,theme-changer.js) Replaced icons with text buttons --- src/_footer.html | 2 +- src/_header.html | 8 ++++---- src/scripts/page-width.js | 6 +++--- src/scripts/theme-changer.js | 8 +++----- src/styles.css | 17 ++++++++++++++++- 5 files changed, 27 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index 6d6190c..986a60a 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -3,7 +3,7 @@ ^ - + diff --git a/src/_header.html b/src/_header.html index e05de81..b6929a2 100644 --- a/src/_header.html +++ b/src/_header.html @@ -27,7 +27,7 @@
- + diff --git a/src/scripts/page-width.js b/src/scripts/page-width.js index 38add7c..6d700d0 100644 --- a/src/scripts/page-width.js +++ b/src/scripts/page-width.js @@ -2,7 +2,7 @@ const widthBtn = document.getElementById('changeWidthBtn'); const articleElem = document.getElementsByTagName('article')[0]; if (localStorage.getItem('width') === 'wide') { - widthBtn.src = '/img/viewport-narrow.svg'; + widthBtn.innerHTML = 'Narrow
article'; articleElem.classList.add('noMaxWidth'); } @@ -10,11 +10,11 @@ widthBtn.onclick = function() { articleElem.classList.toggle('noMaxWidth'); if (localStorage.getItem('width') !== 'norm') { - widthBtn.src = '/img/viewport-wide.svg'; + widthBtn.innerHTML = 'Wide
article'; localStorage.setItem('width', 'norm'); } else { - widthBtn.src = '/img/viewport-narrow.svg'; + widthBtn.innerHTML = 'Narrow
article'; localStorage.setItem('width', 'wide'); } } diff --git a/src/scripts/theme-changer.js b/src/scripts/theme-changer.js index 39eedc9..94eb61f 100644 --- a/src/scripts/theme-changer.js +++ b/src/scripts/theme-changer.js @@ -1,19 +1,17 @@ const themeBtn = document.getElementById('changeThemeBtn'); if (darkThemeStyle.disabled) - themeBtn.src = '/img/moon.svg'; - -themeBtn.style.display = 'initial'; + themeBtn.innerHTML = 'Dark
theme'; themeBtn.onclick = function() { darkThemeStyle.disabled = !darkThemeStyle.disabled; if (localStorage.getItem('theme') !== 'light') { - themeBtn.src = '/img/moon.svg'; + themeBtn.innerHTML = 'Dark
theme'; localStorage.setItem('theme', 'light'); } else { - themeBtn.src = '/img/sun.svg'; + themeBtn.innerHTML = 'Light
theme'; localStorage.setItem('theme', 'dark'); } } diff --git a/src/styles.css b/src/styles.css index 04425e0..a917f5e 100644 --- a/src/styles.css +++ b/src/styles.css @@ -131,7 +131,6 @@ img { .file-icon { min-width: 1.3em; vertical-align: text-bottom; } .borderless, .oldschool-badge, .file-icon { border: none; } - .setting-btn { border: none; vertical-align: middle; } .btn:hover { cursor: pointer; } /* image-show.js */ @@ -325,7 +324,23 @@ dt, dd { border-bottom: none; margin: 0.58em 0 1em 0; font-size: 1.2em; + line-height: 1em; + /* Thanks https://stackoverflow.com/a/4407335/12036073 */ + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; } + .setting-btn { + font-size: 0.5em; + text-align: center; + display: inline-block; + line-height: 1em; + border: 1px solid var(--border-color); + padding: 0.2em 0.3em; + } #footer { font-size: 0.7em; overflow-x: hidden; -- cgit v1.3.1-23-gd82d