Overview
Games are defined insrc/data/games.json and automatically displayed on the home page using the GameCard component. Each game entry includes version information, countdown data, theming, and external links.
Data Structure
Each game object ingames.json contains the following properties:
Core Identification
Define the basic game identification fields:
- slug: Unique identifier (kebab-case)
- nombre: Display name shown on the card
- descripcion: Optional SEO description
- href: Route path for the game’s detail page
Version Information
Specify current and upcoming version details:
- version_actual: Current live version number
- proxima_version: Next scheduled version
- nombre_version_actual: Version name/title
- slogan_name: Secondary title (italicized on detail page)
- slogan_desc: Short promotional description
Countdown Configuration
Set up the version countdown timing:
- fecha_inicio: Version start date in ISO 8601 format (UTC)
- duracion_dias: Version duration in days (typically 41-46 days)
Visual Customization
Add theme colors and imagery:
- tema: Primary theme color (hex format)
- imagen: Full URL to the banner/background image
Complete Example
Here’s a real example from the codebase showing Zenless Zone Zero:src/data/games.json
Adding Your Game
Add your game object
Add a new game object to the
games array. Make sure to:- Place a comma after the previous game entry
- Follow the exact property names shown above
- Use proper JSON formatting (double quotes, no trailing commas)
Create a detail page (optional)
If you want a dedicated detail page for your game, create a new Astro file:
src/pages/games/yourgame.astro
You can use
src/pages/games/genshin.astro as a reference template for creating detail pages. The Counter component automatically handles countdown logic.How It Works
The home page (src/pages/index.astro) automatically loads and displays all games:
src/pages/index.astro
games.json automatically creates a card on the dashboard.
Game Card Features
EachGameCard component (defined in src/components/GameCard.astro) includes:
- Background Image: Full-screen banner with gradient overlay
- Version Badge: Shows current version in the top-right corner
- Live Countdown: Real-time counter showing days, hours, minutes, and seconds
- Hover Effects: Scale animation and bottom border on hover
- Theme Colors: Custom accent colors based on the
temaproperty
src/components/GameCard.astro (excerpt)
Best Practices
Image Selection
Image Selection
- Use high-quality official artwork (minimum 1920x1080)
- Ensure images are hosted on reliable CDNs
- Verify images load quickly and are optimized for web
- Choose images with interesting composition that work with gradient overlays
Color Selection
Color Selection
- Use brand-appropriate colors that match the game’s identity
- Test colors for sufficient contrast against dark backgrounds
- Hex values should include the
#prefix - Consider accessibility (avoid very light colors on light backgrounds)
Date and Time Accuracy
Date and Time Accuracy
- Always use UTC timezone (
Zsuffix) in ISO 8601 format - Double-check version start dates from official announcements
- Duration typically ranges from 41-46 days for most gacha games
- Update dates promptly when versions are delayed or extended
Naming Conventions
Naming Conventions
- Use kebab-case for slugs:
genshin-impact, notgenshinimpactorGenshin_Impact - Keep
nombreconcise but descriptive - Use official version names when available
- Ensure
hrefvalues start with/and match your route structure
Troubleshooting
Game card not appearing?- Verify JSON syntax (use a validator like JSONLint)
- Check for trailing commas (not allowed in JSON)
- Ensure all required fields are present
- Restart the dev server after changes
- Verify
fecha_iniciois in ISO 8601 format with UTC timezone - Check that
duracion_diasis a number, not a string - Open browser console to check for JavaScript errors
- Verify the URL is publicly accessible
- Check for CORS issues (most CDNs allow cross-origin requests)
- Try accessing the image URL directly in your browser
Next Steps
Customize Themes
Learn how to customize game themes and colors
GameCard Component
Deep dive into the GameCard component API