Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
95c892b
create page route
Nov 25, 2024
19487ba
Merge branch 'main' into cloud-ga-page
Nov 26, 2024
9353969
update
Nov 26, 2024
e6d122d
Update app.css
Nov 26, 2024
f22ff0c
tweaks
Nov 26, 2024
3547332
tweaks
Nov 26, 2024
790ce1c
Merge branch 'main' into cloud-ga-page
Nov 27, 2024
43f6add
Merge branch 'main' into cloud-ga-page
Nov 27, 2024
2f86ea1
fixes
Nov 27, 2024
f6a7c18
Merge branch 'main' into cloud-ga-page
Nov 27, 2024
ee86f88
start scramblin
Nov 27, 2024
1088e99
Merge branch 'main' into cloud-ga-page
Nov 27, 2024
f8ebeda
update
Nov 27, 2024
9dbf3fc
Merge branch 'main' into cloud-ga-page
Nov 27, 2024
d0c3307
update
Nov 27, 2024
cf04fc3
update
Nov 27, 2024
df4a5ea
Merge branch 'main' into cloud-ga-page
Nov 29, 2024
598e406
update
Nov 29, 2024
4f55e31
update
Nov 29, 2024
b99e2bc
update cloud ga
Nov 30, 2024
67167a9
basic content
Nov 30, 2024
cbfb9bf
update
Nov 30, 2024
c912d4d
update
Nov 30, 2024
9277395
updates
Nov 30, 2024
38930b6
some tweaks
Nov 30, 2024
2cd044d
Update hero.svelte
Nov 30, 2024
7600692
Merge branch 'main' into cloud-ga-page
Dec 1, 2024
d16707b
big updates
Dec 1, 2024
a9ef6d7
map tweaks
Dec 2, 2024
8198be7
update
Dec 2, 2024
a4a6c61
tweaks
Dec 2, 2024
1669239
updates
Dec 2, 2024
97a4e46
Merge branch 'main' into cloud-ga-page
Dec 9, 2024
0cc4d50
update region positions
Dec 9, 2024
e238246
Merge branch 'main' into cloud-ga-page
Dec 10, 2024
faf1f42
Merge branch 'main' into cloud-ga-page
Dec 13, 2024
ae3865f
working version
Dec 13, 2024
71deb06
working mobile implementation
Dec 13, 2024
c44a836
update implementation
Dec 13, 2024
1449d54
updates
Dec 13, 2024
4ac4a26
functioning version
Dec 13, 2024
d49b469
Merge branch 'main' into cloud-ga-page
Jan 8, 2025
e666d70
Merge branch 'main' into cloud-ga-page
Jan 13, 2025
b86746f
Merge branch 'main' into cloud-ga-page
Jan 14, 2025
7798745
Merge branch 'main' into cloud-ga-page
Jan 15, 2025
607c5a3
Merge branch 'main' into cloud-ga-page
Jan 17, 2025
02777fb
Merge branch 'main' into cloud-ga-page
Jan 20, 2025
437bf74
Merge branch 'main' into cloud-ga-page
Jan 21, 2025
42afc1e
Merge branch 'main' into cloud-ga-page
Jan 22, 2025
8c74afe
Merge branch 'main' into cloud-ga-page
Jan 23, 2025
88ca626
Merge branch 'main' into cloud-ga-page
Feb 13, 2025
e9ffdfe
Merge branch 'main' into cloud-ga-page
Feb 18, 2025
d5c8629
Merge branch 'main' into cloud-ga-page
Feb 21, 2025
d023102
Merge branch 'main' into cloud-ga-page
Feb 21, 2025
e6bf7ef
Merge branch 'main' into cloud-ga-page
Feb 24, 2025
5077c4c
update
Feb 24, 2025
e4112e5
Merge branch 'main' into cloud-ga-page
Feb 25, 2025
2ef6c30
Merge branch 'main' into cloud-ga-page
Feb 26, 2025
bdb9358
Merge branch 'main' into cloud-ga-page
Feb 27, 2025
d3094d4
Merge branch 'main' into cloud-ga-page
Feb 28, 2025
042413e
Merge branch 'main' into cloud-ga-page
Mar 3, 2025
0b530bf
Merge branch 'main' into cloud-ga-page
Mar 4, 2025
b1c3194
Merge branch 'main' into cloud-ga-page
Mar 4, 2025
4393a1b
Merge branch 'main' into cloud-ga-page
Mar 5, 2025
eb3ea7b
Merge branch 'main' into cloud-ga-page
Mar 5, 2025
a4bf4f9
Merge branch 'main' into cloud-ga-page
Mar 7, 2025
5a1a5d4
Merge branch 'main' into cloud-ga-page
Mar 10, 2025
aa9ec4e
Merge branch 'main' into cloud-ga-page
Mar 10, 2025
b1b07e4
Merge branch 'main' into cloud-ga-page
Mar 13, 2025
8cb4d52
Merge branch 'main' into cloud-ga-page
Mar 14, 2025
dc61011
Merge branch 'main' into cloud-ga-page
Mar 17, 2025
e1f1004
Merge branch 'main' into cloud-ga-page
Mar 27, 2025
94fdec9
Merge branch 'main' into cloud-ga-page
Apr 1, 2025
ab8e14c
Merge branch 'main' into cloud-ga-page
Apr 2, 2025
8b56478
Merge branch 'main' into cloud-ga-page
Apr 2, 2025
a28bb6c
Merge branch 'main' into cloud-ga-page
Apr 7, 2025
c72ab1d
Merge branch 'main' into cloud-ga-page
Apr 7, 2025
208fdf4
Merge branch 'main' into cloud-ga-page
Apr 9, 2025
f4b0fc9
update props
Apr 9, 2025
26d9f4d
updates
Apr 9, 2025
1d37b4c
bring missing components
Apr 9, 2025
cd71dfc
to svelte 5
Apr 9, 2025
c3fe84d
Merge branch 'main' into cloud-ga-page
Apr 9, 2025
bf25e2a
rename
Apr 9, 2025
87a208d
update animated text component
Apr 9, 2025
5df1191
tailwind-ify
Apr 9, 2025
a5aaa65
rm
Apr 9, 2025
1909a8c
tweaks
Apr 9, 2025
609b056
map markers
Apr 9, 2025
e0eee4a
working map
Apr 10, 2025
a74039b
update
Apr 10, 2025
c139cab
add icons
Apr 10, 2025
480c46b
add sprite and barrel
Apr 10, 2025
6758043
Update icon.svelte
Apr 10, 2025
58cf8e6
include sprite on layout
Apr 10, 2025
2c3a9f8
Update package.json
Apr 10, 2025
658fdf4
update
Apr 10, 2025
d8c6a5c
Update scripts.js
Apr 10, 2025
8e3ddf5
update
Apr 10, 2025
30daf50
working navigation
Apr 10, 2025
5f5cf34
Merge branch 'main' into cloud-ga-page
Apr 10, 2025
c7a6166
Merge branch 'main' into cloud-ga-page
Apr 11, 2025
ef66b3c
update maps
Apr 11, 2025
93f5449
Update map.svelte
Apr 11, 2025
9307731
updates
Apr 14, 2025
f478cd5
Merge branch 'main' into cloud-ga-page
Jun 13, 2025
c96f6bd
Merge branch 'main' into cloud-ga-page
Jul 14, 2025
1ce7a9f
Merge branch 'main' into cloud-ga-page
Jul 15, 2025
9d15a66
format
Jul 15, 2025
28b18cf
Merge branch 'main' into cloud-ga-page
Jul 15, 2025
5376468
Merge branch 'main' into cloud-ga-page
Aug 1, 2025
88cdbcb
changes to cloud ga
Aug 1, 2025
a21b50a
a couple finished sections
Aug 1, 2025
4d90464
Merge branch 'main' into cloud-ga-page
Aug 1, 2025
ee7b1e5
more good work here
Aug 1, 2025
e7ad82c
Merge branch 'cloud-ga-page' of https://github.com/appwrite/website i…
Aug 1, 2025
b0590f6
add map
Aug 1, 2025
77ce626
updates
Aug 1, 2025
cf90ec4
add sites slide and fix all in one
Aug 1, 2025
6b154df
Update all-in-one.svelte
Aug 1, 2025
43c1f14
the map
Aug 1, 2025
bcc2d38
update
Aug 1, 2025
1b06920
updates
Aug 1, 2025
92880c1
fixes
Aug 1, 2025
15d2015
Delete map-marker.svelte
Aug 3, 2025
364560e
Update building-cloud.svelte
LauraDuRy Aug 4, 2025
eec5232
Update building-cloud.svelte
LauraDuRy Aug 4, 2025
475773b
Update team-of-experts.svelte
LauraDuRy Aug 4, 2025
76302bf
Update hero.svelte
LauraDuRy Aug 4, 2025
f5cd870
Update networking-latency.svelte
LauraDuRy Aug 4, 2025
75b57a9
Update whats-next.svelte
LauraDuRy Aug 4, 2025
63eae08
Update app.css
Aug 4, 2025
6c02729
start on bg lines
Aug 4, 2025
74e96de
remove lines from text parts
Aug 4, 2025
df6519b
Update building-cloud.svelte
LauraDuRy Aug 4, 2025
22739ca
Update the-journey-so-far.svelte
LauraDuRy Aug 4, 2025
cd7552d
Merge branch 'main' into cloud-ga-page
Aug 4, 2025
bc22c77
tweak
Aug 4, 2025
39f789a
Update the-journey-so-far.svelte
Aug 4, 2025
70dc418
Update scale-without-worries.svelte
LauraDuRy Aug 4, 2025
18cc560
Update scale-without-worries.svelte
LauraDuRy Aug 4, 2025
78a0058
tweaks
Aug 4, 2025
4a215b9
border grads
Aug 4, 2025
4331972
Update hero.svelte
Aug 4, 2025
9c08137
Update open-source-community.svelte
LauraDuRy Aug 4, 2025
9b7dd1e
Update whats-next.svelte
LauraDuRy Aug 4, 2025
4db95a9
Update secure-by-default.svelte
LauraDuRy Aug 4, 2025
d95802f
fix spacing issues
Aug 4, 2025
bb04ba1
links hover states
Aug 4, 2025
232c923
update
Aug 4, 2025
1bd46ae
fix positioning
Aug 4, 2025
bb98a78
update sections
Aug 4, 2025
25bf2a2
Update numbers.svelte
Aug 4, 2025
c990a0e
Update building-cloud.svelte
Aug 4, 2025
532e975
update numbers
Aug 4, 2025
a456dbf
update hero
Aug 4, 2025
449cbb7
tweaks
Aug 4, 2025
e0515b9
update
Aug 4, 2025
d13eace
spacing issues
Aug 4, 2025
20ada80
add mobile
Aug 4, 2025
5ba88e1
done
Aug 4, 2025
f691ebb
fix borders
Aug 4, 2025
8a62c3d
Update all-in-one.svelte
Aug 4, 2025
1ab4b68
Update all-in-one.svelte
Aug 4, 2025
635baed
Update all-in-one.svelte
Aug 4, 2025
380fe0c
Update all-in-one.svelte
Aug 4, 2025
ed8773a
update
Aug 4, 2025
f45a7c4
tweak spacing
Aug 4, 2025
2cfb0e2
add animation
Aug 4, 2025
d5a37bd
Update hero.svelte
Aug 4, 2025
feefcf2
Update app.css
Aug 4, 2025
f08c1d5
Update hero.svelte
Aug 4, 2025
9c9c7bd
fix graph
Aug 4, 2025
3dc92d2
updates
Aug 4, 2025
a9b3691
fixes
Aug 4, 2025
64c56f1
update numbers
Aug 4, 2025
77e79f4
Update secure-by-default.svelte
LauraDuRy Aug 5, 2025
1972b1e
Update open-source-community.svelte
LauraDuRy Aug 5, 2025
bd075d0
Merge branch 'main' into cloud-ga-page
Aug 5, 2025
37d0806
update padding
Aug 5, 2025
c4b8d13
Update scale-without-worries.svelte
Aug 5, 2025
d4edd96
fixes
Aug 5, 2025
8c85647
spacing
Aug 5, 2025
8461558
update
Aug 5, 2025
ac52801
Update mouse-position.svelte.ts
Aug 5, 2025
57477b8
Update scale-without-worries.svelte
LauraDuRy Aug 5, 2025
6581322
Update mouse-position.svelte.ts
Aug 5, 2025
a5f1b81
fix the tooltip
Aug 5, 2025
e6b42ad
add sites icon
Aug 5, 2025
fdcc1e7
update hover states
Aug 5, 2025
bee225f
Update building-cloud.svelte
Aug 5, 2025
a79f9d7
updates
Aug 5, 2025
f1a01a5
updates
Aug 5, 2025
94c2ce8
Update building-cloud.svelte
LauraDuRy Aug 6, 2025
c1809ed
Update the-journey-so-far.svelte
LauraDuRy Aug 6, 2025
1e0a1fd
Update scale-without-worries.svelte
LauraDuRy Aug 6, 2025
8ee4fe1
Update networking-latency.svelte
LauraDuRy Aug 6, 2025
60885b3
Update team-of-experts.svelte
LauraDuRy Aug 6, 2025
1733af9
Update networking-latency.svelte
LauraDuRy Aug 6, 2025
f0e7812
Update hero.svelte
LauraDuRy Aug 6, 2025
6eb6d68
Merge branch 'main' into cloud-ga-page
ItzNotABug Aug 6, 2025
d245a39
fix: lint.
ItzNotABug Aug 6, 2025
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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"optimize": "node ./scripts/optimize-assets.js",
"optimize:all": "node ./scripts/optimize-all.js"
},
"packageManager": "pnpm@10.12.1",
"packageManager": "pnpm@10.14.0",
"dependencies": {
"h3": "^1.14.0",
"posthog-js": "^1.210.2",
Expand Down
24 changes: 18 additions & 6 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
--animate-scroll: scroll 60s linear infinite;
--animate-scroll-x: scroll-x var(--speed, 30s) linear infinite var(--direction, forwards);
--animate-scroll-y: scroll-y 30s linear infinite forwards;

--animate-drop: drop 18s linear infinite forwards;
--animate-fade-in: fade-in 0.5s ease-in-out both;
--animate-fade-out: fade-out 0.5s ease-in-out both;
--animate-lighting: lighting 1.25s ease-out forwards;
Expand Down Expand Up @@ -285,6 +285,15 @@
}
}

