diff --git a/src/app/page.tsx b/src/app/page.tsx index 3a154fb..1a24e53 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,7 +10,19 @@ import store from 'store2' export default function Home() { const router = useRouter() const [shortcuts, setShortcuts] = useState([]) + const [splashText, setSplashText] = useState('') + useEffect(() => { + // Fetch splash text from JSON file + fetch('/splash.json') + .then(response => response.json()) + .then(data => { + const randomIndex = Math.floor(Math.random() * data.length); + setSplashText(data[randomIndex].sp); + }) + .catch(error => console.error('Error fetching splash text:', error)); + + // Fetch shortcuts from local storage store.set('shortcuts', [], false) const data: Item[] = store('shortcuts') setShortcuts(data) @@ -36,6 +48,7 @@ export default function Home() { +

{splashText}

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