diff --git a/src/lib/assets/images/dracaena-fragrans.jpg b/src/lib/assets/images/dracaena-fragrans.jpg new file mode 100644 index 0000000..873de37 Binary files /dev/null and b/src/lib/assets/images/dracaena-fragrans.jpg differ diff --git a/src/lib/assets/images/monstera-deliciosa.jpg b/src/lib/assets/images/monstera-deliciosa.jpg new file mode 100644 index 0000000..b126f4a Binary files /dev/null and b/src/lib/assets/images/monstera-deliciosa.jpg differ diff --git a/src/lib/assets/plants/dracaena-fragrans.toml b/src/lib/assets/plants/dracaena-fragrans.toml index 382e750..d0ca489 100644 --- a/src/lib/assets/plants/dracaena-fragrans.toml +++ b/src/lib/assets/plants/dracaena-fragrans.toml @@ -3,6 +3,7 @@ name = "Dracaena Fragrans" bin_name = "Dracaena Fragrans" [image] +local = "dracaena-fragrans.jpg" remote = "https://upload.wikimedia.org/wikipedia/commons/6/64/Dracaena_fragrans_a1.jpg" source = "https://commons.wikimedia.org/wiki/File:Dracaena_fragrans_a1.jpg" alt = """ diff --git a/src/lib/assets/plants/monstera-deliciosa.toml b/src/lib/assets/plants/monstera-deliciosa.toml index b2de837..e7ffdc4 100644 --- a/src/lib/assets/plants/monstera-deliciosa.toml +++ b/src/lib/assets/plants/monstera-deliciosa.toml @@ -3,6 +3,7 @@ name = "Monstera Deliciosa" bin_name = "Monstera Deliciosa" [image] +local = "monstera-deliciosa.jpg" remote = "https://upload.wikimedia.org/wikipedia/commons/d/d4/New_Monstera_Deliciosa_Leaf.jpg" format = "jpeg" width = 1512 diff --git a/src/lib/components/LazyImage.svelte b/src/lib/components/LazyImage.svelte new file mode 100644 index 0000000..8e8fdd6 --- /dev/null +++ b/src/lib/components/LazyImage.svelte @@ -0,0 +1,65 @@ + + + + + (loaded = true)} /> +
+ + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e52ca91..3a0da6b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,6 +2,21 @@ import Footer from "./Footer.svelte"; import Header from "./Header.svelte"; import "../app.scss"; + + import { onNavigate } from "$app/navigation"; + + onNavigate((navigation) => { + // @ts-expect-error + if (!document.startViewTransition) return; + + return new Promise((resolve) => { + // @ts-expect-error + document.startViewTransition(async () => { + resolve(); + await navigation.complete; + }); + }); + });