diff --git a/public/backgrounds.json b/src/backgrounds.json similarity index 100% rename from public/backgrounds.json rename to src/backgrounds.json diff --git a/src/pages/index.astro b/src/pages/index.astro index 3d2f901..3197c9b 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -5,10 +5,9 @@ import { Image } from 'astro:assets' import ImageAuthor from '@/components/ImageAuthor.astro' import { FaGithub, FaBlog, FaDiscord, FaMastodon, FaTwitter } from 'react-icons/fa' import { SiOsu } from 'react-icons/si' +import Background from '../backgrounds.json' -const fetchBackgrond = await fetch(`${Astro.url}/backgrounds.json`).then(async res => await res.json()) - -const randomBackground = fetchBackgrond[Math.floor(Math.random() * fetchBackgrond.length)] +const randomBackground = Background[Math.floor(Math.random() * Background.length)] ---