Merge feature/timeline into main

This commit is contained in:
2026-06-12 20:06:25 +09:00
18 changed files with 1590 additions and 815 deletions

12
.claude/launch.json Normal file
View File

@@ -0,0 +1,12 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "Map-Jurnal",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"port": 5173,
"autoPort": true
}
]
}

45
package-lock.json generated
View File

@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"d3": "^7.9.0", "d3": "^7.9.0",
"firebase": "^12.14.0", "firebase": "^12.14.0",
"flag-icons": "^7.5.0",
"topojson-client": "^3.1.0", "topojson-client": "^3.1.0",
"world-atlas": "^2.0.2" "world-atlas": "^2.0.2"
}, },
@@ -746,14 +747,14 @@
} }
}, },
"node_modules/@napi-rs/wasm-runtime": { "node_modules/@napi-rs/wasm-runtime": {
"version": "1.1.4", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz",
"integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", "integrity": "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"dependencies": { "dependencies": {
"@tybys/wasm-util": "^0.10.1" "@tybys/wasm-util": "^0.10.2"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@@ -930,6 +931,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -947,6 +951,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -964,6 +971,9 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -981,6 +991,9 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -998,6 +1011,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1015,6 +1031,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1816,6 +1835,12 @@
"@firebase/util": "1.15.1" "@firebase/util": "1.15.1"
} }
}, },
"node_modules/flag-icons": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/flag-icons/-/flag-icons-7.5.0.tgz",
"integrity": "sha512-kd+MNXviFIg5hijH766tt+3x76ele1AXlo4zDdCxIvqWZhKt4T83bOtxUOOMlTx/EcFdUMH5yvQgYlFh1EqqFg==",
"license": "MIT"
},
"node_modules/fsevents": { "node_modules/fsevents": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@@ -2035,6 +2060,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2056,6 +2084,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2077,6 +2108,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2098,6 +2132,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [

View File

@@ -16,6 +16,7 @@
"dependencies": { "dependencies": {
"d3": "^7.9.0", "d3": "^7.9.0",
"firebase": "^12.14.0", "firebase": "^12.14.0",
"flag-icons": "^7.5.0",
"topojson-client": "^3.1.0", "topojson-client": "^3.1.0",
"world-atlas": "^2.0.2" "world-atlas": "^2.0.2"
} }

View File

@@ -5,7 +5,7 @@
import Layout from './lib/layout/Layout.svelte'; import Layout from './lib/layout/Layout.svelte';
import WorldMap from './lib/world-map/WorldMap.svelte'; import WorldMap from './lib/world-map/WorldMap.svelte';
import StatsPanel from './lib/world-map/StatsPanel.svelte'; import StatsPanel from './lib/world-map/StatsPanel.svelte';
import TimelineView from './lib/TimelineView.svelte'; import TimelineView from './lib/timeline/TimelineView.svelte';
let screen = $state('worldmap'); let screen = $state('worldmap');
@@ -61,9 +61,10 @@
} }
.worldmap-page { .worldmap-page {
flex: 1;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 100%; min-width: 0;
height: 100%; height: 100%;
} }

View File

