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 all 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@typescript-eslint/parser": "^7.13.1",
"analytics": "^0.8.14",
"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",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

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

25 changes: 25 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@

/* Animations */
--animate-scale-in: scale-in 200ms ease-out forwards;
--animate-fade-in: fade-in 500ms ease-out forwards;
--animate-text: fade-in 0.75s ease-in-out both, blur 0.75s ease-in-out both,
up 0.75s ease-in-out both;
--animate-map: map 0.75s ease-in-out both;
--animate-marker: marker 1.5s ease-in-out both infinite;

/* Pink polyfills */
--transition: 0.2s;
Expand Down Expand Up @@ -120,6 +123,28 @@
}
}

@keyframes map {
0% {
opacity: 0;
transform: scale(0.98);
}
100% {
opacity: 1;
transform: scale(1);
}
}

@keyframes marker {
0% {
opacity: 0.75;
r: var(--radius);
}
100% {
opacity: 0;
r: calc(var(--radius) * 2);
}
}

/* Fonts */
--font-family-sans: 'Inter', arial, sans-serif;
--font-family-mono: 'Fira Code', monospace;
Expand Down
Binary file added src/lib/components/regions/(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/lib/components/regions/(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/lib/components/regions/(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/lib/components/regions/(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/lib/components/regions/(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/lib/components/regions/(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.
61 changes: 61 additions & 0 deletions src/lib/components/regions/Globe.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<script lang="ts">
import createGlobe from 'cobe';

let phi = 0;
let width = 0;

const globe = (canvas: HTMLCanvasElement) => {
const onResize = () => (width = canvas.offsetWidth);
window.addEventListener('resize', onResize);
onResize();

const globe = createGlobe(canvas, {
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, 0.5, 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 {
destroy() {
window.removeEventListener('resize', onResize);
globe.destroy();
}
};
};
</script>

<div class="bg-white">
<div
class="container relative mx-auto flex items-center justify-center perspective-distant transform-3d"
>
<canvas use:globe class="h-[650px] w-screen" />
</div>
</div>
279 changes: 279 additions & 0 deletions src/lib/components/regions/Map.svelte

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/markdoc/tags/Regions_Map.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script lang="ts">
import Map from '$lib/components/regions/Map.svelte';
</script>

<Map />
1 change: 1 addition & 0 deletions src/markdoc/tags/_Module.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
export { default as Accordion_Item } from './Accordion_Item.svelte';
export { default as Youtube } from './Youtube.svelte';
export { default as Call_To_Action } from './Call_To_Action.svelte';
export { default as Regions_Map } from './Regions_Map.svelte';
</script>
8 changes: 8 additions & 0 deletions src/routes/maps/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script lang="ts">
import Map from '$lib/components/regions/Map.svelte';
import Main from '$lib/layouts/Main.svelte';
</script>

<Main>
<Map />
</Main>
1 change: 1 addition & 0 deletions src/routes/maps/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ssr = false;
Loading