Example website for demonstration only. Not a real business.

Source

How this site is built

Everything below is the live project source, captured when the site was built. After you edit a file, run npm run dev or npm run build to see the change. Compiled HTML (the files in dist/) is also loaded below when you are viewing this page over http:// or https://.

Config and data

The knobs you will turn first: business details, package scripts, and Astro settings.

astro.config.mjs

Astro is set to a static build with one HTML file per page.

// @ts-check
import { defineConfig } from 'astro/config';

// Static HTML, CSS, and JS only — no server, no paid services, no trackers.
export default defineConfig({
  output: 'static',
  // One HTML file per page (index.html, menu.html, …) so the built
  // site can be opened from the dist/ folder or served by any static host.
  build: {
    format: 'file',
  },
});

IMAGES.md

Photographer credits and source URLs for every image.

# Photo credits — Allegro Music Studio

Every image is from Unsplash or Pexels and may be used commercially. Attribution is also listed in the site footer.

| File | Photographer | Source | License |
| --- | --- | --- | --- |
| `images/hero-amp.jpg` | Anna Avilova | https://www.pexels.com/photo/4087993/ | Pexels License (free for commercial use) |
| `images/drums.jpg` | Anna Avilova | https://www.pexels.com/photo/4088019/ | Pexels License (free for commercial use) |
| `images/teacher.jpg` | CHAGAS | https://www.pexels.com/photo/1876279/ | Pexels License (free for commercial use) |
| `images/violin.jpg` | Cesar Augusto | https://www.pexels.com/photo/3289711/ | Pexels License (free for commercial use) |
| `images/piano.jpg` | Lukas Budimaier | https://unsplash.com/photos/JzkgpML_8XI | Unsplash License (free for commercial use) |
| `images/guitar.jpg` | Florian Klauer | https://unsplash.com/photos/GG0jOrmwqtw | Unsplash License (free for commercial use) |
| `images/turntable.jpg` | Luke Chesser | https://unsplash.com/photos/pFqrYbhIAXs | Unsplash License (free for commercial use) |
| `images/concert.jpg` | Desi Mendoza | https://unsplash.com/photos/CuSHBGBdXc0 | Unsplash License (free for commercial use) |
| `images/hall.jpg` | Vadim Sherbakov | https://unsplash.com/photos/d6ebY-faOO0 | Unsplash License (free for commercial use) |

Images were resized and compressed for the web (generally under 300 KB each).
To swap a photo, replace the file in `public/images/`, then update this table, the footer credits in `src/data/site.json`, and any `alt` text.

package.json

npm scripts: dev, build, preview. The only runtime dependency is Astro.

{
  "name": "example-08-music-studio",
  "type": "module",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "astro dev",
    "build": "astro build && node scripts/relative-paths.mjs",
    "preview": "astro preview"
  },
  "dependencies": {
    "astro": "^7.4.7"
  }
}

public/_headers

Sample Content-Security-Policy for hosts like Netlify.

