f1StoriesPage

📖 Overview

The garage/ folder powers the 2025 Cars Garage section of the F1 Stories site. It provides an interactive, 3D-driven showcase of each team’s 2025 car, accompanied by dynamic driver cards and technical specifications. Everything here is client-side and static, leveraging JSON data and modular JavaScript to render models and related info.


🗂 Folder Structure

garage/
├── garage.html              # Main interactive 3D car viewer page citeturn1file3
├── garage.css               # Styles for the 3D model container, badges, and layout citeturn1file2
├── garage.js                # Main script: team selection, model toggling, data loading
├── f1-driver-cards.css      # Styles for driver info cards and standings tables citeturn1file0
├── f1-driver-cards.js       # Script: generates driver cards from JSON data
├── enhanced-specs.js        # Script: augments static car specs with interactive features
└── f1-teams-data.json       # JSON with teams, constructors, drivers, and current standings citeturn1file1

📄 garage.html


🎨 garage.css


🛠 Scripts Overview

garage.js

Handles:

  1. Initialization: Loads f1-teams-data.json and initializes badge elements.
  2. Team Selection: On .team-badge click, hides all model iframes, marks clicked badge active, shows corresponding iframe with fade-in.
  3. Driver & Specs Rendering: Invokes functions from f1-driver-cards.js and enhanced-specs.js to populate driver cards and technical details.

f1-driver-cards.js

enhanced-specs.js

Note: Both scripts are written in vanilla JS and have no external dependencies.


🗃 f1-teams-data.json

This file is the single source of truth for:

Updating this JSON (e.g., after a race) immediately reflects changes across driver cards and spec sections without touching any script or HTML. citeturn1file1


🚀 Usage

  1. Clone the repo and cd garage/.
  2. Serve with a static server:

    npx http-server . -p 4000
    
  3. Visit http://localhost:4000/garage.html to explore.

No build tools or package installs are required—everything runs in-browser.


✨ Customization


🛠 Troubleshooting


📘 License & Contribution

This folder follows the project’s MIT License. Contributions (new teams, improved specs, UI enhancements) are welcome via PRs against main branch—please follow existing style and test via local server before submitting.