From 48b82af70feb7a20dc80490353da39540c83acec Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 21 Oct 2025 20:26:13 +0800 Subject: remove: settings page Former-commit-id: 4e40e1ed71a3ff5889c2a12848667eda03319f29 --- assets/js/settings.js | 79 ---------------------- config/_default/params.zh.yaml | 2 - content/settings.md | 6 -- layouts/_partials/components/back-to-top.html | 97 +++++++++++++-------------- layouts/_partials/scripts.html | 4 -- layouts/settings.html | 8 --- 6 files changed, 46 insertions(+), 150 deletions(-) delete mode 100644 assets/js/settings.js delete mode 100644 content/settings.md delete mode 100644 layouts/settings.html diff --git a/assets/js/settings.js b/assets/js/settings.js deleted file mode 100644 index 6dcbdfa9..00000000 --- a/assets/js/settings.js +++ /dev/null @@ -1,79 +0,0 @@ -(() => { - /** - * =========================== - * Initialize Settings Page - * =========================== - */ - - // return if this is not the settings page - if (!document.getElementById('settings')) return; - - const initializeSettingsPage = () => { - // initialize text altering buttons - function initTextAlterButtons() { - const textAlterButtons = document.querySelectorAll('#text-alter-buttons button'); - textAlterButtons.forEach(button => { - // highlight selected button - if (button.dataset.textSize === localStorage.getItem('geedeapro.ui.fontSize')) { - button.classList.add('bg-neutral-200/50', 'dark:bg-neutral-700/50'); - } - - // switch font size when clicked - button.addEventListener('click', () => { - setFontSize(button.dataset.textSize); - // highlight selected button - textAlterButtons.forEach(btn => btn.classList.remove('bg-neutral-200/50', 'dark:bg-neutral-700/50')); - button.classList.add('bg-neutral-200/50', 'dark:bg-neutral-700/50'); - }); - }); - } - initTextAlterButtons() - - // initialize checkbox options - function initCheckboxes() { - const checkboxOptions = [ - { - id: 'hideBatrick', - label: '隐藏 Batrick(返回顶部按钮)', - storage: 'geedeapro.ui.hideBatrick', - default: 'false' - } - ] - - checkboxOptions.forEach(checkboxOption => { - // create checkbox - const element = document.createElement('input'); - element.type = 'checkbox'; - element.id = checkboxOption.id; - element.checked = localStorage.getItem(checkboxOption.storage) || - checkboxOption.default === 'true'; - - // add event listener to checkbox - element.addEventListener('change', () => { - if (element.checked) - localStorage.setItem(checkboxOption.storage, 1); - else - localStorage.removeItem(checkboxOption.storage); - }); - - // create label - const label = document.createElement('label'); - label.htmlFor = element.id; - label.textContent = checkboxOption.label; - - // wrap checkbox and label in a div - const wrapper = document.createElement('div'); - wrapper.classList.add('flex', 'items-center', 'mb-2', 'gap-2'); - wrapper.appendChild(element); - wrapper.appendChild(label); - - // append checkbox and label to container - const container = document.getElementById('checkbox-options'); - container.appendChild(wrapper); - }); - } - initCheckboxes(); - }; - - initializeSettingsPage(); -})(); diff --git a/config/_default/params.zh.yaml b/config/_default/params.zh.yaml index 9daa5e91..8ffd285e 100644 --- a/config/_default/params.zh.yaml +++ b/config/_default/params.zh.yaml @@ -18,5 +18,3 @@ footerInternalLinks: link: /highlights/ - name: 赞助 link: /sponsor/ - - name: 设置 - link: /settings/ diff --git a/content/settings.md b/content/settings.md deleted file mode 100644 index 4b875aeb..00000000 --- a/content/settings.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: 设置 -layout: settings ---- - -🙋 网站设置正在测试中,如果在使用过程中遇到问题请联系我,谢谢! diff --git a/layouts/_partials/components/back-to-top.html b/layouts/_partials/components/back-to-top.html index bf094d5d..6ef367b6 100644 --- a/layouts/_partials/components/back-to-top.html +++ b/layouts/_partials/components/back-to-top.html @@ -14,64 +14,59 @@ diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html index bc43802d..87243f76 100644 --- a/layouts/_partials/scripts.html +++ b/layouts/_partials/scripts.html @@ -1,7 +1,3 @@ -{{ with resources.Get "js/settings.js" }} - -{{ end }} - {{ with resources.Get "js/tooltip.js" }} {{ end }} diff --git a/layouts/settings.html b/layouts/settings.html deleted file mode 100644 index 916336b8..00000000 --- a/layouts/settings.html +++ /dev/null @@ -1,8 +0,0 @@ -{{ define "main" }} -
- {{ partial "header" . }} -
{{ .Content }}
-
-
-{{ partial "footer.html" . }} -{{ end }} -- cgit v1.2.3