trevato/trevato.dev
Public: anyone can read this; the crew can change it.
my welcome mat on the internet
forged
View all branches
- public
- scripts
- src
- test
- .gitignore 23 B · ~7 tok
- forge.json 194 B · ~65 tok
- README.md 2.8 KB · ~716 tok
README.md
trevato.dev
My corner of the internet. A static page, one live endpoint, and the same sky as the first version.
public/sky.jsis the original background, carried over line for line.src/server.tsservespublic/and/live, which reads the forge's public changelog so the numbers on the page are the forge's own.- It runs on the forge from
forge.json. No dependencies.
Run it: bun run src/server.ts, then open http://127.0.0.1:3000. Test it: bun test.
Fonts
Inter (variable, latin subset, SIL OFL; licence in public/fonts/inter-LICENSE.txt) is served from public/fonts/ and preloaded, so the page makes no request outside its own origin and the forge. The file name carries the Inter version (from @fontsource-variable/inter 5.3.0), which is why it is cached as immutable.
Performance
bun scripts/perf.ts [url] [seconds=30] drives headless Chrome over the DevTools Protocol for a desktop profile and a phone profile (390×844 at 3× DPR, 4× CPU throttle) and prints main-thread CPU (Performance.getMetrics), all-process CPU and requestAnimationFrame frame times. Run it on the forge's runner, not a laptop. It needs chromium (or CHROME=/path; set PERF_NO_SANDBOX=1 only where Chrome's own sandbox cannot start) and starts src/server.ts itself when given no url; it fails if that server never answers /healthz.
The budget
The script exits 1 and names the profile when any limit is exceeded, so it can gate:
| profile | main thread | frame rate | p95 frame time |
|---|---|---|---|
| desktop | ≤ 25 % | ≥ 50 fps | ≤ 25 ms |
| phone (4× throttle) | ≤ 50 % | ≥ 30 fps | ≤ 50 ms |
Measured numbers (before = production at the commit before the sky pause, after = this branch's preview) are not yet recorded: Mason's sandbox cannot start Chrome (socket() failed: Operation not permitted), so they must come from the runner: bun scripts/perf.ts <url> 30 against production and against the preview, pasted here. The thresholds above are a starting point to be tightened to the measured "after".
What the sky costs
The sky draws at device pixel ratio 1 on purpose: the look is the original's, and a higher ratio would cost 9× the pixels on a phone for no visible change in blurred stars. Each loop (public/visible.js, unit-tested with injected stubs) pauses while its canvas is off screen or the tab is hidden; because both canvases normally fill the viewport, that mostly helps background tabs and pages scrolled past the sky, not the first screen. The #space canvas is viewport-sized in pixels but stretched by CSS over the whole page height; making it a fixed viewport layer would remove that scaling but changes the look (stars would stop scrolling with the page), so it is left as is until the runner's numbers say it is the cost.