# Sample HTTPS security headers for hosts that understand this file (e.g. Netlify).
# Safe to leave in place on any static host that ignores it.
/*
  Content-Security-Policy: default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; font-src 'self'; connect-src 'self'; form-action 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  X-Frame-Options: DENY

README.md

How to run, customize, and hook up a real form or payment provider.

# Allegro Music Studio

Example **Music school / studio** website, built with [Astro](https://astro.build) 7 as a starting point you can hand to a client or reshape for a pitch.

**This is not a real business.** Names, people, reviews, prices, and the Example Bay address are fictional. The site is set to `noindex` so it will not wander into search results if you deploy it by accident. Remove that meta tag in `src/layouts/BaseLayout.astro` when a real client site should be indexed.

Filter lessons by instrument or level. The practice metronome generates a click in the browser (Web Audio API) — no audio files and no copyrighted recordings.

## How to run

You need Node.js 18 or newer (Node 22+ is fine). In this folder:

```bash
npm install
npm run dev
```

Then open the URL Astro prints (usually http://localhost:4321/).

To make a static build:

```bash
npm run build
npm run preview
```

`npm run build` writes to `dist/` and then rewrites root-absolute paths (`/images/...`) to document-relative ones (`./images/...`). After a build you can also serve the folder with any static server:

```bash
python3 -m http.server --directory dist 8080
```

Opening `dist/index.html` directly from the file system (double-click) usually shows the layout and images. Some browsers restrict JavaScript on `file://` URLs, so interactive features (filters, forms, the lightbox) are more reliable from `npm run preview` or another local server. There are no ES modules required for those features; they live in classic scripts under `public/js/`.

## How to customize

Start with **`src/data/site.json`**. It holds the business name, colors, fonts, hours, contact details, copy, and image credits. Colors are applied as CSS variables by `src/layouts/BaseLayout.astro`.

| Want to change… | Edit |
| --- | --- |
| Name, phone, hours, colors | `src/data/site.json` |
| Page layout and sections | `src/pages/*.astro` |
| Header, footer, hero, forms | `src/components/` |
| Spacing, typography, components | `src/styles/global.css` |
| Shared JS (menu, forms, filters) | `public/js/site.js` |
| This site’s unique JS | `public/js/features.js` |
| Photos | `public/images/` plus `IMAGES.md` and the `images` list in `site.json` |

All copy is written so a beginner can swap it without touching the logic.

## Forms

Every form is a **demo**. Submitting it does not send an email. `public/js/site.js` validates the fields, ignores a hidden honeypot, and writes a thank-you note with `textContent` (never `innerHTML`).

To accept real inquiries:

1. Create a [Formspree](https://formspree.io) form, or a small HTTPS endpoint you host yourself (better if you want to stay off third-party SaaS).
2. Set the form’s `action` to that URL and `method="POST"` in `src/components/ContactForm.astro`.
3. Adjust or remove the `data-demo-form` handler in `public/js/site.js`.
4. Serve the site over HTTPS.

Do not put API keys or secrets in this project. Do not collect passwords, payment details, or (for the dental starter) health information through these forms.

## Security

- No secrets in the frontend.
- User input is never written with `innerHTML`.
- Links to the built assets are relative, so the site is ready for HTTPS and will not mix in third-party scripts.
- `public/_headers` holds a sample Content-Security-Policy for hosts that understand that file (for example Netlify). There is also a commented CSP in the layout.
- Prefer a privacy-respecting map link (OpenStreetMap is used here) over a live Google Maps embed unless the client asks for one.

## Photos

See [IMAGES.md](IMAGES.md). All photos are from Unsplash or Pexels and are free for commercial use, with photographer credits in the footer.

## License of this example

This folder is an example you can copy and modify for client work. The photographs remain under their original Unsplash or Pexels licenses. Astro is MIT licensed.

src/data/site.json

Start here. Business name, colors, hours, copy, and image credits.

{
  "folder": "08-music-studio",
  "kind": "Music school / studio",
  "name": "Allegro Music Studio",
  "shortName": "Allegro",
  "monogram": "AM",
  "tagline": "Lessons, practice rooms, and a small hall",
  "description": "Example music studio website with a lesson catalog, booking request, and a practice metronome.",
  "phone": "(555) 010-1408",
  "phoneHref": "tel:+15550101408",
  "email": "desk@allegrostudio.example",
  "address": {
    "street": "31 Rehearsal Court",
    "city": "Example Bay",
    "state": "CA",
    "zip": "00000",
    "osm": "https://www.openstreetmap.org/search?query=Example%20Bay"
  },
  "hours": [
    {
      "days": "Monday \u2013 Thursday",
      "time": "1:00 pm \u2013 8:30 pm"
    },
    {
      "days": "Friday",
      "time": "1:00 pm \u2013 6:00 pm"
    },
    {
      "days": "Saturday",
      "time": "9:00 am \u2013 2:00 pm"
    },
    {
      "days": "Sunday",
      "time": "Closed"
    }
  ],
  "theme": {
    "bg": "#16121c",
    "fg": "#f6efe4",
    "primary": "#c9a227",
    "primaryText": "#1a1408",
    "accent": "#b9a0d8",
    "muted": "#c7bdb0",
    "card": "#201c28",
    "border": "#3a3444",
    "headerBg": "#110e16",
    "fontDisplay": "Georgia, Palatino, serif",
    "fontBody": "'Segoe UI', system-ui, sans-serif",
    "radius": "14px",
    "colorScheme": "dark"
  },
  "nav": [
    {
      "label": "Home",
      "page": "index"
    },
    {
      "label": "Lessons",
      "page": "lessons"
    },
    {
      "label": "Faculty",
      "page": "faculty"
    },
    {
      "label": "Contact",
      "page": "contact"
    },
    {
      "label": "Source",
      "page": "source"
    }
  ],
  "headerCta": {
    "label": "Request a lesson",
    "page": "contact"
  },
  "hero": {
    "variant": "full",
    "flip": false,
    "image": "images/hero-amp.jpg",
    "imageAlt": "Guitar on a stand beside an amplifier in a studio",
    "eyebrow": "Example music studio starter",
    "title": "A room to learn in, not just to pass through.",
    "lead": "Piano, guitar, drums, voice, and strings. A fictional studio with a real practice metronome in the browser.",
    "primaryCta": {
      "label": "See lessons",
      "page": "lessons"
    },
    "secondaryCta": {
      "label": "Meet faculty",
      "page": "faculty"
    }
  },
  "intro": {
    "title": "Teachers, rooms, and a hall down the corridor",
    "text": "This starter is for music schools and teaching studios. Lessons can be filtered by instrument. The metronome uses the Web Audio API \u2014 no recorded tracks and no copyrighted music.",
    "image": "images/drums.jpg",
    "imageAlt": "Drum kit in a practice room"
  },
  "servicesEyebrow": "The studio",
  "servicesTitle": "More than a lesson slot",
  "servicesLead": "A few offers that often sit around the lesson catalog.",
  "services": [
    {
      "name": "Private lessons",
      "blurb": "Thirty or sixty minutes, most instruments we list.",
      "price": "See catalog"
    },
    {
      "name": "Practice rooms",
      "blurb": "Book a room when you are not in a lesson.",
      "price": "Hourly"
    },
    {
      "name": "Studio recital",
      "blurb": "A small hall, a short program, a painted chair for family.",
      "price": "Seasonal"
    }
  ],
  "lessonsTitle": "Lesson catalog",
  "lessonsLead": "Fictional offerings. Filter by instrument or level, then request a time on the contact page.",
  "lessonFilters": [
    {
      "label": "All",
      "value": "all"
    },
    {
      "label": "Piano",
      "value": "piano"
    },
    {
      "label": "Guitar",
      "value": "guitar"
    },
    {
      "label": "Drums",
      "value": "drums"
    },
    {
      "label": "Voice",
      "value": "voice"
    },
    {
      "label": "Strings",
      "value": "strings"
    },
    {
      "label": "Beginner",
      "value": "beginner"
    }
  ],
  "lessons": [
    {
      "name": "Piano \u2014 beginner",
      "level": "Beginner",
      "length": "30 min",
      "price": "$42",
      "tags": "piano beginner",
      "blurb": "Hands, reading, and a first repertoire."
    },
    {
      "name": "Piano \u2014 continuing",
      "level": "Intermediate+",
      "length": "45 min",
      "price": "$58",
      "tags": "piano intermediate",
      "blurb": "Technique and pieces that take a little stamina."
    },
    {
      "name": "Guitar \u2014 beginner",
      "level": "Beginner",
      "length": "30 min",
      "price": "$42",
      "tags": "guitar beginner",
      "blurb": "Open chords, a steady right hand, two songs you like."
    },
    {
      "name": "Guitar \u2014 ensemble",
      "level": "Intermediate",
      "length": "45 min",
      "price": "$40",
      "tags": "guitar intermediate",
      "blurb": "A small group hour for students who are ready to play together."
    },
    {
      "name": "Drums",
      "level": "All",
      "length": "30 or 45 min",
      "price": "from $42",
      "tags": "drums beginner intermediate",
      "blurb": "Time, coordination, and a kit that already lives in the room."
    },
    {
      "name": "Voice",
      "level": "All",
      "length": "30 or 45 min",
      "price": "from $45",
      "tags": "voice beginner intermediate",
      "blurb": "Breath, range, and repertoire \u2014 no style required on day one."
    },
    {
      "name": "Violin / viola",
      "level": "All",
      "length": "30 or 45 min",
      "price": "from $45",
      "tags": "strings beginner intermediate",
      "blurb": "A classical foundation, with room for other styles later."
    },
    {
      "name": "Adult starter",
      "level": "Beginner",
      "length": "30 min",
      "price": "$42",
      "tags": "piano guitar voice beginner",
      "blurb": "For grown-ups who always meant to start."
    }
  ],
  "metronome": {
    "title": "A practice click",
    "lead": "Set a tempo and start. The click is generated in your browser. Nothing is recorded or uploaded."
  },
  "galleryEyebrow": "Rooms",
  "galleryTitle": "Instruments and the hall",
  "galleryLead": "Example studio photographs. Click to enlarge.",
  "gallery": [
    {
      "file": "images/piano.jpg",
      "alt": "Hands on a piano keyboard"
    },
    {
      "file": "images/guitar.jpg",
      "alt": "Acoustic guitar lying on a surface"
    },
    {
      "file": "images/teacher.jpg",
      "alt": "Musician with an instrument in a sunlit room"
    },
    {
      "file": "images/violin.jpg",
      "alt": "Violinist playing in a rehearsal space"
    },
    {
      "file": "images/turntable.jpg",
      "alt": "Record playing on a turntable"
    },
    {
      "file": "images/concert.jpg",
      "alt": "Audience with hands raised at a live show"
    },
    {
      "file": "images/hall.jpg",
      "alt": "Warm string lights in a performance hall"
    }
  ],
  "testimonials": [
    {
      "name": "The Demir family",
      "role": "Piano student (example)",
      "quote": "Our child likes the teacher and the room. That is most of the battle."
    },
    {
      "name": "Chris Paley",
      "role": "Adult guitar (example)",
      "quote": "I started at forty. Nobody made that feel strange."
    },
    {
      "name": "Mina Ortiz",
      "role": "Voice student (example)",
      "quote": "The recital hall is small enough that it feels like a concert, not a test."
    }
  ],
  "cta": {
    "title": "Request a first lesson",
    "lead": "Tell us the instrument and a time of day. The form is a demo until you connect an endpoint.",
    "label": "Write to the desk",
    "page": "contact"
  },
  "about": {
    "title": "A teaching studio with a hall",
    "pageDescription": "About the fictional Allegro Music Studio.",
    "paragraphs": [
      "This starter is for independent music teachers and small schools. It leaves room to mention a teacher\u2019s own musicianship without inventing credentials.",
      "The metronome is an original in-browser tool. Do not add commercial recordings unless you have the rights."
    ],
    "image": "images/hall.jpg",
    "imageAlt": "Warm string lights in a performance hall",
    "id": "faculty"
  },
  "stats": [
    {
      "value": "5",
      "label": "Example instruments taught"
    },
    {
      "value": "2",
      "label": "Practice rooms"
    },
    {
      "value": "1",
      "label": "Small recital hall"
    }
  ],
  "teamTitle": "Faculty",
  "teamLead": "Fictional teachers so the page has names. Replace with real, approved bios.",
  "team": [
    {
      "name": "Elena Rossi",
      "role": "Piano",
      "bio": "Beginner through continuing piano, and the adult starter hour.",
      "image": "images/piano.jpg",
      "imageAlt": "Hands on a piano keyboard"
    },
    {
      "name": "Marcus Bell",
      "role": "Guitar",
      "bio": "Private guitar and the small ensemble hour.",
      "image": "images/teacher.jpg",
      "imageAlt": "Musician with an instrument in a sunlit room"
    },
    {
      "name": "Sofia Kade",
      "role": "Strings and voice",
      "bio": "Violin, viola, and voice, plus recital coaching.",
      "image": "images/violin.jpg",
      "imageAlt": "Violinist playing in a rehearsal space"
    }
  ],
  "contactPage": {
    "id": "contact",
    "eyebrow": "Lessons",
    "title": "Request a first lesson",
    "lead": "Demo form only. Tell us the instrument, a level, and a time of day that works.",
    "formHeading": "Lesson request",
    "formIntro": "No placement audition is required for a first conversation.",
    "submitLabel": "Request a lesson",
    "showService": true,
    "serviceLabel": "Instrument",
    "serviceOptions": [
      "Piano",
      "Guitar",
      "Drums",
      "Voice",
      "Violin / viola",
      "Not sure yet"
    ],
    "showDate": true,
    "extraNote": "Practice-room bookings can use the same form; mention it in the message.",
    "warning": ""
  },
  "faqTitle": "FAQ",
  "faqLead": "",
  "faqs": [],
  "images": [
    {
      "file": "images/hero-amp.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/4087993/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Guitar on a stand beside an amplifier in a studio"
    },
    {
      "file": "images/drums.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/4088019/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Drum kit in a practice room"
    },
    {
      "file": "images/teacher.jpg",
      "photographer": "CHAGAS",
      "source": "https://www.pexels.com/photo/1876279/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Musician with an instrument in a sunlit room"
    },
    {
      "file": "images/violin.jpg",
      "photographer": "Cesar Augusto",
      "source": "https://www.pexels.com/photo/3289711/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Violinist playing in a rehearsal space"
    },
    {
      "file": "images/piano.jpg",
      "photographer": "Lukas Budimaier",
      "source": "https://unsplash.com/photos/JzkgpML_8XI",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Hands on a piano keyboard"
    },
    {
      "file": "images/guitar.jpg",
      "photographer": "Florian Klauer",
      "source": "https://unsplash.com/photos/GG0jOrmwqtw",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Acoustic guitar lying on a surface"
    },
    {
      "file": "images/turntable.jpg",
      "photographer": "Luke Chesser",
      "source": "https://unsplash.com/photos/pFqrYbhIAXs",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Record playing on a turntable"
    },
    {
      "file": "images/concert.jpg",
      "photographer": "Desi Mendoza",
      "source": "https://unsplash.com/photos/CuSHBGBdXc0",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Audience with hands raised at a live show"
    },
    {
      "file": "images/hall.jpg",
      "photographer": "Vadim Sherbakov",
      "source": "https://unsplash.com/photos/d6ebY-faOO0",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Warm string lights in a performance hall"
    }
  ]
}

src/utils/paths.ts

Helpers so links work in dev and in the built dist/ folder.

/**
 * Helpers so links work both in `npm run dev` and in the built `dist/` folder.
 * After the post-build rewrite, production links are document-relative (./menu.html).
 */