@@ -1,11 +1,95 @@
* { @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200;12..96,300;12..96,400&display=swap');
margin: 0;
padding: 0; /* ── Color tokens ─────────────────────────────────────────── */
box-sizing: border-box; :root {
--accent: #7c3aed; /* indigo-600 */
--accent-dark: #5b21b6;
--accent-light: #a78bfa;
--accent-bg: rgba(124, 58, 237, 0.07);
--accent-border: rgba(124, 58, 237, 0.2);
--lavender: #a78bfa;
--lavender-bg: rgba(167, 139, 250, 0.1);
/* Light-first neutrals */
--text: #52525b; /* zinc-600 */
--text-h: #18181b; /* zinc-900 */
--text-sub: #a1a1aa; /* zinc-400 */
--bg: #ffffff; /* white */
--bg-raised: #fafafa; /* off-white */
--bg-subtle: #f4f4f5; /* zinc-100 */
--border: #e4e4e7; /* zinc-200 */
--border-bright: #d4d4d8; /* zinc-300 */
--shadow: 0 4px 24px rgba(0,0,0,0.08);
/* Typography */
--sans: 'Bricolage Grotesque', system-ui, sans-serif;
--heading: 'Bricolage Grotesque', system-ui, sans-serif;
--mono: ui-monospace, Consolas, monospace;
/* Type scale */
--text-xs: 11px;
--text-sm: 13px;
--text-base: 14px;
--text-md: 16px;
--text-lg: 20px;
--text-xl: 28px;
--text-2xl: 40px;
font-family: var(--sans);
font-size: var(--text-base);
line-height: 1.6;
font-weight: 300;
letter-spacing: 0.01em;
color: var(--text);
background: var(--bg);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
html, body { /* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body, #app {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
/* ── Text hierarchy ───────────────────────────────────────── */
h1 {
font-size: var(--text-2xl);
font-weight: 400;
line-height: 1.1;
letter-spacing: -1px;
color: var(--text-h);
}
h2 {
font-size: var(--text-xl);
font-weight: 400;
line-height: 1.15;
letter-spacing: -0.5px;
color: var(--text-h);
}
h3 {
font-size: var(--text-lg);
font-weight: 300;
line-height: 1.3;
color: var(--text-h);
}
h4, h5, h6 {
font-size: var(--text-md);
font-weight: 300;
color: var(--text-h);
}
p { margin: 0; color: var(--text); }

View File

@@ -1,339 +0,0 @@
<script>
let { entry, onBack } = $props();
let photoIdx = $state(0);
function formatDate(/** @type {string} */ iso) {
return new Date(iso).toLocaleDateString('en-US', {
year: 'numeric', month: 'long', day: 'numeric',
});
}
function prev() {
photoIdx = (photoIdx - 1 + entry.photos.length) % entry.photos.length;
}
function next() {
photoIdx = (photoIdx + 1) % entry.photos.length;
}
function tripType(/** @type {string[] | undefined} */ companions) {
if (!companions || companions.length === 0 || (companions.length === 1 && companions[0] === 'solo')) return 'solo';
return 'friends';
}
function companionText(/** @type {string[] | undefined} */ companions) {
if (!companions || companions.length === 0 || (companions.length === 1 && companions[0] === 'solo')) return 'Solo';
return companions.join(', ');
}
const TRANSPORT_LABELS = {
plane: '✈️ Plane',
car: '🚗 Car',
train: '🚆 Train',
boat: '⛵ Boat',
bus: '🚌 Bus',
other: 'Other',
};
</script>
<article class="detail-page">
<button class="back-btn" onclick={onBack} aria-label="Back to timeline">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.8"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Back
</button>
{#if entry.photos?.length > 0}
<div class="hero-gallery">
<img
class="hero-img"
src={entry.photos[photoIdx]}
alt="{entry.title} photo {photoIdx + 1}"
loading="lazy"
/>
{#if entry.photos.length > 1}
<button class="arr left" onclick={prev} aria-label="Previous photo"></button>
<button class="arr right" onclick={next} aria-label="Next photo"></button>
<div class="thumb-strip">
{#each entry.photos as photo, i}
<button
class="thumb"
class:active={i === photoIdx}
onclick={() => (photoIdx = i)}
aria-label="Photo {i + 1}"
>
<img src={photo} alt="" />
</button>
{/each}
</div>
{/if}
<span class="photo-counter">{photoIdx + 1} / {entry.photos.length}</span>
</div>
{/if}
<div class="detail-content">
<div class="meta-row">
<span class="badge loc-badge">📍 {entry.city}, {entry.countryName}</span>
<span class="badge" class:trip-badge--solo={tripType(entry.companions) === 'solo'} class:trip-badge--friends={tripType(entry.companions) === 'friends'}>
{tripType(entry.companions) === 'solo' ? '🧍 Solo' : '👥 ' + companionText(entry.companions)}
</span>
{#if entry.transportation}
<span class="badge transport-badge">{TRANSPORT_LABELS[entry.transportation] || entry.transportation}</span>
{/if}
</div>
<h1 class="detail-title">{entry.title}</h1>
<div class="stats-row">
<div class="stat">
<span class="stat-label">Date</span>
<time class="stat-value" datetime={entry.date}>{formatDate(entry.date)}</time>
</div>
<div class="stat-divider"></div>
<div class="stat">
<span class="stat-label">Duration</span>
<span class="stat-value">{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
</div>
</div>
<hr class="section-divider" />
<p class="detail-memo">{entry.memo}</p>
<hr class="section-divider" />
<div class="song-row">
<div class="song-icon-wrap" aria-hidden="true">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
<path d="M9 18V5l12-2v13" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="6" cy="18" r="3" stroke="currentColor" stroke-width="2"/>
<circle cx="18" cy="16" r="3" stroke="currentColor" stroke-width="2"/>
</svg>
</div>
<div class="song-text">
<span class="song-label">Soundtrack</span>
<span class="song-name">{entry.song?.title || ''}</span>
<span class="song-artist">{entry.song?.artist || ''}</span>
</div>
</div>
</div>
</article>
<style>
.detail-page {
max-width: 680px;
margin: 0 auto;
padding: 32px 24px 80px;
font-family: var(--sans, system-ui, sans-serif);
}
.back-btn {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 500;
color: var(--text, #6b6375);
background: none;
border: none;
cursor: pointer;
padding: 6px 0;
margin-bottom: 28px;
transition: color 0.15s;
}
.back-btn:hover { color: var(--accent, #aa3bff); }
.hero-gallery {
position: relative;
border-radius: 16px;
overflow: hidden;
background: #000;
margin-bottom: 28px;
}
.hero-img {
width: 100%;
height: 380px;
object-fit: cover;
display: block;
}
.arr {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0,0,0,0.45);
color: #fff;
border: none;
width: 40px;
height: 40px;
border-radius: 50%;
font-size: 24px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
z-index: 2;
}
.arr:hover { background: rgba(0,0,0,0.7); }
.arr.left { left: 14px; }
.arr.right { right: 14px; }
.photo-counter {
position: absolute;
top: 14px;
right: 14px;
font-size: 12px;
font-weight: 500;
color: #fff;
background: rgba(0,0,0,0.45);
padding: 3px 10px;
border-radius: 20px;
z-index: 2;
}
.thumb-strip {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 8px;
z-index: 2;
}
.thumb {
width: 52px;
height: 36px;
border-radius: 6px;
overflow: hidden;
border: 2px solid transparent;
padding: 0;
cursor: pointer;
opacity: 0.65;
background: none;
transition: border-color 0.15s, opacity 0.15s;
}
.thumb.active { border-color: #fff; opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-content { text-align: left; }
.meta-row {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-bottom: 14px;
}
.badge {
font-size: 12px;
font-weight: 500;
padding: 4px 10px;
border-radius: 20px;
}
.loc-badge {
background: var(--accent-bg, rgba(170,59,255,0.08));
color: var(--accent, #aa3bff);
}
.trip-badge--solo { background: rgba(245,158,11,0.12); color: #b45309; }
.trip-badge--friends { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.transport-badge {
background: rgba(16,185,129,0.12);
color: #059669;
}
.detail-title {
font-size: 28px;
font-weight: 700;
color: var(--text-h, #08060d);
margin: 0 0 20px;
letter-spacing: -0.6px;
line-height: 1.2;
}
.stats-row {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 24px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label {
font-size: 11px;
letter-spacing: 1.5px;
text-transform: uppercase;
color: var(--text, #6b6375);
}
.stat-value {
font-size: 15px;
font-weight: 600;
color: var(--text-h, #08060d);
}
.stat-divider {
width: 1px;
height: 32px;
background: var(--border, #e5e4e7);
}
.section-divider {
border: none;
border-top: 1px solid var(--border, #e5e4e7);
margin: 24px 0;
}
.detail-memo {
font-size: 16px;
line-height: 1.75;
color: var(--text, #6b6375);
margin: 0;
}
.song-row { display: flex; align-items: center; gap: 14px; }
.song-icon-wrap {
width: 44px;
height: 44px;
border-radius: 50%;
background: var(--accent-bg, rgba(170,59,255,0.08));
color: var(--accent, #aa3bff);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.song-text { display: flex; flex-direction: column; gap: 2px; }
.song-label {
font-size: 11px;
letter-spacing: 1.5px;
text-transform: uppercase;
color: var(--text, #6b6375);
}
.song-name {
font-size: 15px;
font-weight: 600;
color: var(--text-h, #08060d);
}
.song-artist { font-size: 13px; color: var(--text, #6b6375); }
@media (max-width: 600px) {
.detail-page { padding: 24px 16px 60px; }
.hero-img { height: 260px; }
.detail-title { font-size: 22px; }
.thumb { width: 40px; height: 28px; }
}
</style>

View File

@@ -1,365 +0,0 @@
<script>
import { getEntries } from './stores/entriesStore.svelte.js';
import JournalDetail from './JournalDetail.svelte';
/** @type {Record<string, number>} */
let selected = $state(null);
/** @type {Record<string, number>} */
let photoIdx = $state({});
let entries = $derived(getEntries());
const sortOptions = [
{ value: 'date-desc', label: 'Newest First' },
{ value: 'date-asc', label: 'Oldest First' },
{ value: 'country-asc', label: 'Country A → Z' },
{ value: 'country-desc', label: 'Country Z → A' },
];
let sortKey = $state('date-desc');
let sortedEntries = $derived.by(() => {
const key = sortKey;
return [...entries].sort((a, b) => {
if (key === 'date-asc') return a.date.localeCompare(b.date);
if (key === 'date-desc') return b.date.localeCompare(a.date);
if (key === 'country-asc') return (a.countryName || '').localeCompare(b.countryName || '') || b.date.localeCompare(a.date);
if (key === 'country-desc') return (b.countryName || '').localeCompare(a.countryName || '') || b.date.localeCompare(a.date);
return 0;
});
});
function formatDate(/** @type {string} */ iso) {
return new Date(iso).toLocaleDateString('en-US', {
year: 'numeric', month: 'short', day: 'numeric',
});
}
function stepPhoto(/** @type {string} */ id, /** @type {number} */ total, /** @type {1|-1} */ dir, /** @type {Event} */ e) {
e.stopPropagation();
const cur = photoIdx[id] ?? 0;
photoIdx = { ...photoIdx, [id]: (cur + dir + total) % total };
}
function setPhoto(/** @type {string} */ id, /** @type {number} */ i, /** @type {Event} */ e) {
e.stopPropagation();
photoIdx = { ...photoIdx, [id]: i };
}
function tripType(/** @type {string[] | undefined} */ companions) {
if (!companions || companions.length === 0 || (companions.length === 1 && companions[0] === 'solo')) return 'solo';
return 'friends';
}
function companionText(/** @type {string[] | undefined} */ companions) {
if (!companions || companions.length === 0 || (companions.length === 1 && companions[0] === 'solo')) return 'Solo';
return companions.join(', ');
}
const TRANSPORT_LABELS = {
plane: '✈️ Plane',
car: '🚗 Car',
train: '🚆 Train',
boat: '⛵ Boat',
bus: '🚌 Bus',
other: 'Other',
};
</script>
{#if selected}
<JournalDetail entry={selected} onBack={() => (selected = null)} />
{:else}
<section class="timeline-view">
<header class="toolbar">
<div class="title-block">
<p class="eyebrow">Travel Journal</p>
<h1 class="page-title">My Journey</h1>
</div>
<div class="sort-control">
<label for="sort-select">Sort</label>
<select id="sort-select" onchange={(e) => (sortKey = e.currentTarget.value)}>
{#each sortOptions as opt}
<option value={opt.value} selected={opt.value === sortKey}>{opt.label}</option>
{/each}
</select>
</div>
</header>
{#if sortedEntries.length === 0}
<p class="empty">No journal entries yet.</p>
{:else}
<ol class="v-list">
{#each sortedEntries as entry (entry.id)}
{@const idx = photoIdx[entry.id] ?? 0}
<li class="v-item">
<div class="v-dot" aria-hidden="true"></div>
<div class="v-entry-wrap">
<div class="above-card">
<time class="above-date" datetime={entry.date}>{formatDate(entry.date)}</time>
<span class="above-sep">·</span>
<span class="above-loc">{entry.city}, {entry.countryName}</span>
<span class="above-sep">·</span>
<span class="above-days">{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
</div>
<div class="entry-card" role="button" tabindex="0"
onclick={() => (selected = entry)}
onkeydown={(e) => e.key === 'Enter' && (selected = entry)}>
{#if entry.photos?.length > 0}
<div class="gallery">
<img class="gallery-main" src={entry.photos[idx]}
alt="{entry.title} photo {idx + 1}" loading="lazy" />
{#if entry.photos.length > 1}
<button class="gallery-arrow left"
onclick={(e) => stepPhoto(entry.id, entry.photos.length, -1, e)}
aria-label="Previous photo"></button>
<button class="gallery-arrow right"
onclick={(e) => stepPhoto(entry.id, entry.photos.length, 1, e)}
aria-label="Next photo"></button>
<div class="gallery-dots">
{#each entry.photos as _, i}
<button class="gallery-pip" class:active={i === idx}
onclick={(e) => setPhoto(entry.id, i, e)}
aria-label="Photo {i + 1}"></button>
{/each}
</div>
{/if}
</div>
{/if}
<div class="entry-body">
<h2 class="entry-title">{entry.title}</h2>
{#if entry.memo}
<p class="entry-memo">{entry.memo}</p>
{/if}
<div class="entry-song">
{#if entry.transportation && TRANSPORT_LABELS[entry.transportation]}
<span class="transport-badge">{TRANSPORT_LABELS[entry.transportation]}</span>
{/if}
<svg class="song-icon" width="13" height="13" viewBox="0 0 24 24" fill="none">
<path d="M9 18V5l12-2v13" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="6" cy="18" r="3" stroke="currentColor" stroke-width="2"/>
<circle cx="18" cy="16" r="3" stroke="currentColor" stroke-width="2"/>
</svg>
<span class="song-title">{entry.song?.title || ''}</span>
<span class="song-sep">·</span>
<span class="song-artist">{entry.song?.artist || ''}</span>
<span class="trip-badge" class:trip-badge--solo={tripType(entry.companions) === 'solo'} class:trip-badge--friends={tripType(entry.companions) === 'friends'}>
{companionText(entry.companions)}
</span>
</div>
</div>
</div>
</div>
</li>
{/each}
</ol>
{/if}
<footer class="page-footer">
{sortedEntries.length} {sortedEntries.length === 1 ? 'entry' : 'entries'}
</footer>
</section>
{/if}
<style>
.timeline-view {
max-width: 600px;
margin: 0 auto;
padding: 48px 24px 64px;
font-family: var(--sans, system-ui, sans-serif);
}
.toolbar {
display: flex;
align-items: flex-end;
justify-content: space-between;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 48px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border, #e5e4e7);
}
.eyebrow {
font-size: 11px;
letter-spacing: 3px;
text-transform: uppercase;
color: var(--accent, #aa3bff);
margin: 0 0 6px;
}
.page-title {
font-size: 32px;
font-weight: 700;
color: var(--text-h, #08060d);
margin: 0;
letter-spacing: -0.8px;
}
.sort-control { display: flex; align-items: center; gap: 8px; }
.sort-control label { font-size: 13px; color: var(--text, #6b6375); }
select {
font-size: 13px;
padding: 7px 28px 7px 10px;
border: 1px solid var(--border, #e5e4e7);
border-radius: 8px;
background: var(--bg, #fff);
color: var(--text-h, #08060d);
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6375' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
}
select:focus { outline: 2px solid var(--accent, #aa3bff); outline-offset: 2px; }
.above-card {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
margin-bottom: 8px;
}
.above-date { font-size: 12px; font-weight: 500; color: var(--text-h, #08060d); }
.above-loc, .above-days { font-size: 12px; color: var(--text, #6b6375); }
.above-sep { font-size: 11px; color: var(--border, #c8c6cc); user-select: none; }
.entry-card {
display: block;
width: 100%;
box-sizing: border-box;
border: 1px solid var(--border, #e5e4e7);
border-radius: 14px;
overflow: hidden;
background: var(--bg, #fff);
cursor: pointer;
transition: box-shadow 0.2s, transform 0.15s;
text-align: left;
}
.entry-card:hover {
box-shadow: 0 6px 24px rgba(0,0,0,0.1);
transform: translateY(-2px);
}
.entry-body { padding: 14px 18px 18px; }
.entry-song { gap: 5px; }
.entry-song .trip-badge { margin-left: auto; flex-shrink: 0; }
.trip-badge {
display: inline-block;
font-size: 11px;
font-weight: 500;
padding: 2px 8px;
border-radius: 20px;
}
.trip-badge--solo { background: rgba(245,158,11,0.12); color: #b45309; }
.trip-badge--friends { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.transport-badge {
font-size: 11px;
font-weight: 500;
color: #6b6375;
flex-shrink: 0;
}
.entry-title {
font-size: 16px;
font-weight: 600;
color: var(--text-h, #08060d);
margin: 0 0 6px;
letter-spacing: -0.2px;
}
.entry-memo {
font-size: 13px;
line-height: 1.6;
color: var(--text, #6b6375);
margin: 0 0 10px;
}
.entry-song {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
color: var(--text, #6b6375);
padding-top: 10px;
border-top: 1px solid var(--border, #e5e4e7);
}
.song-icon { flex-shrink: 0; color: var(--accent, #aa3bff); }
.song-title { font-weight: 500; color: var(--text-h, #08060d); }
.song-sep { opacity: 0.35; }
.gallery { position: relative; overflow: hidden; background: #000; }
.gallery-main { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-arrow {
position: absolute; top: 50%; transform: translateY(-50%);
background: rgba(0,0,0,0.45); color: #fff;
border: none; width: 32px; height: 32px; border-radius: 50%;
font-size: 20px; cursor: pointer;
display: flex; align-items: center; justify-content: center;
transition: background 0.15s; z-index: 2;
}
.gallery-arrow:hover { background: rgba(0,0,0,0.7); }
.gallery-arrow.left { left: 10px; }
.gallery-arrow.right { right: 10px; }
.gallery-dots {
position: absolute; bottom: 8px; left: 50%;
transform: translateX(-50%);
display: flex; gap: 5px; z-index: 2;
}
.gallery-pip {
width: 6px; height: 6px; border-radius: 50%;
border: none; background: rgba(255,255,255,0.5);
cursor: pointer; padding: 0;
transition: background 0.15s, transform 0.15s;
}
.gallery-pip.active { background: #fff; transform: scale(1.3); }
.v-list { list-style: none; padding: 0; margin: 0; position: relative; }
.v-list::before {
content: '';
position: absolute; left: 10px; top: 6px; bottom: 6px;
width: 2px; background: var(--border, #e5e4e7); border-radius: 1px;
}
.v-item { display: flex; gap: 24px; align-items: flex-start; padding-bottom: 36px; }
.v-item:last-child { padding-bottom: 0; }
.v-dot {
flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
background: var(--accent, #aa3bff);
border: 3px solid var(--bg, #fff);
box-shadow: 0 0 0 2px var(--accent, #aa3bff);
margin-top: 28px; z-index: 1;
}
.v-entry-wrap { flex: 1; display: flex; flex-direction: column; }
.page-footer {
margin-top: 40px;
text-align: center;
font-size: 13px;
color: var(--text, #6b6375);
padding-top: 24px;
border-top: 1px solid var(--border, #e5e4e7);
}
.empty { text-align: center; color: var(--text, #6b6375); padding: 80px 0; }
@media (max-width: 600px) {
.timeline-view { padding: 32px 16px 48px; }
.page-title { font-size: 26px; }
.v-list::before { left: 8px; }
.v-dot { width: 18px; height: 18px; }
.v-item { gap: 16px; }
.gallery-main { height: 180px; }
}
</style>

View File

@@ -1,19 +1,25 @@
<script>
import { getSelected, getTotalCount } from './selection.svelte.js';
</script>
<footer class="footer"> <footer class="footer">
© 2026 Tomas Horsky &amp; Haeri Kim <span>{getSelected().size} / {getTotalCount()} countries visited</span>
</footer> </footer>
<style> <style>
.footer { .footer {
height: 32px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: center;
padding-right: 24px; font-family: var(--sans);
background: #334155; font-size: 12px;
font: 15px/1.6 sans-serif; font-weight: 300;
color: #cbd5e1; color: var(--text-sub);
position: relative; border-top: 1px solid var(--border);
z-index: 10; background: var(--bg);
box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1); flex-shrink: 0;
letter-spacing: 0.06em;
text-transform: uppercase;
} }
</style> </style>

View File

@@ -25,5 +25,9 @@
.main { .main {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
display: flex;
flex-direction: row;
width: 100%;
height: 100%;
} }
</style> </style>

View File

@@ -20,7 +20,6 @@
<div class="topbar"> <div class="topbar">
<div class="left"> <div class="left">
<img src="/logo.png" alt="Logo" class="logo" />
<span class="app-name">Map Journal</span> <span class="app-name">Map Journal</span>
</div> </div>
@@ -66,15 +65,16 @@
<style> <style>
.topbar { .topbar {
height: 64px; height: 52px;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24px; padding: 0 32px;
background: #1e2937;
gap: 16px; gap: 16px;
position: relative; position: relative;
z-index: 10; z-index: 10;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); border-bottom: 1px solid var(--border);
background: var(--bg);
flex-shrink: 0;
} }
.left { .left {
@@ -83,17 +83,11 @@
gap: 10px; gap: 10px;
} }
.logo {
width: 75px;
height: 75px;
border-radius: 10px;
object-fit: cover;
flex-shrink: 0;
}
.app-name { .app-name {
font: 700 20px/1.2 sans-serif; font-family: var(--heading);
color: #f1f5f9; font-size: 14px;
font-weight: 400;
color: var(--text-h);
white-space: nowrap; white-space: nowrap;
} }
@@ -106,20 +100,21 @@
.segmented { .segmented {
position: relative; position: relative;
display: flex; display: flex;
background: rgba(255, 255, 255, 0.1); background: var(--bg-subtle);
border-radius: 999px; border: 1px solid var(--border);
padding: 4px; border-radius: 8px;
width: 300px; padding: 3px;
} }
.slider { .slider {
position: absolute; position: absolute;
top: 4px; top: 3px;
left: 4px; left: 3px;
width: calc(50% - 4px); width: calc(50% - 3px);
height: calc(100% - 8px); height: calc(100% - 6px);
background: #fff; background: var(--bg);
border-radius: 999px; border-radius: 6px;
box-shadow: 0 1px 4px rgba(0,0,0,0.08);
transition: transform 0.25s ease; transition: transform 0.25s ease;
pointer-events: none; pointer-events: none;
} }
@@ -128,12 +123,15 @@
position: relative; position: relative;
z-index: 1; z-index: 1;
flex: 1; flex: 1;
padding: 10px 20px; padding: 4px 18px;
border: none; border: none;
background: none; background: none;
cursor: pointer; cursor: pointer;
font: 500 16px/1.4 sans-serif; font-family: var(--sans);
color: #cbd5e1; font-size: 13px;
font-weight: 300;
color: var(--text);
letter-spacing: 0.01em;
} }
.right { .right {
@@ -155,8 +153,8 @@
} }
.avatar { .avatar {
width: 45px; width: 32px;
height: 45px; height: 32px;
border-radius: 50%; border-radius: 50%;
object-fit: cover; object-fit: cover;
flex-shrink: 0; flex-shrink: 0;
@@ -166,12 +164,12 @@
position: absolute; position: absolute;
top: calc(100% + 8px); top: calc(100% + 8px);
right: 0; right: 0;
background: #1e2937; background: var(--bg);
border: 1px solid #334155; border: 1px solid var(--border);
border-radius: 10px; border-radius: 10px;
padding: 8px 0; padding: 8px 0;
min-width: 200px; min-width: 200px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); box-shadow: var(--shadow);
z-index: 50; z-index: 50;
} }
@@ -184,17 +182,17 @@
.menu-name { .menu-name {
font: 600 14px/1.3 sans-serif; font: 600 14px/1.3 sans-serif;
color: #f1f5f9; color: var(--text-h);
} }
.menu-email { .menu-email {
font: 400 12px/1.3 sans-serif; font: 400 12px/1.3 sans-serif;
color: #94a3b8; color: var(--text-sub);
} }
.divider { .divider {
height: 1px; height: 1px;
background: #334155; background: var(--border);
margin: 6px 0; margin: 6px 0;
} }
@@ -205,13 +203,13 @@
background: none; background: none;
text-align: left; text-align: left;
font: 400 14px/1.4 sans-serif; font: 400 14px/1.4 sans-serif;
color: #fca5a5; color: #ef4444;
cursor: pointer; cursor: pointer;
transition: background 0.15s; transition: background 0.15s;
} }
.menu-item:hover { .menu-item:hover {
background: rgba(255, 255, 255, 0.05); background: var(--bg-subtle);
} }
.backdrop { .backdrop {

View File

@@ -0,0 +1,167 @@
<script>
/**
* Reusable photo gallery with prev/next arrows and indicator.
* @type {{
* photos: string[],
* height?: string,
* thumbs?: boolean,
* counter?: boolean,
* onStep?: (e: Event) => void,
* }}
*/
let { photos, height = '220px', thumbs = false, counter = false } = $props();
let idx = $state(0);
function prev(e) {
e?.stopPropagation();
idx = (idx - 1 + photos.length) % photos.length;
}
function next(e) {
e?.stopPropagation();
idx = (idx + 1) % photos.length;
}
function go(i, e) {
e?.stopPropagation();
idx = i;
}
// Reset when photos change (e.g. navigating to a different entry)
$effect(() => {
photos;
idx = 0;
});
</script>
{#if photos.length > 0}
<div class="gallery" style="--gallery-height: {height}">
<img class="gallery-img" src={photos[idx]} alt="photo {idx + 1}" loading="lazy" />
{#if photos.length > 1}
<button class="arr left" onclick={prev} aria-label="Previous photo"></button>
<button class="arr right" onclick={next} aria-label="Next photo"></button>
{#if thumbs}
<div class="thumb-strip">
{#each photos as photo, i}
<button class="thumb" class:active={i === idx} onclick={(e) => go(i, e)} aria-label="Photo {i + 1}">
<img src={photo} alt="" />
</button>
{/each}
</div>
{:else}
<div class="dots">
{#each photos as _, i}
<button class="pip" class:active={i === idx} onclick={(e) => go(i, e)} aria-label="Photo {i + 1}"></button>
{/each}
</div>
{/if}
{/if}
{#if counter}
<span class="counter">{idx + 1} / {photos.length}</span>
{/if}
</div>
{/if}
<style>
.gallery {
position: relative;
overflow: hidden;
background: #000;
}
.gallery-img {
width: 100%;
height: var(--gallery-height);
object-fit: cover;
display: block;
}
.arr {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0,0,0,0.45);
color: #fff;
border: none;
border-radius: 50%;
font-size: 22px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
z-index: 2;
width: 36px;
height: 36px;
}
.arr:hover { background: rgba(0,0,0,0.7); }
.arr.left { left: 10px; }
.arr.right { right: 10px; }
/* Dot indicators (timeline cards) */
.dots {
position: absolute;
bottom: 8px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 5px;
z-index: 2;
}
.pip {
width: 6px;
height: 6px;
border-radius: 50%;
border: none;
background: rgba(255,255,255,0.5);
cursor: pointer;
padding: 0;
transition: background 0.15s, transform 0.15s;
}
.pip.active { background: #fff; transform: scale(1.3); }
/* Thumbnail strip (detail page) */
.thumb-strip {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 8px;
z-index: 2;
}
.thumb {
width: 52px;
height: 36px;
border-radius: 6px;
overflow: hidden;
border: 2px solid transparent;
padding: 0;
cursor: pointer;
opacity: 0.65;
background: none;
transition: border-color 0.15s, opacity 0.15s;
}
.thumb.active { border-color: #fff; opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Photo counter badge */
.counter {
position: absolute;
top: 14px;
right: 14px;
font-size: 12px;
font-weight: 300;
color: #fff;
background: rgba(0,0,0,0.45);
padding: 3px 10px;
border-radius: 20px;
z-index: 2;
}
@media (max-width: 600px) {
.thumb { width: 40px; height: 28px; }
}
</style>

View File

@@ -0,0 +1,401 @@
<script>
/** @type {{ entry: import('../stores/journalStore.js').JournalEntry, onBack: () => void }} */
let { entry, onBack } = $props();
const countryCodeMap = {
'Japan': 'JP', 'France': 'FR', 'Spain': 'ES', 'USA': 'US',
'Thailand': 'TH', 'Germany': 'DE', 'Italy': 'IT', 'UK': 'GB',
'Australia': 'AU', 'Canada': 'CA', 'China': 'CN', 'India': 'IN',
'Brazil': 'BR', 'Mexico': 'MX', 'Portugal': 'PT', 'Netherlands': 'NL',
'Greece': 'GR', 'Turkey': 'TR', 'Vietnam': 'VN', 'Indonesia': 'ID',
'South Korea': 'KR', 'Singapore': 'SG', 'Taiwan': 'TW', 'New Zealand': 'NZ',
};
function flagEmoji(country) {
const code = countryCodeMap[country];
if (!code) return '';
return [...code].map(c => String.fromCodePoint(0x1F1E6 - 65 + c.charCodeAt(0))).join('');
}
function formatDate(iso) {
return new Date(iso).toLocaleDateString('en-US', {
weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',
});
}
let lightboxSrc = $state(null);
</script>
<!-- Lightbox -->
{#if lightboxSrc}
<div class="lightbox" onclick={() => lightboxSrc = null} role="button" tabindex="0"
onkeydown={(e) => e.key === 'Escape' && (lightboxSrc = null)}>
<img src={lightboxSrc} alt="" />
</div>
{/if}
<div class="detail-layout">
<!-- ── Left: photo grid ── -->
<div class="photo-col">
<!-- Country overlay top-left -->
<div class="photo-country">
<span class="photo-flag">{flagEmoji(entry.location.country)}</span>
<div>
<p class="photo-city">{entry.location.city}</p>
<p class="photo-country-name">{entry.location.country}</p>
</div>
</div>
<div class="photo-scroll">
{#if entry.photos.length === 0}
<div class="no-photos">No photos</div>
{:else}
<div class="photo-grid">
{#each entry.photos as photo, i}
<div class="photo-cell" class:cell-wide={i === 0 && entry.photos.length > 1}>
<img src={photo} alt=""
onclick={() => lightboxSrc = photo}
onerror={(e) => e.currentTarget.parentElement.classList.add('cell-broken')} />
</div>
{/each}
</div>
{/if}
</div>
</div>
<!-- ── Right: Q&A ── -->
<div class="info-col">
<div class="info-inner">
<div class="qa-list">
<div class="qa-item">
<p class="question">When did you go?</p>
<p class="answer">{formatDate(entry.date)}</p>
</div>
<div class="qa-item">
<p class="question">How long did you stay?</p>
<p class="answer">{entry.days} {entry.days === 1 ? 'day' : 'days'}</p>
</div>
<div class="qa-item">
<p class="question">Who did you go with?</p>
<p class="answer">
{#if entry.tripType === 'solo'}
Just me — solo trip
{:else}
With friends
{/if}
</p>
</div>
<div class="qa-item">
<p class="question">How was it?</p>
<p class="answer memo">{entry.memo}</p>
</div>
<div class="qa-item">
<p class="question">Trip soundtrack</p>
<div class="song-answer">
<div class="song-icon">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 18V5l12-2v13"/>
<circle cx="6" cy="18" r="3"/>
<circle cx="18" cy="16" r="3"/>
</svg>
</div>
<div>
<p class="song-title">{entry.song.title}</p>
<p class="song-artist">{entry.song.artist}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ── Floating action buttons ── -->
<div class="fab-group">
<button class="fab fab-delete" title="Delete entry">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
<path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/>
</svg>
</button>
<button class="fab fab-edit" title="Edit entry">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
</svg>
Edit
</button>
</div>
</div>
<style>
/* ── Two-column layout ── */
.detail-layout {
display: flex;
flex-direction: row;
height: 100%;
position: relative;
overflow: hidden;
}
/* ── Left: photos ── */
.photo-col {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: #f0f0f0;
}
/* Country bar at top of photo column */
.photo-country {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 16px;
background: var(--bg);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.photo-flag { font-size: 20px; line-height: 1; }
.photo-city {
font-size: 11px;
font-weight: 300;
color: var(--text-sub);
letter-spacing: 0.08em;
text-transform: uppercase;
}
.photo-country-name {
font-size: 15px;
font-weight: 400;
color: var(--text-h);
letter-spacing: -0.2px;
line-height: 1.2;
}
.photo-scroll {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.photo-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px;
grid-auto-rows: 200px;
}
.photo-cell {
overflow: hidden;
background: var(--bg-subtle);
border-radius: 4px;
cursor: zoom-in;
}
/* First photo spans full width when there are multiple */
.photo-cell.cell-wide {
grid-column: 1 / -1;
grid-row: span 2;
}
.photo-cell img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform 0.2s ease;
}
.photo-cell:hover img { transform: scale(1.03); }
.photo-cell.cell-broken {
display: flex;
align-items: center;
justify-content: center;
color: var(--text-sub);
font-size: 12px;
}
.no-photos {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-sub);
font-size: 14px;
}
/* ── Right: Q&A ── */
.info-col {
width: 440px;
flex-shrink: 0;
overflow-y: auto;
border-left: 1px solid var(--border);
background: var(--bg);
}
.info-inner {
padding: 40px 32px 100px;
}
/* Heading */
.entry-heading {
margin-bottom: 36px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border);
}
.entry-city {
font-size: 12px;
font-weight: 300;
color: var(--text-sub);
letter-spacing: 0.08em;
text-transform: uppercase;
margin-bottom: 2px;
}
.entry-country {
font-size: 24px;
font-weight: 400;
color: var(--text-h);
letter-spacing: -0.5px;
line-height: 1.1;
}
/* Q&A list */
.qa-list {
display: flex;
flex-direction: column;
gap: 0;
}
.qa-item {
padding: 20px 0;
border-bottom: 1px solid var(--border);
}
.qa-item:first-child { padding-top: 0; }
.qa-item:last-child { border-bottom: none; }
.question {
font-size: 11px;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--accent);
margin-bottom: 8px;
}
.answer {
font-size: 15px;
font-weight: 300;
color: var(--text-h);
line-height: 1.5;
}
.answer.memo {
font-size: 14px;
color: var(--text);
line-height: 1.75;
}
/* Song answer */
.song-answer {
display: flex;
align-items: center;
gap: 10px;
}
.song-icon {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--accent-bg);
color: var(--accent);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.song-title {
font-size: 14px;
font-weight: 400;
color: var(--text-h);
}
.song-artist {
font-size: 12px;
font-weight: 300;
color: var(--text-sub);
margin-top: 2px;
}
/* ── Floating action buttons ── */
.fab-group {
position: absolute;
bottom: 32px;
right: 28px;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 10px;
z-index: 10;
}
.fab {
display: flex;
align-items: center;
gap: 7px;
font-family: var(--sans);
font-size: 13px;
font-weight: 300;
padding: 10px 18px 10px 14px;
border-radius: 40px;
border: 1px solid var(--border);
cursor: pointer;
box-shadow: 0 4px 16px rgba(0,0,0,0.1);
transition: box-shadow 0.15s, transform 0.15s;
letter-spacing: 0.02em;
}
.fab:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.15); transform: translateY(-1px); }
.fab-edit {
background: var(--accent);
color: #fff;
border-color: transparent;
}
.fab-delete {
background: var(--bg);
color: var(--text);
padding: 10px 14px;
border-radius: 50%;
width: 40px;
height: 40px;
justify-content: center;
}
.fab-delete:hover { color: #dc2626; border-color: #fca5a5; }
/* ── Lightbox ── */
.lightbox {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.9);
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
cursor: zoom-out;
}
.lightbox img {
max-width: 90vw;
max-height: 90vh;
object-fit: contain;
border-radius: 4px;
}
/* ── Responsive ── */
@media (max-width: 700px) {
.detail-layout { flex-direction: column; overflow-y: auto; }
.photo-col { height: 260px; flex: none; }
.info-col { width: 100%; border-left: none; border-top: 1px solid var(--border); }
.fab-group { bottom: 20px; right: 16px; }
}
</style>

View File

@@ -0,0 +1,215 @@
<script>
/** @type {{ entries: import('../stores/journalStore.js').JournalEntry[] }} */
let { entries } = $props();
let stats = $derived.by(() => {
if (entries.length === 0) return null;
const totalDays = entries.reduce((s, e) => s + e.days, 0);
const countries = [...new Set(entries.map(e => e.location.country))];
const cities = [...new Set(entries.map(e => e.location.city))];
const countryCounts = {};
for (const e of entries) countryCounts[e.location.country] = (countryCounts[e.location.country] ?? 0) + 1;
const topCountry = Object.entries(countryCounts).sort((a, b) => b[1] - a[1])[0];
const soloCount = entries.filter(e => e.tripType === 'solo').length;
const soloPct = Math.round(soloCount / entries.length * 100);
const years = entries.map(e => new Date(e.date).getFullYear());
const minYear = Math.min(...years);
const maxYear = Math.max(...years);
const yearRange = minYear === maxYear ? `${minYear}` : `${minYear} ${maxYear}`;
const latest = [...entries].sort((a, b) => b.date.localeCompare(a.date))[0];
return { totalDays, countries, cities, topCountry, soloCount, soloPct, yearRange, latest, tripCount: entries.length };
});
</script>
{#if stats}
<div class="summary">
<p class="eyebrow">My Journey</p>
<p class="year-range">{stats.yearRange}</p>
<div class="divider"></div>
<!-- Big stats -->
<div class="stat-stack">
<div class="stat-row">
<span class="stat-num">{stats.countries.length}</span>
<span class="stat-lbl">Countries</span>
</div>
<div class="stat-row">
<span class="stat-num">{stats.cities.length}</span>
<span class="stat-lbl">Cities</span>
</div>
<div class="stat-row">
<span class="stat-num">{stats.totalDays}</span>
<span class="stat-lbl">Days abroad</span>
</div>
<div class="stat-row">
<span class="stat-num">{stats.tripCount}</span>
<span class="stat-lbl">Trips</span>
</div>
</div>
<div class="divider"></div>
<!-- Most visited -->
<div class="insight">
<span class="insight-label">Most visited</span>
<span class="insight-value">{stats.topCountry[0]}</span>
<span class="insight-sub">{stats.topCountry[1]} {stats.topCountry[1] === 1 ? 'trip' : 'trips'}</span>
</div>
<!-- Latest trip -->
<div class="insight">
<span class="insight-label">Latest trip</span>
<span class="insight-value">{stats.latest.location.city}</span>
<span class="insight-sub">{stats.latest.location.country}</span>
</div>
<div class="divider"></div>
<!-- Trip style bar -->
<div class="style-section">
<span class="insight-label">Trip style</span>
<div class="style-bar">
<div class="style-fill" style="width: {stats.soloPct}%"></div>
</div>
<div class="style-legend">
<span><span class="dot solo-dot"></span> {stats.soloPct}% Solo</span>
<span><span class="dot friends-dot"></span> {100 - stats.soloPct}% Friends</span>
</div>
</div>
</div>
{/if}
<style>
.summary {
display: flex;
flex-direction: column;
gap: 0;
}
.eyebrow {
font-size: var(--text-xs);
font-weight: 400;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--accent);
margin-bottom: 4px;
}
.year-range {
font-size: var(--text-lg);
font-weight: 400;
color: var(--text-h);
letter-spacing: -0.3px;
}
.divider {
height: 1px;
background: var(--border);
margin: 20px 0;
}
/* Stat stack */
.stat-stack {
display: flex;
flex-direction: column;
gap: 14px;
}
.stat-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
}
.stat-num {
font-size: var(--text-2xl);
font-weight: 400;
color: var(--text-h);
letter-spacing: -1px;
line-height: 1;
}
.stat-lbl {
font-size: var(--text-xs);
font-weight: 300;
color: var(--text-sub);
text-transform: uppercase;
letter-spacing: 0.06em;
text-align: right;
}
/* Insights */
.insight {
display: flex;
flex-direction: column;
gap: 2px;
margin-bottom: 16px;
}
.insight:last-of-type { margin-bottom: 0; }
.insight-label {
font-size: var(--text-xs);
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--accent);
}
.insight-value {
font-size: var(--text-md);
font-weight: 400;
color: var(--text-h);
line-height: 1.2;
}
.insight-sub {
font-size: var(--text-sm);
font-weight: 300;
color: var(--text);
}
/* Trip style */
.style-section { display: flex; flex-direction: column; gap: 8px; }
.style-bar {
height: 6px;
border-radius: 99px;
background: var(--lavender-bg);
overflow: hidden;
}
.style-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent-dark), var(--lavender));
border-radius: 99px;
transition: width 0.4s ease;
}
.style-legend {
display: flex;
justify-content: space-between;
font-size: var(--text-xs);
font-weight: 300;
color: var(--text);
}
.dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 50%;
margin-right: 4px;
vertical-align: middle;
}
.solo-dot { background: var(--accent-dark); }
.friends-dot { background: var(--lavender); }
</style>

View File

@@ -0,0 +1,320 @@
<script>
/** @type {{ entry: import('../stores/journalStore.js').JournalEntry, onClick: () => void }} */
let { entry, onClick } = $props();
/** Convert country name to flag emoji via ISO 3166-1 alpha-2 */
const countryCodeMap = {
'Japan': 'JP', 'France': 'FR', 'Spain': 'ES', 'USA': 'US',
'Thailand': 'TH', 'Germany': 'DE', 'Italy': 'IT', 'UK': 'GB',
'Australia': 'AU', 'Canada': 'CA', 'China': 'CN', 'India': 'IN',
'Brazil': 'BR', 'Mexico': 'MX', 'Portugal': 'PT', 'Netherlands': 'NL',
'Greece': 'GR', 'Turkey': 'TR', 'Vietnam': 'VN', 'Indonesia': 'ID',
'Malaysia': 'MY', 'Singapore': 'SG', 'South Korea': 'KR', 'Taiwan': 'TW',
'New Zealand': 'NZ', 'Argentina': 'AR', 'Chile': 'CL', 'Peru': 'PE',
'Morocco': 'MA', 'Egypt': 'EG', 'Kenya': 'KE', 'South Africa': 'ZA',
'Sweden': 'SE', 'Norway': 'NO', 'Denmark': 'DK', 'Finland': 'FI',
'Switzerland': 'CH', 'Austria': 'AT', 'Belgium': 'BE', 'Poland': 'PL',
'Czech Republic': 'CZ', 'Hungary': 'HU', 'Croatia': 'HR',
};
function flagEmoji(country) {
const code = countryCodeMap[country];
if (!code) return '';
return [...code].map(c => String.fromCodePoint(0x1F1E6 - 65 + c.charCodeAt(0))).join('');
}
function formatDate(/** @type {string} */ iso) {
return new Date(iso).toLocaleDateString('en-US', {
month: 'short', day: 'numeric', year: 'numeric',
});
}
let mainPhoto = $derived(entry.photos[0] ?? null);
let thumbPhotos = $derived(entry.photos.slice(1, 4));
let extraCount = $derived(entry.photos.length > 4 ? entry.photos.length - 4 : 0);
</script>
<li class="v-item">
<div class="v-dot" aria-hidden="true"></div>
<div class="v-content">
<!-- Country above card -->
<div class="above-card">
<span class="flag">{flagEmoji(entry.location.country)}</span>
<span class="country-name">{entry.location.country}</span>
</div>
<!-- Card -->
<div class="entry-card" role="button" tabindex="0"
onclick={onClick}
onkeydown={(e) => e.key === 'Enter' && onClick()}>
<!-- Trip badge — top-right of card, outside photo -->
<span class="trip-badge trip-badge--{entry.tripType}">
{entry.tripType === 'solo' ? 'Solo' : 'Friends'}
</span>
<!-- Photos -->
<div class="photo-grid" class:has-thumbs={thumbPhotos.length > 0}>
<div class="photo-main">
{#if mainPhoto}
<img src={mainPhoto} alt="" loading="lazy"
onerror={(e) => {
e.currentTarget.style.display = 'none';
e.currentTarget.nextElementSibling.style.display = 'flex';
}} />
<div class="photo-fallback" style="display:none">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2">
<rect x="3" y="3" width="18" height="18" rx="3"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<path d="M21 15l-5-5L5 21"/>
</svg>
</div>
{:else}
<div class="photo-fallback">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2">
<rect x="3" y="3" width="18" height="18" rx="3"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<path d="M21 15l-5-5L5 21"/>
</svg>
</div>
{/if}
</div>
{#if thumbPhotos.length > 0}
<div class="photo-thumbs">
{#each thumbPhotos as photo, i}
<div class="photo-thumb">
<img src={photo} alt="" loading="lazy"
onerror={(e) => {
e.currentTarget.style.display = 'none';
e.currentTarget.nextElementSibling.style.display = 'flex';
}} />
<div class="thumb-fallback" style="display:none">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2">
<rect x="3" y="3" width="18" height="18" rx="3"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<path d="M21 15l-5-5L5 21"/>
</svg>
</div>
{#if i === 2 && extraCount > 0}
<div class="extra-overlay">+{extraCount}</div>
{/if}
</div>
{/each}
</div>
{/if}
</div>
<!-- Info bar -->
<div class="card-info">
<span class="city">{entry.location.city}</span>
<div class="meta">
<span>{formatDate(entry.date)}</span>
<span class="dot-sep">·</span>
<span>{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
</div>
</div>
</div>
</div>
</li>
<style>
/* ── Timeline row ── */
.v-item {
display: flex;
gap: 14px;
align-items: flex-start;
padding-bottom: 28px;
position: relative;
}
.v-item:last-child { padding-bottom: 0; }
.v-item:not(:last-child)::after {
content: '';
position: absolute;
left: 4px;
top: 34px;
bottom: 0;
width: 1px;
background: var(--border);
}
.v-dot {
flex-shrink: 0;
width: 9px;
height: 9px;
border-radius: 50%;
background: var(--bg);
border: 1.5px solid var(--accent);
margin-top: 6px;
z-index: 1;
}
/* ── Content column (above-card + card) ── */
.v-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6px;
}
/* ── Country above card ── */
.above-card {
display: flex;
align-items: center;
gap: 6px;
padding-left: 2px;
}
.flag { font-size: 16px; line-height: 1; }
.country-name {
font-size: 15px;
font-weight: 400;
color: var(--text-h);
letter-spacing: -0.2px;
}
/* ── Card ── */
.entry-card {
position: relative;
border-radius: 12px;
border: 1px solid var(--border);
background: var(--bg-raised);
box-shadow: 0 1px 4px rgba(0,0,0,0.05);
cursor: pointer;
overflow: hidden;
transition: box-shadow 0.2s, transform 0.15s;
container-type: inline-size;
container-name: card;
}
.entry-card:hover {
box-shadow: 0 6px 20px rgba(0,0,0,0.09);
transform: translateY(-2px);
}
/* ── Trip badge — absolute top-right of card ── */
.trip-badge {
position: absolute;
top: 10px;
right: 10px;
z-index: 2;
font-size: 11px;
font-weight: 300;
padding: 3px 10px;
border-radius: 20px;
letter-spacing: 0.04em;
backdrop-filter: blur(6px);
}
.trip-badge--solo { background: rgba(245,158,11,0.85); color: #fff; }
.trip-badge--friends { background: rgba(124,58,237,0.85); color: #fff; }
/* ── Photo grid — fixed height, always consistent ── */
.photo-grid {
display: grid;
grid-template-columns: 1fr;
height: 180px;
background: var(--bg-subtle);
}
.photo-grid.has-thumbs {
grid-template-columns: 2fr 1fr;
gap: 2px;
}
@container card (max-width: 300px) {
.photo-grid.has-thumbs { grid-template-columns: 1fr; }
.photo-thumbs { display: none; }
}
/* ── Main photo ── */
.photo-main {
overflow: hidden;
height: 100%;
background: var(--bg-subtle);
}
.photo-main img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.photo-fallback {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-sub);
}
/* ── Thumbs ── */
.photo-thumbs {
display: flex;
flex-direction: column;
gap: 2px;
}
.photo-thumb {
position: relative;
flex: 1;
overflow: hidden;
min-height: 0;
background: var(--bg-subtle);
}
.photo-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.thumb-fallback {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-sub);
background: var(--bg-subtle);
}
.extra-overlay {
position: absolute;
inset: 0;
background: rgba(0,0,0,0.4);
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 400;
color: #fff;
}
/* ── Info bar ── */
.card-info {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
background: var(--bg);
border-top: 1px solid var(--border);
gap: 8px;
min-height: 44px;
}
.city {
font-size: 13px;
font-weight: 300;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.meta {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
font-weight: 300;
color: var(--text-sub);
white-space: nowrap;
flex-shrink: 0;
}
.dot-sep { color: var(--border-bright); }
</style>

View File

@@ -0,0 +1,62 @@
<script>
const sortOptions = [
{ value: 'date-desc', label: 'Newest first' },
{ value: 'date-asc', label: 'Oldest first' },
{ value: 'country-asc', label: 'Country A → Z' },
{ value: 'country-desc', label: 'Country Z → A' },
];
let { sortKey, onSort } = $props();
</script>
<header class="toolbar">
<h1 class="page-title">My Journey</h1>
<div class="sort-control">
<select id="sort-select" onchange={(e) => onSort(e.currentTarget.value)}>
{#each sortOptions as opt}
<option value={opt.value} selected={opt.value === sortKey}>{opt.label}</option>
{/each}
</select>
</div>
</header>
<style>
.toolbar {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 16px;
margin-bottom: 32px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border);
}
.page-title {
font-size: var(--text-xl);
font-weight: 400;
color: var(--text-h);
letter-spacing: -0.5px;
margin: 0;
}
select {
font-family: var(--sans);
font-size: var(--text-xs);
font-weight: 300;
letter-spacing: 0.06em;
text-transform: uppercase;
padding: 6px 28px 6px 12px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--bg-subtle);
color: var(--text);
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2352525b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
transition: border-color 0.15s, color 0.15s;
}
select:hover { border-color: var(--border-bright); color: var(--text-h); }
select:focus { outline: 1px solid var(--accent-border); outline-offset: 2px; }
</style>

View File

@@ -0,0 +1,168 @@
<script>
import { get } from 'svelte/store';
import { journals } from '../stores/journalStore.js';
import TimelineToolbar from './TimelineToolbar.svelte';
import TimelineCard from './TimelineCard.svelte';
import JournalDetail from './JournalDetail.svelte';
import JournalSummary from './JournalSummary.svelte';
/** @type {import('../stores/journalStore.js').JournalEntry|null} */
let selected = $state(null);
let entries = $state(get(journals));
$effect(() => {
const unsub = journals.subscribe((v) => { entries = v; });
return unsub;
});
let sortKey = $state('date-desc');
let sortedEntries = $state(/** @type {typeof entries} */([]));
$effect(() => {
const key = sortKey;
sortedEntries = [...entries].sort((a, b) => {
if (key === 'date-asc') return a.date.localeCompare(b.date);
if (key === 'date-desc') return b.date.localeCompare(a.date);
if (key === 'country-asc') return a.location.country.localeCompare(b.location.country) || b.date.localeCompare(a.date);
if (key === 'country-desc') return b.location.country.localeCompare(a.location.country) || b.date.localeCompare(a.date);
return 0;
});
});
function getYear(iso) {
return new Date(iso).getFullYear();
}
</script>
<div class="journal-page">
{#if selected}
<div class="detail-scroll">
<JournalDetail entry={selected} onBack={() => (selected = null)} />
</div>
{:else}
<aside class="left-panel">
<JournalSummary entries={sortedEntries} />
</aside>
<div class="right-panel">
<div class="right-inner">
<TimelineToolbar {sortKey} onSort={(k) => (sortKey = k)} />
{#if sortedEntries.length === 0}
<p class="empty">No journal entries yet.</p>
{:else}
<ol class="v-list">
{#each sortedEntries as entry, i (entry.id)}
{#if i === 0 || getYear(entry.date) !== getYear(sortedEntries[i - 1].date)}
<li class="year-marker" aria-hidden="true">
<span class="year-label">{getYear(entry.date)}</span>
</li>
{/if}
<TimelineCard {entry} onClick={() => (selected = entry)} />
{/each}
</ol>
{/if}
<footer class="page-footer">
{sortedEntries.length} {sortedEntries.length === 1 ? 'entry' : 'entries'}
</footer>
</div>
</div>
{/if}
</div>
<style>
.journal-page {
flex: 1;
display: flex;
flex-direction: row;
min-width: 0;
height: 100%;
overflow: hidden;
}
/* ── Left panel ── */
.left-panel {
width: 260px;
flex-shrink: 0;
overflow-y: auto;
border-right: 1px solid var(--border);
background: var(--bg-raised);
padding: 40px 28px;
}
/* ── Right panel ── */
.right-panel {
flex: 1;
min-width: 0;
overflow-y: auto;
background: var(--bg);
}
/* Inner container with max-width + generous side padding */
.right-inner {
max-width: 640px;
margin: 0 auto;
padding: 40px 48px 80px;
}
/* ── Responsive: narrow viewport ── */
@media (max-width: 700px) {
.journal-page { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
.left-panel {
width: 100%;
border-right: none;
border-bottom: 1px solid var(--border);
padding: 24px 20px;
}
.right-panel { overflow-y: unset; }
.right-inner { padding: 24px 20px 60px; }
}
/* ── Detail view ── */
.detail-scroll {
flex: 1;
overflow-y: auto;
background: var(--bg);
}
/* ── Timeline list ── */
.v-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 0;
}
/* Year marker */
.year-marker {
padding: 32px 0 14px;
}
.year-label {
font-size: 13px;
font-weight: 400;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text);
border-left: 2px solid var(--accent);
padding-left: 10px;
}
.page-footer {
margin-top: 56px;
text-align: center;
font-size: 11px;
font-weight: 300;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-sub);
padding-top: 24px;
border-top: 1px solid var(--border);
}
.empty { text-align: center; color: var(--text-sub); padding: 80px 0; }
</style>

View File

@@ -137,12 +137,12 @@
<text x={seg.lx} y={seg.ly} text-anchor="middle" dominant-baseline="middle" class="donut-label" style="font-size: {seg.angle < 20 ? 12 : 15}px">{seg.cont}</text> <text x={seg.lx} y={seg.ly} text-anchor="middle" dominant-baseline="middle" class="donut-label" style="font-size: {seg.angle < 20 ? 12 : 15}px">{seg.cont}</text>
</g> </g>
{/each} {/each}
<circle cx="90" cy="90" r="30" fill="#f8fafc" /> <circle cx="90" cy="90" r="30" fill="var(--bg-raised)" />
</svg> </svg>
{:else} {:else}
<svg viewBox="0 0 180 180" class="donut-svg"> <svg viewBox="0 0 180 180" class="donut-svg">
<circle cx="90" cy="90" r="65" fill="#e2e8f0" /> <circle cx="90" cy="90" r="65" fill="var(--border)" />
<circle cx="90" cy="90" r="30" fill="#f8fafc" /> <circle cx="90" cy="90" r="30" fill="var(--bg-raised)" />
</svg> </svg>
{/if} {/if}
</div> </div>
@@ -157,11 +157,11 @@
<style> <style>
.panel { .panel {
flex: 0 0 min(360px, 25vw); flex: 0 0 min(360px, 25vw);
background: #f8fafc; background: var(--bg-raised);
border-left: 1px solid #dce8f0; border-left: 1px solid var(--border);
display: flex; display: flex;
flex-direction: row; flex-direction: row;
font-family: sans-serif; font-family: var(--sans);
transition: flex-basis 0.25s ease; transition: flex-basis 0.25s ease;
} }
@@ -180,21 +180,21 @@
.collapse-btn { .collapse-btn {
flex: 0 0 auto; flex: 0 0 auto;
align-self: flex-start; align-self: flex-start;
background: #e2e8f0; background: var(--accent-bg);
border: none; border: none;
border-radius: 0 8px 8px 0; border-radius: 0 8px 8px 0;
padding: 14px 5px; padding: 14px 5px;
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
line-height: 1; line-height: 1;
color: #1e293b; color: var(--accent);
transition: background 0.15s ease, padding 0.15s ease; transition: background 0.15s ease, padding 0.15s ease;
margin-top: 24px; margin-top: 24px;
position: relative; position: relative;
} }
.collapse-btn:hover { .collapse-btn:hover {
background: #94a3b8; background: var(--lavender-bg);
padding-right: 8px; padding-right: 8px;
} }
@@ -204,10 +204,11 @@
right: calc(100% + 8px); right: calc(100% + 8px);
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
background: #1e293b; background: var(--text-h);
color: #fff; color: var(--bg-raised);
font-size: 14px; font-family: var(--sans);
font-weight: 600; font-size: 12px;
font-weight: 300;
padding: 6px 12px; padding: 6px 12px;
border-radius: 6px; border-radius: 6px;
white-space: nowrap; white-space: nowrap;
@@ -221,20 +222,22 @@
} }
.headline { .headline {
font-size: 16px; font-family: var(--heading);
font-weight: 700; font-size: var(--text-sm);
font-weight: 400;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 0.1em;
color: #1f2937; color: var(--accent);
margin: 0 0 20px 0; margin: 0 0 20px 0;
} }
.bar-label { .bar-label {
font-size: 13px; font-family: var(--sans);
font-weight: 600; font-size: var(--text-xs);
font-weight: 400;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.08em;
color: #64748b; color: var(--text-sub);
display: block; display: block;
margin-bottom: 8px; margin-bottom: 8px;
} }
@@ -248,30 +251,30 @@
.total-bar-bg { .total-bar-bg {
flex: 1; flex: 1;
height: 20px; height: 18px;
background: #e2e8f0; background: var(--accent-bg);
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
} }
.total-bar-fill { .total-bar-fill {
height: 100%; height: 100%;
background: #3b82f6; background: linear-gradient(90deg, var(--accent-dark), var(--lavender));
border-radius: 10px; border-radius: 10px;
transition: width 0.3s ease; transition: width 0.3s ease;
min-width: 0; min-width: 0;
} }
.total-bar-text { .total-bar-text {
font-size: 15px; font-size: var(--text-sm);
font-weight: 700; font-weight: 400;
color: #1f2937; color: var(--text-h);
white-space: nowrap; white-space: nowrap;
} }
.divider { .divider {
height: 1px; height: 1px;
background: #e2e8f0; background: var(--border);
margin: 16px 0; margin: 16px 0;
} }
@@ -279,51 +282,51 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
padding: 7px 0; padding: 6px 0;
} }
.dot { .dot {
width: 14px; width: 12px;
height: 14px; height: 12px;
border-radius: 50%; border-radius: 50%;
flex-shrink: 0; flex-shrink: 0;
} }
.label { .label {
flex: 1; flex: 1;
font-size: 14px; font-size: var(--text-sm);
color: #334155; font-weight: 300;
color: var(--text);
} }
.value { .value {
font-size: 14px; font-size: var(--text-sm);
font-weight: 600; font-weight: 400;
color: #1f2937; color: var(--text-h);
} }
.total { .total {
font-weight: 350; font-weight: 400;
color: #94a3b8; color: var(--text-sub);
font-size: 13px; font-size: var(--text-xs);
} }
.donut-wrap { .donut-wrap {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 24px 0; margin: 20px 0;
padding: 0 10px;
} }
.donut-svg { .donut-svg {
width: 160px; width: 160px;
height: 160px; height: 160px;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); filter: drop-shadow(0 2px 8px rgba(99,102,241,0.15));
overflow: visible;
} }
.donut-label { .donut-label {
fill: #1f2937; fill: var(--text-h);
font-weight: 600; font-family: var(--sans);
font-weight: 300;
pointer-events: none; pointer-events: none;
opacity: 0; opacity: 0;
transition: opacity 0.15s ease; transition: opacity 0.15s ease;
@@ -342,13 +345,14 @@
position: absolute; position: absolute;
top: calc(100% + 6px); top: calc(100% + 6px);
left: 0; left: 0;
background: #1e293b; background: var(--text-h);
color: #f1f5f9; color: var(--bg-raised);
font-family: var(--sans);
font-size: 12px; font-size: 12px;
line-height: 1.5; line-height: 1.5;
padding: 8px 12px; padding: 8px 12px;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); box-shadow: var(--shadow);
z-index: 20; z-index: 20;
white-space: nowrap; white-space: nowrap;
min-width: 120px; min-width: 120px;
@@ -368,9 +372,9 @@
} }
.disclaimer { .disclaimer {
font-size: 11px; font-size: var(--text-xs);
color: #94a3b8; color: var(--text-sub);
line-height: 1.4; line-height: 1.5;
text-align: center; text-align: center;
} }
</style> </style>

View File

@@ -210,4 +210,3 @@ for (const id of Object.keys(map)) {
export function getContinent(id) { export function getContinent(id) {
return map[id] ?? null; return map[id] ?? null;
} }