Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the
- `site.css`: styles shared by the home, Web Development Projects and Productivity pages
- `theme.js`: the site's light/dark switch, with three choices: Auto (follow the device's light or dark mode, the default), Light and Dark. Loaded with a plain `<script src="/theme.js"></script>` in the `<head>`, just before the stylesheet (not deferred, so it runs before the page is drawn and there's no flash), by every page that uses `site.css` and nothing else of its own for colours (home, Web Development Projects, Productivity, Engineering Projects, Marketplace, About, Project Daedalus, the Docket, Prompted, Boxed and Hype Cycle Exchange guides), by Docket and Prompted, the Back Room page, the phone page and the showcase landing page (which has no top bar, so no switch; it follows the choice made on any other page). **The switch** is one small button showing the current choice (half circle, sun or moon) that opens a menu with the three; theme.js puts it at the end of the page's `.topbar` by itself (its menu opens leftwards, or rightwards when the top bar has wrapped it to the left edge, as on a phone held sideways), right after the Sign in button (so `account/` is unchanged), which makes it the same place on every page with the top bar, the Back Room included; any other empty element with `data-theme-switch` is filled in too (the phone page has one in its header, since it has no top bar). **Storage:** localStorage `theme` (`light` or `dark`; removed for Auto), so the choice carries to every page; pages already open in other tabs, and pages inside frames (the home page's phone-version frame), follow a change straight away through the `storage` event. Nothing is stored online. **How the CSS follows it:** an explicit choice puts `data-theme="light"` or `data-theme="dark"` on `<html>`, and Auto leaves it off. Each dark-mode block is written twice: inside `@media (prefers-color-scheme: dark)` as `:root:not([data-theme="light"])` (Auto, or Dark on a dark device), and again as `:root[data-theme="dark"]` (Dark on a light device). That's how `site.css`, `games.css`, Docket and Prompted do it; the phone page is dark by itself, so it does the opposite with its light look. A new page that uses `site.css` only needs the script line; a page with its own dark colours needs both blocks too. The shared Back Room scripts that add their own styles (party.js, avatar.js, miles.js, leaderboard.js, news.js, social.js, account-nudge.js, events.js, feedback.js and the rest) take their colours from the page's variables, so they follow without changes. `SiteTheme.get()` / `.set('auto'|'light'|'dark')` / `.wire(el)`, and a `site-theme` event on `window` after a change (seasons.js redoes its seasonal tint on it). **Pages that don't follow it** keep their own look: every game (each has its own fixed look, light or dark), the Daily Puzzles page, the admin page, and the pages that follow the device with their own CSS only: Boxed, Hype Cycle Exchange, the analytics dashboard and the privacy policy.
- `offline.js`, `sw.js`, `offline.html`: offline mode (version 2). `offline.js` (a deferred `<script>` on the home, `projects/`, `productivity/` and `engineering/` pages, the Back Room page and the phone page) registers `sw.js`, one service worker for the whole site and the installed app. Every page, game and file of the site that a browser opens is kept in its Cache Storage (`site-v2`), so it opens again on that device with no internet; ahead of time it only saves the app shell (`CORE` in `sw.js`: home page, `offline.html`, manifest, icons, `site.css`, `theme.js`, `install.js`). The site's own files are fetched network-first, exactly as without the worker, and the saved copy is used only when the network fails, so online players always get the newest version and nothing needs bumping when a game changes. Answers go to the page as soon as they start arriving; the copy is saved in the background (`event.waitUntil`) and skipped when its ETag / Last-Modified / size matches the saved one, so big games don't load slower or get rewritten every visit. Versioned libraries (cdnjs, jsDelivr, Firebase's SDK on gstatic) and Google Fonts files are served from the cache first. Never touched, always straight to the network: the game relay (Colyseus Cloud; WebSockets never pass through a service worker, and its https matchmaking isn't on the CDN list), `/api/` (Marketplace, wallet, checkout), Firebase/Firestore, Google sign-in, analytics and ads. On every visit `offline.js` sends the worker the files that page already loaded (it skips ones it has, one at a time), so the first page works offline right away. While the device is offline, it shows a small "Offline" note at the bottom (top-level pages only) and fades the Back Room's game cards (`a.btn.primary` Play links) and the phone page's tiles (`.tile[data-path]`) for games not saved on that device, with a "Not saved offline" tag; tapping one says to play it once with internet instead of opening it. A page that isn't saved shows `offline.html` (or a built-in note), never the browser's own error. A game's practice/bot modes then work as normal; its online modes just can't connect until the internet is back. Bump `VERSION` in `sw.js` only to wipe every device's saved files.
- `manifest.webmanifest`, `install.js`, `icons/`: the site as an installable app (named "ascoding11"). The home, `projects/`, `productivity/` and `engineering/` pages link `/manifest.webmanifest` (plus the favicon, `theme-color` and Apple touch icon from `icons/`), so Chrome and Edge show their install icon in the address bar there and Android offers Add to Home screen. The app's `id`, `start_url` and `scope` are all `/`: it opens the home page in its own window, keeps the whole site in that window, and works offline through the same `sw.js` (registered by `offline.js` on the home page). It is a separate app from the phone page's "Arjun's Games" (`e63334287a3deaa3/m/manifest.webmanifest`, whose `id` is its own start address), so both can be installed. `install.js` (deferred `<script>`, home page only) waits for the browser's `beforeinstallprompt` event and only then adds an "Install app" button (`#getapp`, a `.btn`) under the intro in the page's `<header>`, since the top bar is full on computers; clicking it opens the browser's install prompt. It never shows in Safari or Firefox, once installed, or inside the app. `icons/app.svg` (rounded) and `icons/app-maskable.svg` (full-bleed, for Android's shaped icons) are the sources; the PNGs were made from them with `rsvg-convert` (192 and 512, maskable 512, Apple 180, favicon 32). Change the SVGs and remake the PNGs to change the icon.
- `manifest.webmanifest`, `install.js`, `icons/`: the site as an installable app (named "ascoding11"). The home, `projects/`, `productivity/` and `engineering/` pages link `/manifest.webmanifest` (plus the favicon, `theme-color` and Apple touch icon from `icons/`), so Chrome and Edge show their install icon in the address bar there and Android offers Add to Home screen. The app's `id`, `start_url` and `scope` are all `/`: it opens the home page in its own window, keeps the whole site in that window, and works offline through the same `sw.js` (registered by `offline.js` on the home page). It is a separate app from the phone page's "Arjun's Games" (`e63334287a3deaa3/m/manifest.webmanifest`, whose `id` is its own start address), so both can be installed. `install.js` (deferred `<script>`, home page only) waits for the browser's `beforeinstallprompt` event and only then adds an "Install app" button (`#getapp`, a `.btn`) under the intro in the page's `<header>`, since the top bar is full on computers; clicking it opens the browser's install prompt. It never shows in Safari or Firefox, once installed, or inside the app. `icons/app.svg` (rounded) and `icons/app-maskable.svg` (full-bleed, for Android's shaped icons) are the sources; the PNGs were made from them with `rsvg-convert` (192 and 512, maskable 512, Apple 180, favicon 32). Change the SVGs and remake the PNGs to change the icon. `/favicon.ico` (16, 32 and 48 px, made from `icons/app-512.png` with Python's Pillow) is the icon browsers ask for by themselves on pages that don't link one, such as the Back Room games; remake it too when the icon changes. **Share previews and icons on public pages:** every public page in `sitemap.xml` (plus `showcase/`) has a `<meta name="description">`, a canonical link, Open Graph tags (`og:type`, `og:site_name`, `og:title`, `og:description`, `og:url` equal to the canonical, `og:image`) and a `twitter:card`, and links the three favicon lines from `icons/`. Pages with a `preview.jpg` (1920 × 1200) use it as `og:image` with `summary_large_image`; About, Contact and the Marketplace use `icons/app-512.png` with `summary`. When adding a public page, copy these from a page like `productivity/index.html`. Never add them to the Back Room.
- `.claude/skills/`: two skills that Claude Code picks up by itself when working in this repo (nothing on the website loads them). `game-graphics` is a method for making a game look better (look at screenshots, choose a direction, fix colour and light before adding effects, keep a cheaper version for slow machines), with `scripts/shots.js` for before-and-after screenshots at laptop and phone sizes. `game-performance` is a method for making a game faster without changing how it looks or plays (measure, fix the biggest cost, measure again), with `scripts/perf_probe.js`, which reports frame times, script time, draw calls, triangles, canvas calls, memory churn and page weight for any game here and compares two runs. Both scripts need Node and Playwright and are only for development. The games' own rules in `CLAUDE.md` and this file come first.
- `.claude/agents/`: one Claude Code subagent per game (69: the two public games, every Back Room game, the daily puzzles, and the archived and preview games), named after the game's current display name (for example `driftfall` for `drop-zone/`, `midnight-ops` for `ironveil/`, `game-2048` for `2048/`). Each one tells Claude where that game's files, README entry, card and phone row are, what it uses (three.js, Firebase rooms and prefix, relay, netsmooth, stats, keybinds, ads, daily storage), the rules from `CLAUDE.md` that apply to it, how to test it and which skills fit. Nothing on the website loads them. They are generated by `.claude/scripts/gen_game_agents.py` from this README, the Back Room cards, the phone page, `netrelay-config.js` and each game's code; rerun `python3 .claude/scripts/gen_game_agents.py` after adding, renaming or archiving a game (hand-set lists at the top of the script cover archived games, genre skills and games that share data folders).
- `hype-cycle-exchange/`: Hype Cycle Exchange, a live classroom stock-market game (Firebase)
Expand Down
5 changes: 5 additions & 0 deletions about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
<meta property="og:title" content="About Arjun&#x27;s Projects">
<meta property="og:description" content="About Arjun&#x27;s Projects: free browser games for the classroom, study tools for students, and engineering projects, built by hand by Arjun. Who makes it, how it is built, and how to get in touch.">
<meta property="og:url" content="https://ascoding11.github.io/about/">
<meta property="og:image" content="https://ascoding11.github.io/icons/app-512.png">
<meta name="twitter:card" content="summary">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap">
<script src="/theme.js"></script> <!-- Auto / Light / Dark, before the page is drawn (see README) -->
<link rel="stylesheet" href="../site.css">
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
7 changes: 7 additions & 0 deletions boxed/guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@
<meta property="og:title" content="How to Prepare for the AMC 10 and AIME – Practice Guide">
<meta property="og:description" content="How the AMC 10 and AIME work, when to guess and when to leave a blank, which topics matter, and a weekly practice routine using real past problems in Boxed.">
<meta property="og:url" content="https://ascoding11.github.io/boxed/guide/">
<meta property="og:image" content="https://ascoding11.github.io/boxed/preview.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1200">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap">
<script src="/theme.js"></script> <!-- Auto / Light / Dark, before the page is drawn (see README) -->
<link rel="stylesheet" href="../../site.css">
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
8 changes: 7 additions & 1 deletion boxed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<meta property="og:title" content="Boxed – Real AMC 10 &amp; AIME Problems, Daily and Live">
<meta property="og:description" content="Solve real AMC 10 and AIME problems: a daily set of five, practice by difficulty, or a live game for your math team.">
<meta property="og:url" content="https://ascoding11.github.io/boxed/">
<meta name="twitter:card" content="summary">
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="https://ascoding11.github.io/boxed/preview.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1200">
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down Expand Up @@ -248,6 +251,9 @@
}

