From 36f0c25721c5464efc604e8174901b2353954a1e Mon Sep 17 00:00:00 2001 From: Tomas Horsky Date: Tue, 16 Jun 2026 15:07:16 +0900 Subject: [PATCH] layout update --- src/lib/layout/TopBar.svelte | 29 +- src/lib/world-map/StatsPanel.svelte | 457 ++++++++++++++++++---------- 2 files changed, 310 insertions(+), 176 deletions(-) diff --git a/src/lib/layout/TopBar.svelte b/src/lib/layout/TopBar.svelte index d280e6a..39f88f4 100644 --- a/src/lib/layout/TopBar.svelte +++ b/src/lib/layout/TopBar.svelte @@ -29,8 +29,8 @@ class="slider" style="transform: translateX({screen === 'worldmap' ? 0 : 100}%);" > - - + + @@ -103,18 +103,18 @@ display: flex; background: var(--bg-subtle); border: 1px solid var(--border); - border-radius: 8px; - padding: 3px; + border-radius: 9999px; + padding: 4px; } .slider { position: absolute; - top: 3px; - left: 3px; - width: calc(50% - 3px); - height: calc(100% - 6px); - background: var(--bg); - border-radius: 6px; + top: 4px; + left: 4px; + width: calc(50% - 4px); + height: calc(100% - 8px); + background: var(--accent); + border-radius: 9999px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); transition: transform 0.25s ease; pointer-events: none; @@ -124,15 +124,20 @@ position: relative; z-index: 1; flex: 1; - padding: 4px 18px; + padding: 6px 24px; border: none; background: none; cursor: pointer; font-family: var(--sans); - font-size: 13px; + font-size: 14px; font-weight: 300; color: var(--text); letter-spacing: 0.01em; + transition: color 0.2s ease; + } + + .segmented button.active { + color: #fff; } .right { display: flex; diff --git a/src/lib/world-map/StatsPanel.svelte b/src/lib/world-map/StatsPanel.svelte index b8212f8..377e3fa 100644 --- a/src/lib/world-map/StatsPanel.svelte +++ b/src/lib/world-map/StatsPanel.svelte @@ -1,18 +1,46 @@ -
- -
- {total} - countries visited -
+
+ -
+ {#if !collapsed} +
+

your statistics

- -
- {pct}% - of the world -
+
+
+ {pct}% +
+ {total} / {grandTotal} countries visited -
+
- -
- - {#if segments.length > 0} - {#each segments as seg} - hoveredSeg = seg} - onmouseleave={() => hoveredSeg = null}> - - - {/each} - - {:else} - - - {/if} - - -
- - {#if hoveredSeg} -
- {hoveredSeg.cont} - {counts[hoveredSeg.cont]} / {continentTotals[hoveredSeg.cont]} + by continent + {#each CONTINENTS as continent} + {@const contTotal = continentTotals[continent]} +
+ + {continent} + {counts[continent]}/{contTotal} + {#if visitedByContinent[continent]?.length > 0} +
+ {#each visitedByContinent[continent].slice(0, 10) as country} + {country} + {/each} + {#if visitedByContinent[continent].length > 10} + ... + {/if} +
+ {/if}
- {:else} - hover a slice - {/if} -
-
+ {/each} -
+
+ {#if segments.length > 0} + + {#each segments as seg} + + + {seg.cont} + + {/each} + + + {:else} + + + + + {/if} +
- -
- -
-
+
+ +
Contains all UN countries, Kosovo, Hong Kong and Taiwan
- All UN countries · Kosovo · HK · Taiwan -
+ {/if}