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/scripts/page-width.js | 6 +++--- src/scripts/theme-changer.js | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/scripts') 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'); } } -- cgit v1.3.1-23-gd82d