diff --git a/public/plane.webp b/public/plane.webp new file mode 100644 index 0000000..6003f20 Binary files /dev/null and b/public/plane.webp differ diff --git a/src/App.svelte b/src/App.svelte index b59be82..3a4665a 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,15 +4,32 @@ import CountryPicker from './lib/auth/CountryPicker.svelte'; import Layout from './lib/layout/Layout.svelte'; import WorldMap from './lib/world-map/WorldMap.svelte'; + import JourneyView from './lib/world-map/JourneyView.svelte'; import StatsPanel from './lib/world-map/StatsPanel.svelte'; import TimelineView from './lib/timeline/TimelineView.svelte'; let screen = $state('worldmap'); + let journeyActive = $state(false); + let journeyProgress = $state(null); function onNavigate(s) { screen = s; } + function startJourney() { + journeyActive = true; + journeyProgress = null; + } + + function endJourney() { + journeyActive = false; + journeyProgress = null; + } + + function onJourneyProgress(p) { + journeyProgress = p; + } + $effect(() => { initAuth(); }); @@ -30,7 +47,14 @@ {#if screen === 'worldmap'}
-
+
+ {#if journeyActive} + + {:else} + + + {/if} +
{:else} @@ -71,5 +95,36 @@ .map-area { flex: 1; overflow: hidden; + position: relative; + } + + .journey-play-btn { + position: absolute; + bottom: 24px; + right: 24px; + z-index: 10; + width: 44px; + height: 44px; + border-radius: 50%; + border: none; + background: #8b5cf6; + color: #fff; + font-size: 20px; + line-height: 1; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4); + transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease; + } + + .journey-play-btn:hover { + background: #7c3aed; + box-shadow: 0 4px 18px rgba(139, 92, 246, 0.55); + } + + .journey-play-btn:active { + transform: scale(0.92); } diff --git a/src/lib/world-map/JourneyView.svelte b/src/lib/world-map/JourneyView.svelte new file mode 100644 index 0000000..aa6fccd --- /dev/null +++ b/src/lib/world-map/JourneyView.svelte @@ -0,0 +1,391 @@ + + +
+ + {#if isFinished} +
Journey complete!
+ {/if} +
+ + diff --git a/src/lib/world-map/WorldMap.svelte b/src/lib/world-map/WorldMap.svelte index 81b1a2f..4257d89 100644 --- a/src/lib/world-map/WorldMap.svelte +++ b/src/lib/world-map/WorldMap.svelte @@ -81,9 +81,9 @@ } function updateAllFills() { - if (!_paths || !_g) return; const sel = getSelected(); const hc = getHomeCountryCode(); + if (!_paths || !_g) return; _paths.attr('fill', d => countryColor(d, sel, hc)); _g.selectAll('.micro-state').attr('fill', d => countryColor(d, sel, hc)); }