diff --git a/website/src/Home.svelte b/website/src/Home.svelte index 3ff7be1..0e311e8 100644 --- a/website/src/Home.svelte +++ b/website/src/Home.svelte @@ -170,7 +170,16 @@
- + { + state.isSearchOpen = false; + state.isInfoOpen = true; + }} + onClose={() => { + state.isInfoOpen = false; + }} + >

All The Views In The World

We've calculated all the views on the planet.

@@ -321,7 +330,8 @@

- diff --git a/website/src/components/CollapsableModal.svelte b/website/src/components/CollapsableModal.svelte index 43af096..5b9b536 100644 --- a/website/src/components/CollapsableModal.svelte +++ b/website/src/components/CollapsableModal.svelte @@ -4,18 +4,32 @@ export let collapsedIcon: Component; export let isOpen = true; + export let onOpen: (() => void) | undefined = undefined; + export let onClose: (() => void) | undefined = undefined; const __buttonSize = 18;
{#if isOpen} - {:else} - {/if} diff --git a/website/src/components/LayerToggle.svelte b/website/src/components/LayerToggle.svelte index ee7fdf8..dffa677 100644 --- a/website/src/components/LayerToggle.svelte +++ b/website/src/components/LayerToggle.svelte @@ -16,7 +16,8 @@ Layer toggle - diff --git a/website/src/components/SearchBox.svelte b/website/src/components/SearchBox.svelte new file mode 100644 index 0000000..cc82cd8 --- /dev/null +++ b/website/src/components/SearchBox.svelte @@ -0,0 +1,117 @@ + + + + + + diff --git a/website/src/state.svelte.ts b/website/src/state.svelte.ts index 497ed39..693b017 100644 --- a/website/src/state.svelte.ts +++ b/website/src/state.svelte.ts @@ -18,6 +18,9 @@ const heatmapConfig: HeatmapConfig = { intensity: 1 - 0.5, }; const isFlying = false; +// Mobile-only events +const isSearchOpen = false; +const isInfoOpen = true; export const state = $state({ map, @@ -28,4 +31,6 @@ export const state = $state({ bruteForceLoadingLine, heatmapConfig, isFlying, + isSearchOpen, + isInfoOpen, }); diff --git a/website/src/styles/index.scss b/website/src/styles/index.scss index b5c205a..4c03016 100644 --- a/website/src/styles/index.scss +++ b/website/src/styles/index.scss @@ -1,5 +1,4 @@ @use "sass:color"; - @use "./variables.scss" as *; body { @@ -49,3 +48,17 @@ a { .maplibregl-canvas { background-color: #131e40; } + +/* Mobile-only tweaks */ +@media (max-width: $mobile-break) { + /* Map attribution: make box narrower and text more compact */ + .maplibregl-ctrl-attrib { + max-width: 200px; + } + .maplibregl-ctrl-attrib-inner { + white-space: normal; /* allow wrapping */ + font-size: 10px; + line-height: 1.2; + padding: 2px 4px; + } +} \ No newline at end of file diff --git a/website/src/styles/variables.scss b/website/src/styles/variables.scss index 7c720c4..e657777 100644 --- a/website/src/styles/variables.scss +++ b/website/src/styles/variables.scss @@ -2,6 +2,7 @@ $primary-colour: #fd6612; $secondary-colour: #141f41; $secondary-light: #b8bdd6; $longest-line: #5bc0eb; +$mobile-break: 730px; :root { --primary-colour: #{$primary-colour};