diff --git a/public/splash.json b/public/splash.json new file mode 100644 index 0000000..b7717d3 --- /dev/null +++ b/public/splash.json @@ -0,0 +1,35 @@ +[ + { + "splash": "testt22" + }, + { + "splash": "https://discord.gg/qsXnhSPtAK" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + }, + { + "splash": "--placeholder--" + } +] diff --git a/src/app/page.tsx b/src/app/page.tsx index 3a154fb..e8387da 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,7 +10,18 @@ import store from 'store2' export default function Home() { const router = useRouter() const [shortcuts, setShortcuts] = useState([]) + const [splashText, setSplashText] = useState('') + useEffect(() => { + + fetch('/splash.json') + .then(response => response.json()) + .then(data => { + const randomIndex = Math.floor(Math.random() * data.length); + setSplashText(data[randomIndex].splash); + }) + .catch(error => console.error('Error fetching splash text:', error)); + store.set('shortcuts', [], false) const data: Item[] = store('shortcuts') setShortcuts(data) @@ -36,6 +47,7 @@ export default function Home() { +

{splashText}

{shortcuts.length > 0 && (
{shortcuts.map((shortcut: Item) => {