@keyframes drop {
from {
top: calc(100vh * -1);
}
to {
top: 100vh;
}
}

/* Fonts */
--font-sans: 'Inter', arial, sans-serif;
--font-mono: 'Fira Code', monospace;
Expand Down Expand Up @@ -319,8 +328,11 @@
--text-description--letter-spacing: var(--tracking-tighter);
--text-label: 1.5rem;
--text-label--line-height: 1.75rem;
--text-title: clamp(2rem, 5vw, 2.5rem);
--text-title--line-height: clamp(2.125rem, 5.5vw, 2.75rem);
--text-subtitle: clamp(1.5rem, 3vw, 2rem);
--text-subtitle--line-height: clamp(1.75rem, 3.5vw, 2.25rem);
--text-subtitle--letter-spacing: var(--tracking-squeezed);
--text-title: clamp(2rem, 5vw, 3rem);
--text-title--line-height: clamp(2.125rem, 5.5vw, 3.25rem);
--text-title--letter-spacing: var(--tracking-squeezed);
--text-title-lg: clamp(2.85rem, 5vw, 3rem);
--text-title-lg--line-height: clamp(2.75rem, 5.5vw, 3.5rem);
Expand All @@ -331,9 +343,9 @@
--text-hero: clamp(3.2rem, 7vw, 4.5rem);
--text-hero--line-height: clamp(3.125rem, 7.5vw, 4.25rem);
--text-hero--letter-spacing: var(--tracking-compressed);
--text-headline: clamp(3.5rem, 8vw, 5.5rem);
--text-headline--line-height: clamp(3.5rem, 8.5vw, 5.75rem);
--text-headline--letter-spacing: var(--tracking-compressed);
--text-headline: clamp(3.5rem, 8vw, 4.5rem);
--text-headline--line-height: clamp(3.5rem, 8vw, 4.625rem);
--text-headline--letter-spacing: var(--tracking-squeezed);

