Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regions map #1395

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f027de5
first pass
thejessewinton Sep 24, 2024
7174e46
basic map layout and points
thejessewinton Sep 24, 2024
78f31d5
Update Map.svelte
thejessewinton Sep 25, 2024
a636557
Merge branch 'main' into regions-map
thejessewinton Sep 25, 2024
30482ea
Merge branch 'main' into regions-map
thejessewinton Sep 26, 2024
79c93f0
Merge branch 'main' into regions-map
thejessewinton Sep 27, 2024
be71b3c
tweak the map
thejessewinton Sep 27, 2024
ab4f84f
some updates
thejessewinton Sep 27, 2024
af236d8
update
thejessewinton Sep 27, 2024
bd70211
Merge branch 'main' into regions-map
thejessewinton Sep 30, 2024
992d5a4
correct positioning and types
thejessewinton Sep 30, 2024
53c4db1
Merge branch 'main' into regions-map
thejessewinton Sep 30, 2024
a2e78aa
update the map
thejessewinton Sep 30, 2024
42f69b4
Merge branch 'main' into regions-map
thejessewinton Oct 1, 2024
2be319f
update
thejessewinton Oct 1, 2024
1186c81
update
thejessewinton Oct 1, 2024
349bb8d
Update Map.svelte
thejessewinton Oct 1, 2024
6808226
update
thejessewinton Oct 1, 2024
c222243
Update Map.svelte
thejessewinton Oct 2, 2024
45d6a18
fix tooltip positioning
thejessewinton Oct 2, 2024
84e73b0
Merge branch 'main' into regions-map
thejessewinton Oct 2, 2024
57d9126
different map
thejessewinton Oct 2, 2024
b6d6157
Merge branch 'main' into regions-map
thejessewinton Oct 3, 2024
f459333
move to component folder
thejessewinton Oct 3, 2024
a69560a
update
thejessewinton Oct 3, 2024
5b2b694
use svelte action
thejessewinton Oct 3, 2024
6cef4e2
rm page
thejessewinton Oct 3, 2024
28b008a
Merge branch 'main' into regions-map
thejessewinton Oct 7, 2024
75eacd6
update
thejessewinton Oct 7, 2024
062f390
updates to map
thejessewinton Oct 7, 2024
ee32ae2
Merge branch 'main' into regions-map
thejessewinton Oct 8, 2024
073ca0a
update marker animations
thejessewinton Oct 8, 2024
501d7dd
Update Map.svelte
thejessewinton Oct 8, 2024
d473b1c
Update Map.svelte
thejessewinton Oct 8, 2024
8e70855
update map
thejessewinton Oct 8, 2024
d4b799c
Merge branch 'main' into regions-map
thejessewinton Oct 9, 2024
94ac9d0
add markdoc tag
thejessewinton Oct 9, 2024
e1366e7
Update Map.svelte
thejessewinton Oct 9, 2024
ca2f29d
Merge branch 'main' into regions-map
thejessewinton Oct 16, 2024
c93b4c8
Merge branch 'main' into regions-map
thejessewinton Nov 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"clsx": "^2.1.1",
"cobe": "^0.6.3",
"cva": "npm:class-variance-authority@^0.7.0",
"date-fns": "^3.6.0",
"dequal": "^2.0.3",
"dotted-map": "^2.2.3",
"embla-carousel": "^8.1.5",
"embla-carousel-svelte": "^8.1.5",
"embla-carousel-wheel-gestures": "^8.0.1",
Expand Down
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

/* Animations */
--animate-scale-in: scale-in 200ms ease-out forwards;
--animate-fade-in: fade-in 500ms ease-out forwards;

/* Pink polyfills */
--transition: 0.2s;
Expand All @@ -84,6 +85,15 @@
}
}

@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

/* Fonts */
--font-family-sans: 'Inter', arial, sans-serif;
--font-family-mono: 'Fira Code', monospace;
Expand Down
Binary file added src/routes/globe/(assets)/australia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/routes/globe/(assets)/france.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/routes/globe/(assets)/germany.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/routes/globe/(assets)/india.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/routes/globe/(assets)/singapore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/routes/globe/(assets)/usa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions src/routes/globe/(components)/Globe.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<script lang="ts">
import { onMount } from 'svelte';
import createGlobe from 'cobe';

let canvas: HTMLCanvasElement;
let phi = 0;

onMount(() => {
let width = 0;
const onResize = () => canvas && (width = canvas.offsetWidth);
window.addEventListener('resize', onResize);
onResize();
thejessewinton marked this conversation as resolved.
Show resolved Hide resolved
const globe = createGlobe(canvas, {
thejessewinton marked this conversation as resolved.
Show resolved Hide resolved
devicePixelRatio: 2,
width: width * 2,
height: width * 2 * 0.4,
phi: 0,
theta: 0.3,
dark: 1,
diffuse: 3,
mapSamples: 16000,
mapBrightness: 6,
baseColor: [255 / 30, 255 / 30, 255 / 30],
markerColor: [1, 1, 1],
glowColor: [1.2, 1.2, 1.2],
markers: [
{ location: [50.1109, 8.6821], size: 0.03 },
{ location: [48.8575, 2.3514], size: 0.03 },
{ location: [12.971599, 77.5946], size: 0.03 },
{ location: [1.3521, 103.8198], size: 0.03 },
{ location: [33.8688, 151.2093], size: 0.03 },
{ location: [40.7128, -73.935242], size: 0.03 },
{ location: [37.7749, -122.4194], size: 0.03 }
],
scale: 2.5,
offset: [0, width * 2 * 0.4 * 0.6],
onRender: (state) => {
state.width = width * 2;
state.height = width * 2 * 0.5;
state.phi = phi;
phi += 0.004;
}
});
setTimeout(() => (canvas.style.opacity = '1'));
return () => {
globe.destroy();
window.removeEventListener('resize', onResize);
};
});
</script>

<div class="bg-white">
<div
class="container relative mx-auto flex items-center justify-center perspective-distant transform-3d"
>
<canvas bind:this={canvas} class="h-[650px] w-screen" />
</div>
</div>
Loading
Loading