# LoftMini — mini-game lobby

Public site brand: **LoftMini** / **Loft Mini** ([loftmini.com](https://loftmini.com)). Browser lobby with two HTML5 games. Google AdSense Auto ads use publisher ID **`ca-pub-9110998668113231`**.

Worker name remains `spark-catch` (Cloudflare project id); the site chrome and URLs for users are LoftMini.

## Games

| Game | Page | Play |
| --- | --- | --- |
| **Spark Catch** | [`spark-catch.html`](spark-catch.html) | Tap/click falling sparks |
| **Neon Snake** | [`neon-snake.html`](neon-snake.html) | Classic grid snake; arrows, WASD, swipe, or on-screen pads |

Lobby homepage: [`index.html`](index.html).

## Open locally

1. From the repo root:

   ```bash
   cd spark-catch
   ```

2. Open `index.html` in a modern browser, or serve the folder:

   ```bash
   python3 -m http.server 8765
   ```

   Then visit `http://localhost:8765`.

3. Pick a game from the lobby. After game over you can submit an optional name to the leaderboard and play again.

Fonts load from Google Fonts when online; games still run offline with a fallback system font.

## Advertising

Each public page loads Google AdSense Auto ads:

```html
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9110998668113231"
     crossorigin="anonymous"></script>
```

Publisher file [`ads.txt`](ads.txt), served at `https://loftmini.com/ads.txt`:

```
google.com, pub-9110998668113231, DIRECT, f08c47fec0942fa0
```

`ads.txt` uses `pub-`, not `ca-pub-`. Sitemap: [`sitemap.xml`](sitemap.xml). Contact: [windmid39@gmail.com](mailto:windmid39@gmail.com).

In AdSense **Add site**, paste the public root (not a subpath): **`https://loftmini.com`**. Policy pages: [`about.html`](about.html), [`privacy.html`](privacy.html), [`contact.html`](contact.html), [`terms.html`](terms.html).

Do not reward players for clicking ads. Do not replace this publisher ID with a different one.

## Leaderboard

Game-over overlays include an optional name + submit to `/api/score` and a top-10 list from `/api/leaderboard` (D1). The Worker binds D1 `loftmini-db` as `DB` (`database_id` `8025e69c-c208-4fb2-9091-8c9150934a5d`); see the root [README](../README.md#d1-leaderboard). Local `python3 -m http.server` has no API — submit shows offline until deployed.

## Files

- `index.html` — LoftMini lobby homepage (two game links)
- `spark-catch.html` — Spark Catch play UI
- `neon-snake.html` — Neon Snake play UI
- `game.js` — Spark Catch gameplay
- `neon-snake.js` — Neon Snake gameplay
- `leaderboard.js` — score submit + top-10 fetch
- `about.html` — About
- `privacy.html` — Privacy policy
- `contact.html` — Contact (`windmid39@gmail.com`)
- `terms.html` — Terms
- `ads.txt` — AdSense ads.txt
- `sitemap.xml` — sitemap for loftmini.com
- `favicon.ico`, `favicon.svg`, `favicon.png` — site icon
- `styles.css` — shared layout and lobby
- `README.md` — this file

These files live in the Worker `[assets]` directory (`./spark-catch`), so `/ads.txt`, `/sitemap.xml`, and `/favicon.ico` are served with the HTML.
