From 2a5c712929730a5d0c4e7da18fcf30b4749a4cfb Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Fri, 31 May 2024 17:52:04 +0200 Subject: [PATCH] revert: tthe random bg stuff --- {public => src}/backgrounds.json | 0 src/pages/index.astro | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) rename {public => src}/backgrounds.json (100%) 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)] ---