You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f4deb26
Browse filesBrowse the repository at this point in the historyBrowse files
- New manifest.webmanifest ("Arjun's Projects", opens / in its own window) and app icons in icons/
- Home, projects/, productivity/ and engineering/ link the manifest, favicon and theme-color, so Chrome/Edge show their install icon
- install.js adds an "Install app" button under the home page intro when the browser can install it
- README section and What's new 1.37 (with Spanish)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZY4GasCGuNH5aEBhm2jiT
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the
11
11
- `site.css`: styles shared by the home, Web Development Projects and Productivity pages
12
12
- `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.
13
13
- `offline.js`, `sw.js`, `offline.html`: offline mode. `offline.js` (a deferred `<script>` on the home page, the Back Room page and the phone page) registers `sw.js`, a service worker for the whole site. Every page, game and file of the site that a browser opens is kept in its Cache Storage (`site-v1`), so it opens again on that device with no internet; nothing is downloaded ahead of time except `/` and `offline.html` (shown for a page that isn't saved yet). The site's own files are fetched network-first, exactly as before, and the cached copy is used only when the network fails, so online players always get the newest version and nothing needs bumping when a game changes. Versioned libraries (cdnjs, jsDelivr, Firebase's SDK on gstatic) and Google Fonts files are served from the cache first. Never cached, always straight to the network: `/api/` (Marketplace, wallet, checkout), Firebase/Firestore traffic, Google sign-in, analytics and ads, so online play, leaderboards and purchases are never stale. On the first visit `offline.js` sends the worker the files that page already loaded, so the 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. 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 cache. With the worker in place, the phone page (which has `m/manifest.webmanifest`) is also installable as an app.
14
+
- `manifest.webmanifest`, `install.js`, `icons/`: the site as an installable app ("Arjun's Projects", short name "Arjun"). 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.
14
15
- `.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.
15
16
- `hype-cycle-exchange/`: Hype Cycle Exchange, a live classroom stock-market game (Firebase)
16
17
- `boxed/`: Boxed, a competition math game with real AMC 10 and AIME problems: a Daily five, Practice, and live multiplayer games (Firebase, same project and Firestore rules as Hype Cycle Exchange; games are stored in `games` with `kind: "math"`). The page holds only contest names, problem numbers, official answers and a topic tag per problem (Algebra, Geometry, Number Theory, Counting & Probability); the problem text is loaded from the AoPS Wiki API while playing (it asks `artofproblemsolving.com/wiki/api.php` and `wiki.artofproblemsolving.com/wiki/api.php` at once (6-second limit), stops asking for the rest of the visit if both are blocked, and if a contest page can't be read it loads that problem's own page; it reads both the older page layout and newer MediaWiki layouts that wrap sections in `<section>`; failures are logged to the console as `Boxed: AoPS Wiki load failed`). If the wiki doesn't answer, AIME problems (not AMC 10) load from public Hugging Face datasets through `datasets-server.huggingface.co` (`gneubig/aime-1983-2024` and `di-zhang-fdu/AIME_1983_2024` up to 2024, `AI-MO/aimo-validation-aime` for 2022–2024, `MathArena/aime_<year>_<I|II>`, `MathArena/aime_<year>` and `math-ai/aime<yy>` for 2025 on); a row is only used when its answer matches Boxed's key, the LaTeX is drawn with KaTeX (loaded from cdnjs only when needed), `[asy]` diagrams are replaced with a link to AoPS, and full results are cached in localStorage as `boxed.hf1.<contest>`. When a problem can't be shown, the sheet links to it on LIVE by Po-Shen Loh first (`liveURL`: `past-contests/amc10/<year><A|B>` or `aime/<year><I|II>`, with the 2021 Fall contests as `2021C`/`2021D`), then the AoPS Wiki; Boxed only links to LIVE and never loads its pages
Copy file name to clipboardExpand all lines: e63334287a3deaa3/news.js
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,12 @@
85
85
*/
86
86
(function(){
87
87
varNEWS=[
88
+
{date: '2026-11-20',version: '1.37',title: 'Install the site as an app',kind: 'feature',
89
+
items: [
90
+
'You can now install the site as an app in Chrome (and Edge, and Chrome on Android): open the home page and click Install app under the intro, or the install icon at the right of the address bar.',
91
+
'It opens in its own window with its own icon, like any other app on your computer, and you can pin it to the taskbar or dock.',
92
+
'Everything works the same inside it: sign in, the Back Room code, online games and offline play.'
93
+
]},
88
94
{date: '2026-11-20',version: '1.36',title: 'Movi: rank your movies',kind: 'feature',
89
95
tags: ['Movi'],items: [
90
96
'Movi is on the site now (Web Development Projects): rank every movie you\'ve seen by picking which of two you liked more, and each one gets a score out of 10.',
0 commit comments