From a007d67828a762827f0408d52f68c5913c2510ab Mon Sep 17 00:00:00 2001 From: sHa Date: Sun, 4 May 2025 13:51:12 +0300 Subject: [PATCH] display brand count in filter buttons --- src/App.svelte | 4 +++- src/components/Grid.svelte | 13 ++++++++++++- src/components/List.svelte | 15 +++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index e714360..ea75e1b 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -316,16 +316,18 @@ {#if viewMode === "grid"} openPreview(e.detail)} {compactMode} /> {:else} getDefaultLogoColor(logo.colors, theme);

{logo.name}

@@ -161,14 +165,21 @@ $: getLogoThemeColor = logo => getDefaultLogoColor(logo.colors, theme); border: none; color: var(--color-text); cursor: pointer; - padding: 0.2em; + padding: 0.3em 0.8em 0.1em 0.3em; border-radius: 4px; transition: background 0.2s, color 0.2s; z-index: 2; margin-left: 0.5em; + position: relative; } .brand-filter-btn:hover { background: var(--color-accent, #4f8cff); color: #fff; } + + .brand-count { + font-size: 0.85em; + position: absolute; + bottom: 0; + } diff --git a/src/components/List.svelte b/src/components/List.svelte index 4b3e584..f49e8bc 100644 --- a/src/components/List.svelte +++ b/src/components/List.svelte @@ -6,6 +6,7 @@ import { onMount, onDestroy } from "svelte"; export let logos = []; + export let allLogos = []; export let onCopy; export let onDownload; export let setSearchQuery; @@ -167,6 +168,9 @@ + {#if allLogos && allLogos.filter(l => l.brand === logo.brand).length > 1} + {allLogos.filter(l => l.brand === logo.brand).length} + {/if}
@@ -230,10 +234,10 @@ color: #fff; } .brand-filter-btn.common-btn { - background: var(--color-accent, #4f8cff); + background: var(--secondary-color); color: #fff; border: none; - padding: 0.4em 0.6em; + padding: 0.4em 0.8em 0.4em 0.3em; border-radius: 6px; display: inline-flex; align-items: center; @@ -242,11 +246,18 @@ transition: background 0.2s, color 0.2s; margin-left: 0.5em; box-shadow: 0 1px 2px rgba(0,0,0,0.04); + position: relative; } .brand-filter-btn.common-btn:hover { background: var(--color-accent-dark, #3576c7); color: #fff; } + .brand-count-index { + position: absolute; + font-size: 0.85em; + bottom: 0.1em; + right: 0.3em; + } .logo-list-title-row { display: flex; align-items: center;