diff --git a/public/global.css b/public/global.css index f81c79e..ef0bac4 100644 --- a/public/global.css +++ b/public/global.css @@ -413,57 +413,6 @@ div.logo-image img { padding-top: 0.9rem; } -.theme-switcher { - display: flex; - align-items: center; - gap: 0.2rem; - margin-left: auto; -} - -.theme-switch-group { - display: flex; - border-radius: 6px; - overflow: hidden; - border: 1px solid var(--color-border); - background: var(--color-card); -} - -.theme-switch-group button { - background: none; - border: none; - color: var(--color-text); - padding: 0.2em 0.7em; - font-size: 1.1rem; - border-radius: 0; - transition: background 0.2s, color 0.2s; - display: flex; - align-items: center; - justify-content: center; -} - -.theme-switch-group button:first-child { - border-top-left-radius: 6px; - border-bottom-left-radius: 6px; -} - -.theme-switch-group button:last-child { - border-top-right-radius: 6px; - border-bottom-right-radius: 6px; -} - -.theme-switch-group button.active, -.theme-switch-group button:focus { - background: var(--color-accent); - color: var(--white); - font-weight: bold; - outline: 2px solid var(--color-border); -} - -.theme-switch-group button:hover { - background: var(--color-accent); - color: var(--color-accent-text); -} - .logos-container { width: 100%; } @@ -595,8 +544,8 @@ footer { } textarea { - background-color: var(--background-color); - color: var(--color-text); + background-color: var(--background-color); + color: var(--color-text); } .set-circle { diff --git a/src/App.svelte b/src/App.svelte index 0356fa7..bbb4871 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -100,6 +100,7 @@ setSearchQuery, setGridView, setListView, + setCompactView, setTheme, toggleDropdown, addTag, @@ -197,13 +198,11 @@ const searchParam = params.get("search"); if (searchParam) { searchQuery = searchParam; - } - - // Restore view mode and compact mode from localStorage - const savedViewMode = localStorage.getItem("viewMode"); - if (savedViewMode === "grid" || savedViewMode === "list") { - viewMode = savedViewMode; - } + } // Restore view mode and compact mode from localStorage + const savedViewMode = localStorage.getItem("viewMode"); + if (savedViewMode === "grid" || savedViewMode === "list" || savedViewMode === "compact") { + viewMode = savedViewMode; + } const savedCompact = localStorage.getItem("compactMode"); if (savedCompact === "true" || savedCompact === "false") { setCompactMode(savedCompact === "true"); @@ -277,6 +276,7 @@ setSearchQuery, setGridView, setListView, + setCompactView, setTheme: (newTheme) => { console.log("window.appData.setTheme called with:", newTheme); setTheme(newTheme); @@ -325,6 +325,18 @@ } } + function setCompactView() { + console.log("Setting view mode to: compact"); + viewMode = "compact"; + localStorage.setItem("viewMode", "compact"); + + // Update window.appData immediately on view change + if (typeof window !== "undefined" && window.appData) { + window.appData.viewMode = "compact"; + console.log("App: Updated viewMode in window.appData to compact"); + } + } + function copyUrl(logoPath) { const url = `${window.location.origin}/${logoPath}`; // Try modern clipboard API first diff --git a/src/components/CardTiny.svelte b/src/components/CardTiny.svelte new file mode 100644 index 0000000..0ca017b --- /dev/null +++ b/src/components/CardTiny.svelte @@ -0,0 +1,108 @@ + + +
+
+ {#if isSvgLogo(logo)} + + {:else} + {logo.name} + {/if} +
+
{logo.name}
+
+ + diff --git a/src/components/Header.svelte b/src/components/Header.svelte index c2e88a0..839244b 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -8,6 +8,7 @@ export let viewMode; export let setGridView; export let setListView; + export let setCompactView; export let searchQuery; export let setSearchQuery; export let allTags = []; @@ -275,52 +276,89 @@ /> - - + + + + + @@ -410,6 +448,58 @@ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); } + .theme-switcher { + display: flex; + align-items: center; + gap: 0.2rem; + margin-left: auto; + } + + .theme-switch-group { + display: flex; + border-radius: 6px; + overflow: hidden; + border: 1px solid var(--color-border); + background: var(--color-card); + } + + .theme-switch-group button { + background: none; + border: none; + color: var(--color-text); + padding: 0.2em 0.7em; + font-size: 1.1rem; + border-radius: 0; + transition: + background 0.2s, + color 0.2s; + display: flex; + align-items: center; + justify-content: center; + } + + .theme-switch-group button:first-child { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + } + + .theme-switch-group button:last-child { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + } + + .theme-switch-group button.active, + .theme-switch-group button:focus { + background: var(--color-accent); + color: var(--white); + font-weight: bold; + } + + .theme-switch-group button:hover { + background: var(--color-accent); + color: var(--color-accent-text); + } + .compact-switch-btn { background: none; border: none; @@ -430,4 +520,37 @@ background: var(--color-accent, #4f8cff); color: #fff; } + + .view-mode-group { + display: inline-flex; + border: 1px solid var(--color-border); + border-radius: 8px; + overflow: hidden; + background: var(--color-background); + } + + .view-mode-group button { + background: none; + border: none; + color: var(--color-text); + cursor: pointer; + padding: 0.5em 0.7em; + transition: + background 0.2s, + color 0.2s; + display: flex; + align-items: center; + justify-content: center; + border-right: 1px solid var(--color-border); + border-radius: 0; + } + + .view-mode-group button:hover { + background: var(--color-card); + } + + .view-mode-group button.active { + background: var(--color-accent, #4f8cff); + color: #fff; + } diff --git a/src/components/List.svelte b/src/components/List.svelte index c8f346a..c8765bc 100644 --- a/src/components/List.svelte +++ b/src/components/List.svelte @@ -1,6 +1,7 @@