From 5ec10ccf28e43123269e45bd765168b8a0d02cdf Mon Sep 17 00:00:00 2001 From: HelpfulSoft1207 <211190746+HelpfulSoft1207@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:45:56 -0500 Subject: [PATCH] Add the ability to hide completed tasks --- package.json | 4 +- sources/css/style.css | 90 ++++++++++++++++++++ sources/index.html | 10 ++- sources/js/app.js | 191 ++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 285 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 5265afa..e6ce870 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "task-checklist", - "version": "5.1", + "version": "5.2", "description": "A Warframe Task Checklist to track daily, weekly, and other tasks. Built with HTML, CSS, and vanilla JavaScript, processed with Vite.", "type": "module", "scripts": { @@ -39,4 +39,4 @@ "vite-plugin-singlefile": "^2.3.3", "vitest": "^4.1.5" } -} +} \ No newline at end of file diff --git a/sources/css/style.css b/sources/css/style.css index 21da5b2..e4da465 100644 --- a/sources/css/style.css +++ b/sources/css/style.css @@ -523,3 +523,93 @@ body:not(.light-mode) img.icon-filter { text-decoration: underline dotted; cursor: pointer; } + +/* --- Menu Option Row (toggle switches etc.) --- */ +.menu-option-row { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 0.75rem; + color: var(--text-label); + font-size: 0.9375rem; +} + +.menu-option-label { + cursor: default; +} + +.menu-divider { + border: none; + border-top: 1px solid var(--menu-panel-border); + margin: 0 0 0.75rem; +} + +/* --- Toggle Switch --- */ +.toggle-switch { + position: relative; + display: inline-block; + width: 2.75rem; + height: 1.5rem; + flex-shrink: 0; + cursor: pointer; +} + +/* Override the global checkbox styles so the hidden input doesn't affect layout */ +.toggle-switch input[type="checkbox"] { + position: absolute !important; + opacity: 0 !important; + width: 0 !important; + height: 0 !important; + margin: 0 !important; + border: none !important; + padding: 0 !important; + pointer-events: none; +} + +.toggle-slider { + position: absolute; + inset: 0; + background-color: var(--checkbox-bg); + border: 1.5px solid var(--checkbox-border); + border-radius: 1.5rem; + transition: background-color 0.2s ease, border-color 0.2s ease; +} + +.toggle-slider::before { + content: ""; + position: absolute; + height: 1.0625rem; + width: 1.0625rem; + left: 2px; + top: 50%; + transform: translateY(-50%); + background-color: var(--text-muted); + border-radius: 50%; + transition: transform 0.2s ease, background-color 0.2s ease; +} + +.toggle-switch input[type="checkbox"]:checked + .toggle-slider { + background-color: var(--checkbox-checked-bg); + border-color: var(--checkbox-checked-border); +} + +.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before { + transform: translate(1.25rem, -50%); + background-color: var(--checkbox-check-color); +} + +/* --- Task auto-hide fade --- */ +.task-item.task-hiding { + opacity: 0.35; /* reduced-motion fallback: instant dim */ +} + +@media (prefers-reduced-motion: no-preference) { + @keyframes task-fading { + from { opacity: 1; } + to { opacity: 0; } + } + + .task-item.task-hiding { + animation: task-fading 5s linear forwards; + } +} \ No newline at end of file diff --git a/sources/index.html b/sources/index.html index 4ee4988..dd2d5f7 100644 --- a/sources/index.html +++ b/sources/index.html @@ -151,6 +151,14 @@