From fc1fedbda9e4c697f666b8020944d1432843bb82 Mon Sep 17 00:00:00 2001 From: Eric Mika Date: Mon, 13 May 2024 16:34:55 -0400 Subject: [PATCH] Docs: Get random kittens from unsplash instead of placekitten.com. --- src/lib/control/Image.svelte | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/control/Image.svelte b/src/lib/control/Image.svelte index 2c5a427..4d25abb 100644 --- a/src/lib/control/Image.svelte +++ b/src/lib/control/Image.svelte @@ -100,14 +100,20 @@ position="inline">`. import { Button, Image } from 'svelte-tweakpane-ui'; let source = 'placeholder'; - let kittenIndex = 1; + + async function getRandomKittenUrl() { + const { url } = await fetch( + 'https://source.unsplash.com/800x800/?kitten', + { method: 'HEAD', redirect: 'follow' } + ); + return url; + }