</style>
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
5 changes: 5 additions & 0 deletions contact/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<meta property="og:title" content="Contact Arjun&#x27;s Projects">
<meta property="og:description" content="Get in touch with Arjun about the site: report a bug, suggest an idea, ask a question, or ask for your saved data to be deleted.">
<meta property="og:url" content="https://ascoding11.github.io/contact/">
<meta property="og:image" content="https://ascoding11.github.io/icons/app-512.png">
<meta name="twitter:card" content="summary">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap">
Expand All @@ -37,6 +39,9 @@
.cf-done p{margin:0 0 10px}
.cf-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
</style>
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
4 changes: 4 additions & 0 deletions daedalus/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<meta property="og:description" content="A compact one-stick Bluetooth game controller designed to be built in a batch of 30: parts, wiring, firmware, circuit board, case, costs and honest trade-offs.">
<meta property="og:url" content="https://ascoding11.github.io/daedalus/">
<meta property="og:image" content="https://ascoding11.github.io/daedalus/preview.jpg">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap">
Expand Down Expand Up @@ -172,6 +173,9 @@
.wb .wb-foot{color:var(--bd);font-size:13.5px;margin:12px 0 0}
@media (max-width:860px){.wb .wb-steps{display:none}.wb-two{grid-template-columns:minmax(0,1fr)}.wb-head h2{font-size:21px}.wb-panel{padding:12px}.wb-head{padding:14px 12px 0}}
</style>
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
7 changes: 7 additions & 0 deletions docket/guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@
<meta property="og:title" content="How to Plan Your Study Time Around Canvas – Docket Guide">
<meta property="og:description" content="A simple way to turn Canvas due dates into a week-by-week study plan: plan sessions instead of assignments, estimate honestly, spread big work out, and re-plan when things change.">
<meta property="og:url" content="https://ascoding11.github.io/docket/guide/">
<meta property="og:image" content="https://ascoding11.github.io/docket/preview.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1200">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap">
<script src="/theme.js"></script> <!-- Auto / Light / Dark, before the page is drawn (see README) -->
<link rel="stylesheet" href="../../site.css">
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
3 changes: 3 additions & 0 deletions docket/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@
.lvl button{min-width:36px;height:36px;border-radius:8px;border:1px solid var(--line);background:var(--panel-2);cursor:pointer;font-family:var(--mono);font-size:13px;font-weight:600;color:var(--ink-2)}
.lvl button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--ground)}
</style>
<link rel="icon" href="/icons/app.svg" type="image/svg+xml">
<link rel="icon" href="/icons/favicon-32.png" type="image/png" sizes="32x32">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
</head>
<body>
<div class="wrap">
Expand Down
Loading
Loading