/* Letter spacing */
--tracking-*: initial;
Expand Down
8 changes: 3 additions & 5 deletions src/lib/actions/mouse-position.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ export const useMousePosition = () => {
});

const action = (node: HTMLElement | SVGSVGElement) => {
const handleMouseMove = (event: MouseEvent) => {
const { clientX, clientY } = event;

const handleMouseMove = ({ clientX, clientY }: MouseEvent) => {
position = {
x: clientX - 12, // Remove rect.left
y: clientY + -350 // Remove rect.top
x: clientX + 12,
y: clientY + 12
};
};
hover(node, () => {
Expand Down
29 changes: 29 additions & 0 deletions src/lib/components/animated/text-scramble.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts">
import { write } from '$lib/animations';
import { classNames } from '$lib/utils/classnames';
import { onDestroy, onMount } from 'svelte';

export let text: string = '';
export let delay: number = 0;
export let duration: number = 2500;

export let trigger: boolean = true;

let className: string = '';
export { className as class };

let displayText: string = '';

onMount(() => {
if (!trigger) return;
const delayTimeout = setTimeout(() => {
write(text, (v) => (displayText = v), duration);
}, delay);

return () => clearTimeout(delayTimeout);
});
</script>

<span class={classNames('inline-block w-full text-balance', className)}
>{displayText}<slot name="suffix" /></span
>
23 changes: 23 additions & 0 deletions src/lib/components/animated/text.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script lang="ts">
import { classNames } from '$lib/utils/classnames';
import type { SvelteHTMLElements } from 'svelte/elements';

type Props = {
text: string;
splitBy?: 'words' | 'characters';
staggerBy?: number;
} & SvelteHTMLElements['span'];

const { text, splitBy = 'words', staggerBy = 75, class: className, ...rest }: Props = $props();

const words = splitBy === 'words' ? text.split(' ') : text.split('');
</script>

<span class="sr-only">{text}</span>
<span class={classNames('relative', className)} {...rest}>
{#each words as word, i}
<span class="animate-text mr-2 inline-block" style:animation-delay={`${i * staggerBy}ms`}
>{word}</span
>
{/each}
</span>
7 changes: 5 additions & 2 deletions src/lib/components/appwrite-network/map-tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@
});
</script>

<div class={classNames('pointer-events-none absolute z-100 hidden md:block', theme)}>
<div
class={classNames('pointer-events-none fixed z-100 hidden md:block', theme)}
style:left={`${x}px`}
style:top={`${y}px`}
>
{#if tooltipData.city}
<div
class={classNames(
'border-gradient relative z-100 flex w-[190px] flex-col gap-2 rounded-[10px] p-2 backdrop-blur-lg before:rounded-[10px] after:rounded-[10px]',
{ 'bg-transparent': theme === 'dark', 'bg-white': theme === 'light' }
)}
style:transform={`translateX(${x + 20}px) translateY(${y - 425}px)`}
>
{#key tooltipData.city}
<span class="text-primary text-caption w-fit" bind:this={city}>
Expand Down
61 changes: 12 additions & 49 deletions src/lib/components/appwrite-network/map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,19 @@
import { createMap } from 'svg-dotted-map';
import { browser } from '$app/environment';

let activeSegment = $state<string>('pop-locations');
let activeMarkers = $derived(pins[activeSegment as PinSegment]);
let activeRegion = $state<string | null>(null);
let activeMarker: SVGGElement | null = null;

const { action: mousePosition, position } = useMousePosition();
const { action: inView } = useAnimateInView();

const scrollMarkerIntoView = (marker: SVGGElement) => {
return new Promise<void>((resolve) => {
marker.scrollIntoView({
behavior: 'smooth',
block: 'nearest',
inline: 'center'
});

const observer = new IntersectionObserver(
(entries) => {
if (entries[0].intersectionRatio > 0.5) {
observer.disconnect();
resolve();
}
},
{ threshold: [0, 0.25, 0.5, 0.75, 1] }
);

observer.observe(marker);
});
type Props = {
theme: 'light' | 'dark';
navigable?: boolean;
defaultSet?: PinSegment;
};

const handleSetActiveMarker = async (city: string) => {
const citySlug = slugify(city);

if (activeRegion === citySlug) {
activeMarker = null;
activeRegion = null;
return;
}
const { theme = 'dark', navigable = true, defaultSet = 'pop-locations' }: Props = $props();

activeMarker = document.querySelector(`[data-region="${citySlug}"]`);
let activeSegment = $state<string>(defaultSet);
let activeMarkers = $derived(pins[activeSegment as PinSegment]);

if (activeMarker) {
await scrollMarkerIntoView(activeMarker);
activeRegion = citySlug;
}
};
const { action: mousePosition, position } = useMousePosition();
const { action: inView } = useAnimateInView();

const radius = 0.4;
const height = 75;
Expand All @@ -72,12 +39,6 @@
activeMarkers
)
);

type Props = {
theme: 'light' | 'dark';
};

const { theme = 'dark' }: Props = $props();
</script>

<div class="relative w-full overflow-x-scroll [scrollbar-width:none]">
Expand Down Expand Up @@ -135,4 +96,6 @@
</div>
<MapTooltip {theme} {...position()} />

<MapNav {theme} onValueChange={(value) => (activeSegment = value)} />
{#if navigable}
<MapNav {theme} onValueChange={(value) => (activeSegment = value)} />
{/if}
18 changes: 11 additions & 7 deletions src/lib/components/blog/article.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
import Media from '$lib/UI/Media.svelte';
import { formatDate } from '$lib/utils/date';

export let title: string;
export let cover: string;
export let href: string;
export let date: Date;
export let timeToRead: number;
export let author: string;
export let avatar: string;
interface Props {
title: string;
cover: string;
href: string;
date: Date;
timeToRead: number;
author: string;
avatar: string;
}

const { title, cover, href, date, timeToRead, author, avatar }: Props = $props();
</script>

<a class="group flex w-full flex-col gap-8 bg-transparent pb-3 transition" {href}>
Expand Down
6 changes: 5 additions & 1 deletion src/lib/components/blog/breadcrumbs.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script lang="ts">
export let title: string;
interface Props {
title: string;
}

const { title }: Props = $props();
</script>

<div class="text-caption text-secondary flex gap-3 pt-8 pb-16">
Expand Down
14 changes: 8 additions & 6 deletions src/lib/components/blog/newsletter.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script context="module" lang="ts">
<script module lang="ts">
import { PUBLIC_GROWTH_ENDPOINT } from '$env/static/public';
import { Button } from '$lib/components/ui';

Expand All @@ -17,10 +17,12 @@
</script>

<script lang="ts">
let email = '';
let submitted = false;
let error: string | undefined;
let submitting = false;
import { preventDefault } from 'svelte/legacy';

let email = $state('');
let submitted = $state(false);
let error: string | undefined = $state();
let submitting = $state(false);

const handleSubmit = async () => {
submitting = true;
Expand Down Expand Up @@ -84,7 +86,7 @@
</span>
</div>
{:else}
<form method="post" class="contents" on:submit|preventDefault={handleSubmit}>
<form method="post" class="contents" onsubmit={preventDefault(handleSubmit)}>
<div
class="border-primary/12 focus-within:border-primary/48 flex w-full max-w-sm justify-between gap-1 rounded-xl border bg-white/4 py-1 pr-1 pl-4 backdrop-blur-2xl transition-colors"
>
Expand Down
25 changes: 18 additions & 7 deletions src/lib/components/blog/post-meta.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@
import { formatDate } from '$lib/utils/date';
import type { AuthorData } from '$routes/blog/content';

export let date: string = new Date().toISOString();
export let timeToRead: string = '0';
export let title: string = '';
export let description: string = '';
export let authorData: Partial<AuthorData> = {};
export let currentURL: string = '';
interface Props {
date?: string;
timeToRead?: string;
title?: string;
description?: string;
authorData?: Partial<AuthorData>;
currentURL?: string;
}

const {
date = new Date().toISOString(),
timeToRead = '0',
title = '',
description = '',
authorData = {},
currentURL = ''
}: Props = $props();

const getShareLink = (shareOption: SocialShareOption) => {
const blogPostUrl = encodeURI(currentURL);
Expand Down Expand Up @@ -78,7 +89,7 @@
{:else}
<button
aria-label={sharingOption.label}
on:click={() => handleCopy(currentURL)}
onclick={() => handleCopy(currentURL)}
>
<span class={sharingOption.icon} aria-hidden="true"></span>
</button>
Expand Down
16 changes: 10 additions & 6 deletions src/lib/components/blog/table-of-contents.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="ts" context="module">
<script lang="ts" module>
export type TocItem = {
title: string;
href: string;
Expand All @@ -22,17 +22,21 @@
window.scrollTo({ top: 0 });
};

let isScrolled: boolean = false;
let isScrolled: boolean = $state(false);

const handleIsScrolled = () => {
isScrolled = !!window.scrollY;
};

export let toc: Array<TocItem> = [];
export let heading: string = 'Table of Contents';
interface Props {
toc?: Array<TocItem>;
heading?: string;
}

let { toc = [], heading = 'Table of Contents' }: Props = $props();
</script>

<svelte:window on:scroll={handleIsScrolled} />
<svelte:window onscroll={handleIsScrolled} />

<nav class="sticky top-32 col-span-3 mt-2 -ml-4 hidden h-[800px] flex-col gap-6 lg:flex">
<span class="text-micro tracking-loose text-primary font-aeonik-fono ps-6 uppercase"
Expand Down Expand Up @@ -88,7 +92,7 @@
{#if isScrolled}
<button
class="text-primary group border-smooth text-caption ms-6 -mt-4 flex cursor-pointer items-center gap-2 border-t pt-10 font-medium transition-all"
on:click={backToTop}
onclick={backToTop}
out:fade
in:fade
>
Expand Down
Loading