import { Link } from "react-router"; import { useEffect, useState } from "react"; import type { SupportedGame } from "../types/game"; import sakuraMirageImage from "../assets/games/mirage.webp"; const Landing = () => { const [requireInvite, setRequireInvite] = useState(false); const [numUsers, setNumUsers] = useState(0); const [supportedGames, setSupportedGames] = useState(null); useEffect(() => { const fetchServerInfo = async () => { try { const response = await fetch(import.meta.env.VITE_API_URL + "/info"); const data = await response.json(); setRequireInvite(Boolean(data.requireInvite)); setNumUsers(Number(data.userCount)); } catch (error) { console.error('Error fetching server info:', error); } }; const fetchSupportedGames = async () => { try { const response = await fetch(import.meta.env.VITE_API_URL + "/supportedGames"); const data = await response.json(); setSupportedGames(data); } catch (error) { console.error('Error fetching supported games:', error); } }; fetchServerInfo(); fetchSupportedGames(); }, []); return (
{/* Navigation */}
{/* Background Image */}
{/* Overlay */}
{/* Content */}

Welcome to Mirage!

Looks like you're not logged in. If you've got an account,{" "} Login!

{/* Server Stats Section */}

Server Status

Users

{numUsers}

registered users

Registration

{requireInvite ? "Invite Only" : "Open"}

{requireInvite ? "ask an admin" : "anyone can join"}

Games

{supportedGames ? supportedGames.length : "Loading..."}

supported games

{supportedGames && supportedGames.length > 0 && (

Supported Games

{supportedGames.map((game) => (

{game.formattedName}

{game.description}

))}
)}
{/* Introduction Section */}

What is this?

Mirage is a flexible Rhythm Game Score Tracker that works without relying on predefined seeds. It offers a lightweight alternative that can act as a holdover for tracking scores when chart metadata isn't readily available.

{/* Track Your Scores Section */}

Track Your Scores

Mirage lets you import scores from the games you play for safe-keeping, so you can prevent losing them to the void should anything ever happen.

{/* Add your own games */}

Add Your Own Games

While not as robust as other seed-based systems. Mirage makes it easy for you to track and keep score for any game, no matter how niche it is.

{/* Join with others */}

Mirage Together

Mirage is easily self-hostable and can be used locally for a single person or hosted so you can track scores with your friends. Everything is open-source.

{/* Call to Action Section */}

Ready to Start Tracking?

Create Account Log In
{/* Footer */}
); }; export default Landing;