From 0e2371096b4fcab071893bf3c4de62ebd6de44c3 Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Sat, 16 May 2026 22:50:00 -0500 Subject: [PATCH] Feat: Basic ExtensionLibrary Filter --- .../components/ExtensionLibrary.svelte | 125 +++++++++++++++--- 1 file changed, 109 insertions(+), 16 deletions(-) diff --git a/src/features/extensions/components/ExtensionLibrary.svelte b/src/features/extensions/components/ExtensionLibrary.svelte index 6e79655..3d6daa9 100644 --- a/src/features/extensions/components/ExtensionLibrary.svelte +++ b/src/features/extensions/components/ExtensionLibrary.svelte @@ -1,5 +1,5 @@
@@ -80,17 +112,56 @@ {extensionName}
{#if !loading} - {allManga.length} + {filtered.length}{filtered.length !== allManga.length ? ` / ${allManga.length}` : ""} {/if} -
- - +
+
+ + +
+ +
+ + {#if filterOpen} + + {/if} +
+ + {#if sources.length > 0} + + {/if}
- {#if sources.length > 0} - - {/if}
@@ -181,6 +252,7 @@ :global(.header-icon) { width: 24px; height: 24px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--bg-raised); } .header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border-dim); flex-shrink: 0; } + .header-right { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; } .header-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-md); color: var(--text-faint); flex-shrink: 0; transition: color var(--t-base), background var(--t-base); } .header-btn:hover { color: var(--text-primary); background: var(--bg-raised); } @@ -191,12 +263,31 @@ .count-badge { font-family: var(--font-ui); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-overlay); border: 1px solid var(--border-dim); color: var(--text-muted); flex-shrink: 0; } - .search-wrap { position: relative; display: flex; align-items: center; margin-left: auto; } + .search-wrap { position: relative; display: flex; align-items: center; } .search-wrap :global(.search-icon) { position: absolute; left: 9px; color: var(--text-faint); pointer-events: none; } .search { background: var(--bg-raised); border: 1px solid var(--border-dim); border-radius: var(--radius-md); padding: 5px 10px 5px 26px; color: var(--text-primary); font-size: var(--text-sm); width: 160px; outline: none; transition: border-color var(--t-base); } .search::placeholder { color: var(--text-faint); } .search:focus { border-color: var(--border-strong); } + .filter-wrap { position: relative; } + .filter-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-md); border: 1px solid var(--border-dim); background: var(--bg-raised); color: var(--text-faint); cursor: pointer; flex-shrink: 0; transition: color var(--t-base), border-color var(--t-base), background var(--t-base); } + .filter-btn:hover { color: var(--text-primary); border-color: var(--border-strong); } + .filter-btn-active { color: var(--accent-fg); border-color: var(--accent-dim); background: var(--accent-muted); } + + .filter-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 9999; min-width: 200px; background: var(--bg-raised); border: 1px solid var(--border-base); border-radius: var(--radius-lg); padding: var(--sp-1); box-shadow: 0 8px 32px rgba(0,0,0,0.5); animation: fadeIn 0.1s ease both; } + .panel-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 4px; } + .panel-heading { font-family: var(--font-ui); font-size: var(--text-xs); letter-spacing: var(--tracking-wide); color: var(--text-secondary); font-weight: var(--weight-medium, 500); } + .panel-clear-btn { font-family: var(--font-ui); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 0; transition: color var(--t-base); } + .panel-clear-btn:hover { color: var(--color-error); } + .panel-divider { height: 1px; background: var(--border-dim); margin: 4px 2px; } + .panel-label { font-family: var(--font-ui); font-size: var(--text-2xs); letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-faint); padding: 4px 8px 8px; } + .panel-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-muted); font-family: var(--font-ui); font-size: var(--text-xs); cursor: pointer; text-align: left; transition: background var(--t-base), color var(--t-base); } + .panel-item:hover { background: var(--bg-overlay); color: var(--text-primary); } + .panel-item-active { color: var(--accent-fg); background: var(--accent-muted); font-weight: var(--weight-medium, 500); } + .panel-item-active:hover { background: var(--accent-dim); } + .panel-check { width: 13px; height: 13px; border-radius: 2px; border: 1px solid var(--border-strong); background: transparent; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--bg-base); transition: background var(--t-base), border-color var(--t-base); } + .panel-check-on { background: var(--accent); border-color: var(--accent); } + .content { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-6) var(--sp-6); will-change: scroll-position; display: flex; flex-direction: column; gap: var(--sp-3); } .source-groups { display: flex; flex-direction: column; gap: var(--sp-1); } @@ -237,4 +328,6 @@ .title-skeleton { height: 12px; margin-top: var(--sp-2); width: 80%; border-radius: var(--radius-sm); } .empty { display: flex; align-items: center; justify-content: center; height: 60%; color: var(--text-muted); font-size: var(--text-sm); } + + @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } } \ No newline at end of file