export function pageHref(page: string): string {
  const name = page.replace(/^\//, "").replace(/\.html$/, "");
  const file = !name || name === "index" ? "index.html" : `${name}.html`;
  return import.meta.env.DEV ? `/${file}` : `./${file}`;
}

export function asset(path: string): string {
  const clean = path.replace(/^\//, "");
  return import.meta.env.DEV ? `/${clean}` : `./${clean}`;
}

Astro layouts and components

Reusable pieces. Each file has a front-matter comment describing what to edit.

src/components/ContactForm.astro

Demo form. Does not send data until you add an endpoint.

---
/**
 * Demo contact / booking / inquiry form.
 *
 * Nothing is sent. The submit handler in public/js/site.js only validates
 * and shows a thank-you message (via textContent, never innerHTML).
 *
 * To accept real messages:
 *  1. Create a Formspree form (https://formspree.io) or a small HTTPS
 *     endpoint you host yourself (recommended if you want to stay off
 *     third-party SaaS).
 *  2. Set this form's action to that URL and method="POST".
 *  3. Remove data-demo-form, or keep it and adjust the JS so a successful
 *     native submit can proceed.
 *  4. Serve the site over HTTPS.
 * Do not put API keys in this file or any other frontend file.
 */
interface Props {
  heading?: string;
  intro?: string;
  submitLabel?: string;
  showService?: boolean;
  serviceLabel?: string;
  serviceOptions?: string[];
  showDate?: boolean;
  extraNote?: string;
}
const {
  heading = 'Get in touch',
  intro = 'This is a demo form. Submissions stay in your browser until you connect an endpoint.',
  submitLabel = 'Send message',
  showService = false,
  serviceLabel = 'Interested in',
  serviceOptions = [],
  showDate = false,
  extraNote,
} = Astro.props;
---
<form class="card" data-demo-form novalidate>
  <h2>{heading}</h2>
  <p class="form-note">{intro}</p>

  <!-- Honeypot: hidden from people, filled by some bots. Must stay empty. -->
  <div class="hp" aria-hidden="true">
    <label>
      Company website
      <input type="text" name="company_website" tabindex="-1" autocomplete="off" />
    </label>
  </div>

  <label>
    Name
    <input type="text" name="name" required maxlength="80" autocomplete="name" />
  </label>
  <label>
    Email
    <input type="email" name="email" required maxlength="120" autocomplete="email" />
  </label>
  <label>
    Phone
    <input type="tel" name="phone" maxlength="40" autocomplete="tel" />
  </label>
  {showService && serviceOptions.length > 0 && (
    <label>
      {serviceLabel}
      <select name="service">
        {serviceOptions.map((opt) => <option value={opt}>{opt}</option>)}
      </select>
    </label>
  )}
  {showDate && (
    <label>
      Preferred date
      <input type="date" name="preferred_date" />
    </label>
  )}
  <label>
    Message
    <textarea name="message" required maxlength="2000"></textarea>
  </label>
  {extraNote && <p class="form-note">{extraNote}</p>}
  <button type="submit" class="btn">{submitLabel}</button>
  <p class="form-status" data-form-status role="status"></p>
</form>

src/components/CtaBand.astro

Full-width closing call to action.

---
/** Full-width call to action. Copy comes from site.cta. */
import site from '../data/site.json';
import { pageHref } from '../utils/paths';
const cta = site.cta;
---
<section class="section section--primary" id="cta">
  <div class="wrap split">
    <div>
      <h2>{cta.title}</h2>
      <p>{cta.lead}</p>
    </div>
    <div class="btn-row">
      <a class="btn btn--light" href={pageHref(cta.page)}>{cta.label}</a>
      <a class="btn btn--ghost" href={site.phoneHref} style="color:inherit;border-color:currentColor">
        Call {site.phone}
      </a>
    </div>
  </div>
</section>

src/components/Header.astro

Logo, navigation, and the mobile menu button.

---
/**
 * Site header: logo, navigation from site.json, phone/booking CTA, mobile menu.
 * Mark the current page with the `current` prop so aria-current is set.
 */
import site from '../data/site.json';
import { pageHref } from '../utils/paths';

interface Props { current?: string; }
const { current = 'index' } = Astro.props;
---
<header class="site-header" data-header>
  <div class="wrap header-inner">
    <a class="logo" href={pageHref('index')}>
      <span class="logo-mark" aria-hidden="true">{site.monogram}</span>
      <span>{site.shortName}</span>
    </a>
    <button
      type="button"
      class="nav-toggle"
      data-nav-toggle
      aria-expanded="false"
      aria-controls="site-nav"
    >
      <span class="sr-only">Menu</span>
      <span class="nav-toggle-bar"></span>
      <span class="nav-toggle-bar"></span>
      <span class="nav-toggle-bar"></span>
    </button>
    <nav class="site-nav" id="site-nav" aria-label="Primary">
      <ul class="nav-list">
        {site.nav.map((item) => (
          <li>
            <a
              href={pageHref(item.page)}
              aria-current={item.page === current ? 'page' : undefined}
            >
              {item.label}
            </a>
          </li>
        ))}
        <li>
          <a class="btn header-cta" href={pageHref(site.headerCta.page)}>
            {site.headerCta.label}
          </a>
        </li>
      </ul>
    </nav>
  </div>
</header>

src/components/Hero.astro

Top-of-page band. Layout variant is set in site.json.

---
/**
 * Hero band. The variant (full, split, or stack) and all copy live in site.json.
 */
import site from '../data/site.json';
import { pageHref, asset } from '../utils/paths';

const hero = site.hero;
const variant = hero.variant || 'split';
---
<section class={`hero hero--${variant}`} aria-label="Introduction">
  {variant === 'full' && (
    <div class="hero-media" aria-hidden="true">
      <img src={asset(hero.image)} alt="" />
    </div>
  )}
  <div class="wrap">
    {variant !== 'full' ? (
      <div class={`split ${variant === 'split' && hero.flip ? 'split--flip' : ''}`}>
        <div class="hero-copy">
          {hero.eyebrow && <p class="eyebrow">{hero.eyebrow}</p>}
          <h1>{hero.title}</h1>
          <p class="lead">{hero.lead}</p>
          <div class="btn-row">
            <a class="btn" href={pageHref(hero.primaryCta.page)}>{hero.primaryCta.label}</a>
            {hero.secondaryCta && (
              <a class="btn btn--ghost" href={pageHref(hero.secondaryCta.page)}>
                {hero.secondaryCta.label}
              </a>
            )}
          </div>
        </div>
        <div class="hero-media media">
          <img src={asset(hero.image)} alt={hero.imageAlt} />
        </div>
      </div>
    ) : (
      <div class="hero-copy">
        {hero.eyebrow && <p class="eyebrow">{hero.eyebrow}</p>}
        <h1>{hero.title}</h1>
        <p class="lead">{hero.lead}</p>
        <div class="btn-row">
          <a class="btn btn--light" href={pageHref(hero.primaryCta.page)}>{hero.primaryCta.label}</a>
          {hero.secondaryCta && (
            <a class="btn btn--ghost" href={pageHref(hero.secondaryCta.page)} style="color:#fff;border-color:rgba(255,255,255,.5)">
              {hero.secondaryCta.label}
            </a>
          )}
        </div>
      </div>
    )}
  </div>
</section>

src/components/LessonCatalog.astro

Project file included so the source page stays complete.

---
/** Filterable lesson offerings from site.lessons. */
import site from '../data/site.json';
---
<section class="section" id="lessons">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">Lessons</p>
      <h2>{site.lessonsTitle}</h2>
      <p class="lead">{site.lessonsLead}</p>
    </div>
    <div class="chip-row" data-filter-group data-filter-target="#lesson-list .lesson-card" style="margin-bottom:1rem;">
      {site.lessonFilters.map((f, i) => (
        <button type="button" class:list={['filter-btn', { 'is-active': i === 0 }]} data-filter={f.value} data-filter-key="tags" aria-pressed={i === 0 ? 'true' : 'false'}>
          {f.label}
        </button>
      ))}
    </div>
    <div id="lesson-list" class="grid grid-3">
      {site.lessons.map((lesson) => (
        <article class="lesson-card card" data-tags={lesson.tags}>
          <h3>{lesson.name}</h3>
          <p class="meta">{lesson.level} · {lesson.length}</p>
          <p>{lesson.blurb}</p>
          <p class="price">{lesson.price}</p>
        </article>
      ))}
    </div>
  </div>
</section>

src/components/Metronome.astro

Project file included so the source page stays complete.

---
/**
 * Practice metronome using the Web Audio API (no recorded music, no copyrighted audio).
 * Controls are in public/js/features.js.
 */
import site from '../data/site.json';
---
<section class="section section--alt" id="metronome">
  <div class="wrap split">
    <div>
      <p class="eyebrow">Practice tool</p>
      <h2>{site.metronome.title}</h2>
      <p class="lead">{site.metronome.lead}</p>
    </div>
    <div class="card metronome" data-metronome>
      <div class="metronome-pulse" data-pulse aria-hidden="true">♪</div>
      <label>
        Tempo (<span data-bpm-label>80</span> BPM)
        <input type="range" min="40" max="208" value="80" data-bpm />
      </label>
      <div class="btn-row">
        <button type="button" class="btn" data-metro-toggle>Start</button>
      </div>
      <p class="form-note">Uses a simple click generated in the browser. Nothing is uploaded or recorded.</p>
    </div>
  </div>
</section>

src/components/Services.astro

Project file included so the source page stays complete.

---
/** Service / offer cards from site.services. Swap the copy in site.json. */
import site from '../data/site.json';
---
<section class="section" id="services">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">{site.servicesEyebrow}</p>
      <h2>{site.servicesTitle}</h2>
      <p class="lead">{site.servicesLead}</p>
    </div>
    <div class="grid grid-3">
      {site.services.map((s) => (
        <article class="card">
          <h3>{s.name}</h3>
          <p>{s.blurb}</p>
          {s.price && <p class="price">{s.price}</p>}
        </article>
      ))}
    </div>
  </div>
</section>

src/components/Testimonials.astro

Quote cards fed by site.testimonials.

---
/** Pull quotes from site.testimonials. Easy to add, edit, or remove. */
import site from '../data/site.json';
---
<section class="section section--alt" id="testimonials">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">Kind words</p>
      <h2>What clients say</h2>
      <p class="lead">Fictional reviews for this example site — replace them with real permissioned testimonials.</p>
    </div>
    <div class="grid grid-3">
      {site.testimonials.map((t) => (
        <figure class="card">
          <blockquote>
            <p>“{t.quote}”</p>
          </blockquote>
          <figcaption>
            <strong>{t.name}</strong>
            <div class="meta">{t.role}</div>
          </figcaption>
        </figure>
      ))}
    </div>
  </div>
</section>

src/layouts/BaseLayout.astro

HTML shell, meta tags, theme variables, and script tags.

---
/**
 * HTML shell for every page.
 * Theme colors and fonts are read from src/data/site.json and applied
 * as CSS variables. Change that file to re-skin the site.
 */
import '../styles/global.css';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';

interface Props {
  title?: string;
  description?: string;
  page?: string;
}

const { title, description, page = 'index' } = Astro.props;
const pageTitle = title
  ? `${title} · ${site.name}`
  : `${site.name} · ${site.tagline}`;

/** Only allow safe theme values through to the style attribute. */
function themeStyle(theme: Record<string, string>): string {
  const map: Record<string, string> = {
    bg: '--bg',
    fg: '--fg',
    primary: '--primary',
    primaryText: '--primary-text',
    accent: '--accent',
    muted: '--muted',
    card: '--card',
    border: '--border',
    headerBg: '--header-bg',
    fontDisplay: '--font-display',
    fontBody: '--font-body',
    radius: '--radius',
  };
  const parts: string[] = [];
  for (const [key, cssVar] of Object.entries(map)) {
    const value = theme[key];
    if (!value) continue;
    if (key.startsWith('font')) {
      if (!/^[A-Za-z0-9"'\s,\-]+$/.test(value)) continue;
    } else if (key === 'radius') {
      if (!/^\d+(\.\d+)?(px|rem)$/.test(value)) continue;
    } else if (!/^#([0-9a-fA-F]{3,8})$/.test(value)) {
      continue;
    }
    parts.push(`${cssVar}: ${value}`);
  }
  return parts.join('; ');
}

const scheme = site.theme.colorScheme === 'dark' ? 'dark' : 'light';
---
<!doctype html>
<html lang="en" data-theme={scheme} style={themeStyle(site.theme as Record<string, string>)}>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content={description ?? site.description} />
    <meta name="color-scheme" content={scheme} />
    <!-- Fictional example: hide from search engines until you replace the copy. -->
    <meta name="robots" content="noindex, nofollow" />
    <title>{pageTitle}</title>
    <link rel="icon" href={asset('favicon.svg')} type="image/svg+xml" />
    <!--
      Sample Content-Security-Policy for an HTTPS deploy.
      Uncomment the meta tag, or use public/_headers on Netlify / similar.
      style-src includes 'unsafe-inline' because theme variables are set on <html>
      and small critical CSS may be inlined by Astro.

      default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline';
      script-src 'self'; font-src 'self'; connect-src 'self'; form-action 'self';
      base-uri 'self'; object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
    -->
  </head>
  <body>
    <a class="skip-link" href="#main">Skip to content</a>
    <div class="example-banner">
      Example website for demonstration only. Not a real business.
    </div>
    <Header current={page} />
    <main id="main">
      <slot />
    </main>
    <Footer />
    <script src={asset('js/site.js')} defer></script>
    <script src={asset('js/features.js')} defer></script>
  </body>
</html>

Pages

One file per URL. After `npm run build` these compile to HTML in dist/.

src/pages/contact.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import ContactForm from '../components/ContactForm.astro';
import site from '../data/site.json';
---
<BaseLayout page={site.contactPage.id} title={site.contactPage.title} description={site.contactPage.lead}>
  <section class="section">
    <div class="wrap split">
      <div>
        <p class="eyebrow">{site.contactPage.eyebrow}</p>
        <h1>{site.contactPage.title}</h1>
        <p class="lead">{site.contactPage.lead}</p>
        <p>
          <a href={site.phoneHref}>{site.phone}</a><br />
          <a href={`mailto:${site.email}`}>{site.email}</a>
        </p>
        <p>
          {site.address.street}<br />
          {site.address.city}, {site.address.state} {site.address.zip}
        </p>
        <p>
          <a href={site.address.osm} rel="noopener noreferrer">View map on OpenStreetMap</a>
        </p>
        <h2>Hours</h2>
        <ul class="hours">
          {site.hours.map((row) => (
            <li><span>{row.days}</span><span>{row.time}</span></li>
          ))}
        </ul>
        {site.contactPage.warning && <p class="form-note">{site.contactPage.warning}</p>}
      </div>
      <ContactForm
        heading={site.contactPage.formHeading}
        intro={site.contactPage.formIntro}
        submitLabel={site.contactPage.submitLabel}
        showService={site.contactPage.showService}
        serviceLabel={site.contactPage.serviceLabel}
        serviceOptions={site.contactPage.serviceOptions}
        showDate={site.contactPage.showDate}
        extraNote={site.contactPage.extraNote}
      />
    </div>
  </section>
</BaseLayout>

src/pages/faculty.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';

const aboutId = site.about.id || 'about';
---
<BaseLayout page={aboutId} title={site.about.title} description={site.about.pageDescription}>
  <section class="section">
    <div class="wrap split">
      <div>
        <p class="eyebrow">About</p>
        <h1>{site.about.title}</h1>
        {site.about.paragraphs.map((text) => <p>{text}</p>)}
        {site.stats && site.stats.length > 0 && (
          <div class="stat-row">
            {site.stats.map((s) => (
              <div>
                <strong>{s.value}</strong>
                <span class="meta">{s.label}</span>
              </div>
            ))}
          </div>
        )}
      </div>
      <div class="media">
        <img src={asset(site.about.image)} alt={site.about.imageAlt} />
      </div>
    </div>
  </section>
  {site.team && site.team.length > 0 && (
    <section class="section section--alt" id="team">
      <div class="wrap">
        <div class="section-head">
          <p class="eyebrow">People</p>
          <h2>{site.teamTitle}</h2>
          <p class="lead">{site.teamLead}</p>
        </div>
        <div class="grid grid-3">
          {site.team.map((person) => (
            <article class="card">
              {person.image && (
                <div class="media" style="margin: -1.25rem -1.25rem 1rem; border: 0; border-radius: var(--radius) var(--radius) 0 0;">
                  <img src={asset(person.image)} alt={person.imageAlt || person.name} style="height: 16rem;" />
                </div>
              )}
              <h3>{person.name}</h3>
              <p class="meta">{person.role}</p>
              <p>{person.bio}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  )}
  <CtaBand />
</BaseLayout>

src/pages/index.astro

Home page. Compose or rearrange sections here.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import Hero from '../components/Hero.astro';
import Services from '../components/Services.astro';
import Gallery from '../components/Gallery.astro';
import Testimonials from '../components/Testimonials.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';
import Metronome from '../components/Metronome.astro';
---
<BaseLayout page="index">
  <Hero />

  <section class="section" id="intro">
    <div class="wrap split">
      <div>
        <p class="eyebrow">Welcome</p>
        <h2>{site.intro.title}</h2>
        <p>{site.intro.text}</p>
      </div>
      <div class="media">
        <img src={asset(site.intro.image)} alt={site.intro.imageAlt} />
      </div>
    </div>
  </section>

  <Services />

  <Metronome />

  {site.team && site.team.length > 0 && (
    <section class="section" id="people">
      <div class="wrap">
        <div class="section-head">
          <p class="eyebrow">People</p>
          <h2>{site.teamTitle}</h2>
          <p class="lead">{site.teamLead}</p>
        </div>
        <div class="grid grid-3">
          {site.team.slice(0, 3).map((person) => (
            <article class="card">
              <h3>{person.name}</h3>
              <p class="meta">{person.role}</p>
              <p>{person.bio}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  )}

  <Gallery />
  <Testimonials />
  <CtaBand />
</BaseLayout>

src/pages/lessons.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import LessonCatalog from '../components/LessonCatalog.astro';
import Metronome from '../components/Metronome.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
---
<BaseLayout page="lessons" title="Lessons" description={site.lessonsLead}>
  <LessonCatalog />
  <Metronome />
  <CtaBand />
</BaseLayout>

src/pages/source.astro

This page. Built at compile time from the files on disk.

---
/**
 * /source — shows this site's code, grouped by type, generated at build time.
 * Short notes explain what each major file is for. Edit the map below if you
 * add files. The contents themselves come from import.meta.glob(?raw), so
 * they stay in sync with the project.
 */
import BaseLayout from '../layouts/BaseLayout.astro';
import site from '../data/site.json';
import sourcePage from './source.astro?raw';

const discovered = import.meta.glob(
  [
    '../**/*.{astro,css,js,ts,json}',
    '../../public/js/site.js',
    '../../public/js/features.js',
    '../../public/_headers',
    '../../astro.config.mjs',
    '../../package.json',
    '../../README.md',
    '../../IMAGES.md',
  ],
  { query: '?raw', import: 'default', eager: true }
);

type Entry = { path: string; code: string; note: string };

const notes: Record<string, string> = {
  'src/data/site.json': 'Start here. Business name, colors, hours, copy, and image credits.',
  'src/layouts/BaseLayout.astro': 'HTML shell, meta tags, theme variables, and script tags.',
  'src/components/Header.astro': 'Logo, navigation, and the mobile menu button.',
  'src/components/Footer.astro': 'Contact, hours, and required photo attribution.',
  'src/components/Hero.astro': 'Top-of-page band. Layout variant is set in site.json.',
  'src/components/Testimonials.astro': 'Quote cards fed by site.testimonials.',
  'src/components/CtaBand.astro': 'Full-width closing call to action.',
  'src/components/ContactForm.astro': 'Demo form. Does not send data until you add an endpoint.',
  'src/styles/global.css': 'Shared typography, layout, forms, gallery, and components.',
  'src/utils/paths.ts': 'Helpers so links work in dev and in the built dist/ folder.',
  'src/pages/index.astro': 'Home page. Compose or rearrange sections here.',
  'src/pages/source.astro': 'This page. Built at compile time from the files on disk.',
  'public/js/site.js': 'Shared vanilla JS: menu, forms, accordion, lightbox, filters.',
  'public/js/features.js': 'Interactive features unique to this starter.',
  'public/_headers': 'Sample Content-Security-Policy for hosts like Netlify.',
  'astro.config.mjs': 'Astro is set to a static build with one HTML file per page.',
  'package.json': 'npm scripts: dev, build, preview. The only runtime dependency is Astro.',
  'README.md': 'How to run, customize, and hook up a real form or payment provider.',
  'IMAGES.md': 'Photographer credits and source URLs for every image.',
};

function normalize(raw: string): string {
  if (raw.startsWith('../../public/')) return raw.slice(6); // public/...
  if (raw.startsWith('../../')) return raw.slice(6);
  if (raw.startsWith('../')) return 'src/' + raw.slice(3);
  if (raw.startsWith('./')) return 'src/pages/' + raw.slice(2);
  return raw;
}

const files: Entry[] = Object.entries(discovered).map(([rawPath, code]) => {
  const path = normalize(rawPath);
  return {
    path,
    code: String(code),
    note: notes[path] || 'Project file included so the source page stays complete.',
  };
});

// import.meta.glob often skips the file that contains the glob. Add it by hand.
if (!files.some((f) => f.path.endsWith('pages/source.astro'))) {
  files.push({
    path: 'src/pages/source.astro',
    code: String(sourcePage),
    note: notes['src/pages/source.astro'],
  });
}

files.sort((a, b) => a.path.localeCompare(b.path));

const groups: { id: string; title: string; blurb: string; match: (p: string) => boolean }[] = [
  {
    id: 'config',
    title: 'Config and data',
    blurb: 'The knobs you will turn first: business details, package scripts, and Astro settings.',
    match: (p) =>
      p.endsWith('site.json') ||
      p.endsWith('package.json') ||
      p.endsWith('astro.config.mjs') ||
      p.endsWith('README.md') ||
      p.endsWith('IMAGES.md') ||
      p.endsWith('_headers') ||
      p.endsWith('paths.ts'),
  },
  {
    id: 'astro-components',
    title: 'Astro layouts and components',
    blurb: 'Reusable pieces. Each file has a front-matter comment describing what to edit.',
    match: (p) => p.endsWith('.astro') && !p.includes('/pages/'),
  },
  {
    id: 'pages',
    title: 'Pages',
    blurb: 'One file per URL. After `npm run build` these compile to HTML in dist/.',
    match: (p) => p.includes('/pages/') && p.endsWith('.astro'),
  },
  {
    id: 'css',
    title: 'CSS',
    blurb: 'One global stylesheet, themed with CSS variables from site.json.',
    match: (p) => p.endsWith('.css'),
  },
  {
    id: 'js',
    title: 'JavaScript',
    blurb: 'Classic scripts (not modules) so built pages can also run from a simple static server.',
    match: (p) => p.endsWith('.js') && p.startsWith('public/'),
  },
];

function groupFiles(g: (typeof groups)[number]): Entry[] {
  return files.filter((f) => g.match(f.path));
}
---
<BaseLayout
  page="source"
  title="Source"
  description={`Browse the full source for the ${site.name} example site.`}
>
  <section class="section">
    <div class="wrap">
      <p class="eyebrow">Source</p>
      <h1>How this site is built</h1>
      <p class="lead">
        Everything below is the live project source, captured when the site was built.
        After you edit a file, run <code>npm run dev</code> or <code>npm run build</code> to see the change.
        Compiled HTML (the files in <code>dist/</code>) is also loaded below when you are viewing this
        page over http:// or https://.
      </p>
    </div>
  </section>

  <section class="section section--alt">
    <div class="wrap source-layout">
      <nav class="source-nav" aria-label="Source sections">
        {groups.map((g) => (
          <a href={`#${g.id}`}>{g.title}</a>
        ))}
        <a href="#compiled-html">Compiled HTML</a>
      </nav>
      <div>
        {groups.map((g) => (
          <div id={g.id}>
            <h2>{g.title}</h2>
            <p class="lead">{g.blurb}</p>
            {groupFiles(g).map((f) => (
              <article class="source-file" id={f.path.replace(/[^\w]+/g, '-')}>
                <header>
                  <h3><code>{f.path}</code></h3>
                  <p class="meta">{f.note}</p>
                </header>
                <pre><code>{f.code}</code></pre>
              </article>
            ))}
          </div>
        ))}

        <div id="compiled-html">
          <h2>Compiled HTML</h2>
          <p class="lead">
            Astro turns the <code>.astro</code> pages into static HTML at build time.
            If you are viewing this page from a local static server (not a raw file:// URL),
            the built homepage is fetched and shown below. You can also open
            <code>dist/index.html</code> in a text editor after <code>npm run build</code>.
          </p>
          <article class="source-file">
            <header>
              <h3><code>dist/index.html</code></h3>
              <p class="meta">Loaded in the browser when possible. This is output, not the file you edit.</p>
            </header>
            <pre><code data-compiled-html>Open this page via npm run preview (or another static server) to load compiled HTML here.</code></pre>
          </article>
        </div>
      </div>
    </div>
  </section>
</BaseLayout>

CSS

One global stylesheet, themed with CSS variables from site.json.

src/styles/global.css

Shared typography, layout, forms, gallery, and components.

/* ========================================================================
   Shared starter styles
   -----------------------------------------------------------------------
   Colors, fonts, and radius come from src/data/site.json, injected as
   CSS variables on <html> by BaseLayout.astro. Edit that file first.
   You can still override anything below.

   No webfonts are loaded (privacy and performance). Display and body
   stacks use system fonts defined in the theme.
   ======================================================================== */

/* --- Reset-ish base --------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Fallbacks in case a theme variable is missing */
  --bg: #f6f3ee;
  --fg: #1c1917;
  --primary: #9a3412;
  --primary-text: #fff;
  --accent: #b45309;
  --muted: #57534e;
  --card: #ffffff;
  --border: #e7e0d6;
  --header-bg: #fffdf9;
  --font-display: Georgia, "Iowan Old Style", Palatino, "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
  --max: 70rem;
  --gutter: clamp(1rem, 3vw, 1.75rem);
  background: var(--bg);
  color: var(--fg);
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link appears on keyboard focus */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.5rem 0.8rem;
  border-radius: 0.4rem;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* Demo notice so nobody mistakes these for real businesses */
.example-banner {
  background: var(--fg);
  color: var(--bg);
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.45rem var(--gutter);
}
.example-banner a { color: inherit; }

/* --- Layout ----------------------------------------------------------- */
.wrap {
  width: min(var(--max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

main { flex: 1 0 auto; }

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.section--alt { background: color-mix(in srgb, var(--card) 80%, var(--bg)); }
.section--primary {
  background: var(--primary);
  color: var(--primary-text);
}
.section--primary a { color: var(--primary-text); }

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.lead { font-size: 1.15rem; color: var(--muted); }

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.split {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 800px) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
  .split--flip { grid-template-columns: 0.9fr 1.1fr; }
  .split--flip > :first-child { order: 2; }
}

/* --- Header / nav ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--header-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.logo:hover { color: var(--primary); }
.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 700;
}

.nav-list {
  display: flex;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-list a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.15rem;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--primary); }
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }

.header-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem 0.55rem;
  color: var(--fg);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  margin: 0.25rem 0;
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 0.75rem var(--gutter) 1rem;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list a { display: block; padding: 0.55rem 0; }
  .header-cta { margin: 0.5rem 0 0; display: block; text-align: center; }
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-text);
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); color: var(--primary-text); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn--light {
  background: var(--card);
  color: var(--fg);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* --- Cards, chips, media ---------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card h3 { margin-bottom: 0.35em; }

.media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.media img { width: 100%; height: 100%; object-fit: cover; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip, .filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.filter-btn.is-active,
.chip--on {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.price {
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.muted, .meta { color: var(--muted); font-size: 0.92rem; }

/* --- Hero variants ---------------------------------------------------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  align-items: center;
}
.hero--full {
  min-height: 80vh;
  color: #fff;
}
.hero--full .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero--full .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero--full .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55)),
    linear-gradient(90deg, rgba(0,0,0,0.45), rgba(0,0,0,0.15));
}
.hero--full .hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 10vw, 8rem) 0;
  max-width: 38rem;
}
.hero--full .eyebrow,
.hero--full .lead { color: rgba(255,255,255,0.86); }
.hero--full h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); color: #fff; }

.hero--split { padding: clamp(2rem, 5vw, 4rem) 0; }
.hero--split h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero--stack { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.hero--stack .hero-media { margin-top: 1.5rem; max-height: 28rem; }

/* --- Forms ------------------------------------------------------------ */
form { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  font: inherit;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  min-height: 1.4em;
  font-weight: 600;
  color: var(--primary);
}
.form-note { font-size: 0.85rem; color: var(--muted); }

/* --- FAQ accordion ---------------------------------------------------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  color: var(--fg);
  padding: 1rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item button::after {
  content: "+";
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
}
.faq-item button[aria-expanded="true"]::after { content: "–"; }
.faq-panel { padding: 0 0 1rem; color: var(--muted); }

/* --- Gallery + lightbox ----------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}
.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
}
.gallery img { width: 100%; height: 14rem; object-fit: cover; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: none;
  place-items: center;
  z-index: 80;
  padding: 1.5rem;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.5rem;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 0.75rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1.2rem;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; }
.lightbox-next { right: 1rem; top: 50%; }

/* --- Tables, hours, lists --------------------------------------------- */
.hours { list-style: none; padding: 0; margin: 0; }
.hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* --- Footer ----------------------------------------------------------- */
.site-footer {
  background: color-mix(in srgb, var(--fg) 94%, var(--primary));
  color: color-mix(in srgb, var(--bg) 90%, white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
[data-theme="dark"] .site-footer {
  background: color-mix(in srgb, var(--card) 40%, #000);
}
.site-footer a { color: inherit; }
.footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-bottom: 2rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}
.credits { font-size: 0.82rem; opacity: 0.9; }
.credits ul { padding-left: 1.1rem; margin: 0.4rem 0 0; }

/* --- Source page ------------------------------------------------------ */
.source-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .source-layout { grid-template-columns: 16rem 1fr; align-items: start; }
}
.source-nav {
  position: sticky;
  top: 5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.source-nav a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}
.source-file {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.source-file header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--card));
}
.source-file h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.source-file pre {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.45;
  background: #161311;
  color: #f3ece6;
  max-height: 32rem;
}
[data-theme="dark"] .source-file pre { background: #0b0b0c; }
.copy-btn { margin-top: 0.4rem; }

/* --- Feature-specific bits -------------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
}
.menu-item, .listing-card, .product-card, .class-row { transition: opacity 0.2s; }
.is-hidden { display: none !important; }

.estimate {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0.4rem 0;
}
.sandbox-flag {
  display: inline-block;
  background: var(--accent);
  color: #111;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
}

.cart-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--card);
}
.metronome {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}
.metronome-pulse {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.metronome-pulse.is-on { background: var(--primary); color: var(--primary-text); }

.membership-card.is-featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

JavaScript

Classic scripts (not modules) so built pages can also run from a simple static server.

public/js/features.js

Interactive features unique to this starter.

/**
 * Practice metronome. Generates a short click with the Web Audio API.
 * No audio files, no uploads, no copyrighted recordings.
 */
(function () {
  "use strict";

  var root = document.querySelector("[data-metronome]");
  if (!root) return;

  var toggle = root.querySelector("[data-metro-toggle]");
  var slider = root.querySelector("[data-bpm]");
  var label = root.querySelector("[data-bpm-label]");
  var pulse = root.querySelector("[data-pulse]");
  var ctx = null;
  var timer = null;
  var running = false;

  function bpm() {
    return Number(slider.value || 80);
  }

  function click() {
    if (!ctx) return;
    var osc = ctx.createOscillator();
    var gain = ctx.createGain();
    osc.type = "square";
    osc.frequency.value = 880;
    gain.gain.value = 0.07;
    osc.connect(gain);
    gain.connect(ctx.destination);
    osc.start();
    osc.stop(ctx.currentTime + 0.05);
    if (pulse) {
      pulse.classList.add("is-on");
      window.setTimeout(function () { pulse.classList.remove("is-on"); }, 80);
    }
  }

  function intervalMs() {
    return 60000 / bpm();
  }

  function start() {
    var AudioCtx = window.AudioContext || window.webkitAudioContext;
    if (!AudioCtx) {
      toggle.textContent = "Audio not supported";
      toggle.disabled = true;
      return;
    }
    ctx = ctx || new AudioCtx();
    if (ctx.resume) ctx.resume();
    running = true;
    toggle.textContent = "Stop";
    click();
    timer = window.setInterval(click, intervalMs());
  }

  function stop() {
    running = false;
    toggle.textContent = "Start";
    if (timer) window.clearInterval(timer);
    timer = null;
  }

  toggle.addEventListener("click", function () {
    if (running) stop();
    else start();
  });

  slider.addEventListener("input", function () {
    if (label) label.textContent = String(bpm());
    if (running) {
      stop();
      start();
    }
  });
  if (label) label.textContent = String(bpm());
})();

public/js/site.js

Shared vanilla JS: menu, forms, accordion, lightbox, filters.

/**
 * Shared front-end behavior for the starter sites.
 *
 * Security notes:
 * - Never assign user input to innerHTML. Status messages use textContent.
 * - Forms do not send data anywhere until you hook up an endpoint
 *   (see the form's comments and the README).
 * - No API keys or secrets belong in this file.
 */
(function () {
  "use strict";

  function ready(fn) {
    if (document.readyState === "loading") {
      document.addEventListener("DOMContentLoaded", fn);
    } else {
      fn();
    }
  }

  ready(function () {
    initYear();
    initHeader();
    initMobileNav();
    initForms();
    initAccordion();
    initLightbox();
    initFilters();
    initCompiledHtml();
  });

  function initYear() {
    var nodes = document.querySelectorAll("[data-year]");
    var year = String(new Date().getFullYear());
    nodes.forEach(function (el) {
      el.textContent = year;
    });
  }

  function initHeader() {
    var header = document.querySelector("[data-header]");
    if (!header) return;
    var onScroll = function () {
      header.classList.toggle("is-scrolled", window.scrollY > 8);
    };
    onScroll();
    window.addEventListener("scroll", onScroll, { passive: true });
  }

  function initMobileNav() {
    var toggle = document.querySelector("[data-nav-toggle]");
    var nav = document.querySelector("#site-nav");
    if (!toggle || !nav) return;

    var close = function () {
      nav.classList.remove("is-open");
      toggle.setAttribute("aria-expanded", "false");
    };
    var open = function () {
      nav.classList.add("is-open");
      toggle.setAttribute("aria-expanded", "true");
    };

    toggle.addEventListener("click", function () {
      if (nav.classList.contains("is-open")) close();
      else open();
    });
    document.addEventListener("keydown", function (e) {
      if (e.key === "Escape") close();
    });
    nav.querySelectorAll("a").forEach(function (link) {
      link.addEventListener("click", close);
    });
  }

  /**
   * Demo forms: validate, ignore honeypot spam, and show a thank-you
   * message without submitting anywhere.
   *
   * To go live, set the form's action to a Formspree (or similar) URL
   * or to your own HTTPS endpoint, remove the preventDefault submit
   * handler below (or only preventDefault when the honeypot is filled),
   * and serve the site over HTTPS.
   */
  function initForms() {
    document.querySelectorAll("form[data-demo-form]").forEach(function (form) {
      form.addEventListener("submit", function (e) {
        e.preventDefault();

        var honeypot = form.querySelector("[name='company_website']");
        if (honeypot && honeypot.value) {
          return;
        }

        if (typeof form.reportValidity === "function" && !form.checkValidity()) {
          form.reportValidity();
          return;
        }

        var status = form.querySelector("[data-form-status]");
        var rawName = "";
        var nameField = form.querySelector("[name='name']");
        if (nameField && nameField.value) {
          rawName = String(nameField.value).slice(0, 80);
        }
        var message =
          "Thanks" +
          (rawName ? ", " + rawName : "") +
          ". This is a demo form — nothing was sent. Connect Formspree or your own endpoint to accept real inquiries. See the README.";
        if (status) {
          status.textContent = message;
        }
        form.reset();
      });
    });
  }

  function initAccordion() {
    document.querySelectorAll("[data-accordion]").forEach(function (root) {
      root.querySelectorAll("button[aria-controls]").forEach(function (btn) {
        var panel = document.getElementById(btn.getAttribute("aria-controls"));
        if (!panel) return;
        btn.addEventListener("click", function () {
          var open = btn.getAttribute("aria-expanded") === "true";
          btn.setAttribute("aria-expanded", open ? "false" : "true");
          if (open) {
            panel.setAttribute("hidden", "");
          } else {
            panel.removeAttribute("hidden");
          }
        });
      });
    });
  }

  function initLightbox() {
    var buttons = Array.prototype.slice.call(
      document.querySelectorAll("[data-lightbox]")
    );
    if (!buttons.length) return;

    var dialog = document.createElement("div");
    dialog.className = "lightbox";
    dialog.setAttribute("role", "dialog");
    dialog.setAttribute("aria-modal", "true");
    dialog.setAttribute("hidden", "");

    var img = document.createElement("img");
    img.alt = "";
    var caption = document.createElement("p");
    caption.className = "lightbox-caption";
    var closeBtn = document.createElement("button");
    closeBtn.type = "button";
    closeBtn.className = "lightbox-close";
    closeBtn.setAttribute("aria-label", "Close image");
    closeBtn.textContent = "×";
    var prevBtn = document.createElement("button");
    prevBtn.type = "button";
    prevBtn.className = "lightbox-prev";
    prevBtn.setAttribute("aria-label", "Previous image");
    prevBtn.textContent = "‹";
    var nextBtn = document.createElement("button");
    nextBtn.type = "button";
    nextBtn.className = "lightbox-next";
    nextBtn.setAttribute("aria-label", "Next image");
    nextBtn.textContent = "›";

    var frame = document.createElement("div");
    frame.appendChild(img);
    frame.appendChild(caption);
    dialog.appendChild(closeBtn);
    dialog.appendChild(prevBtn);
    dialog.appendChild(nextBtn);
    dialog.appendChild(frame);
    document.body.appendChild(dialog);

    var index = 0;

    function show(i) {
      index = (i + buttons.length) % buttons.length;
      var btn = buttons[index];
      var src = btn.getAttribute("data-src") || "";
      var alt = btn.getAttribute("data-alt") || "";
      img.src = src;
      img.alt = alt;
      caption.textContent = alt;
      dialog.classList.add("is-open");
      dialog.removeAttribute("hidden");
      closeBtn.focus();
    }

    function hide() {
      dialog.classList.remove("is-open");
      dialog.setAttribute("hidden", "");
      img.removeAttribute("src");
    }

    buttons.forEach(function (btn, i) {
      btn.addEventListener("click", function () {
        show(i);
      });
    });
    closeBtn.addEventListener("click", hide);
    prevBtn.addEventListener("click", function () { show(index - 1); });
    nextBtn.addEventListener("click", function () { show(index + 1); });
    dialog.addEventListener("click", function (e) {
      if (e.target === dialog) hide();
    });
    document.addEventListener("keydown", function (e) {
      if (!dialog.classList.contains("is-open")) return;
      if (e.key === "Escape") hide();
      if (e.key === "ArrowLeft") show(index - 1);
      if (e.key === "ArrowRight") show(index + 1);
    });
  }

  /**
   * Generic filter: buttons with [data-filter] and [data-filter-group]
   * hide siblings of the group that don't match a data-* attribute.
   * Used by menus, class lists, product grids, and listings.
   */
  function initFilters() {
    document.querySelectorAll("[data-filter-group]").forEach(function (group) {
      var targetSel = group.getAttribute("data-filter-target");
      if (!targetSel) return;
      var items = document.querySelectorAll(targetSel);
      var buttons = group.querySelectorAll("[data-filter]");

      buttons.forEach(function (btn) {
        btn.addEventListener("click", function () {
          buttons.forEach(function (b) {
            b.classList.remove("is-active");
            b.setAttribute("aria-pressed", "false");
          });
          btn.classList.add("is-active");
          btn.setAttribute("aria-pressed", "true");
          var key = btn.getAttribute("data-filter-key") || "category";
          var value = btn.getAttribute("data-filter") || "all";
          items.forEach(function (item) {
            var hay = (item.getAttribute("data-" + key) || "").toLowerCase();
            var show = value === "all" || hay.indexOf(value.toLowerCase()) !== -1;
            item.classList.toggle("is-hidden", !show);
          });
        });
      });
    });
  }
  /**
   * On the source page, try to fetch the compiled homepage HTML when we are
   * served over HTTP(S). The result is shown with textContent only.
   */
  function initCompiledHtml() {
    var slot = document.querySelector("[data-compiled-html]");
    if (!slot) return;
    if (location.protocol !== "http:" && location.protocol !== "https:") return;
    fetch("index.html")
      .then(function (res) {
        if (!res.ok) throw new Error("Could not load index.html");
        return res.text();
      })
      .then(function (text) {
        slot.textContent = text;
      })
      .catch(function () {
        slot.textContent =
          "Compiled HTML could not be loaded. Open dist/index.html after npm run build.";
      });
  }

})();

Compiled HTML

Astro turns the .astro pages into static HTML at build time. If you are viewing this page from a local static server (not a raw file:// URL), the built homepage is fetched and shown below. You can also opendist/index.html in a text editor after npm run build.

dist/index.html

Loaded in the browser when possible. This is output, not the file you edit.

Open this page via npm run preview (or another static server) to load compiled HTML here.