aboutsummaryrefslogtreecommitdiffstats
path: root/build.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-10 22:51:56 -0700
committerAdam Soltys <[email protected]>2026-09-10 22:51:56 -0700
commit82cd8da7f5ab285b3a91f7284fb8d845400012ca (patch)
treeebf9d6d638ba110ff1e17624148ef7d9ac7412b5 /build.js
parentac675185e362930f2086e01ab578fdd3423e4c79 (diff)
downloadcoinosv3-82cd8da7f5ab285b3a91f7284fb8d845400012ca.tar.gz
coinosv3-82cd8da7f5ab285b3a91f7284fb8d845400012ca.zip
Ship the punks at the size we actually draw them.
The art is 240x240 (20KB each, 1.5MB for the set) because that's what a punk published as someone's nostr picture should be — but the circles the app draws are 18 to 64px, so a new wallet with nothing cached was fetching eight times the pixels it could show, one request per face. punks-sm carries a 128px copy of each: 4KB instead of 20KB, indistinguishable at 64px. Small circles and the wizard's picker tiles load those; only the 64px profile avatar and the value the wizard publishes stay full-size. The bigger win is that a punk picture is our own art wherever it turns up. Everyone who keeps the default publishes v3.coinos.io/punks/N.webp as their nostr picture, so those faces now paint straight off disk at the size being drawn — no request, no thumbnail to make, and no broken circle when the legacy coinos.io copies 502 (which they do for a third of the set). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019mrt228Upn9nNCwGixzSLx
Diffstat (limited to 'build.js')
-rw-r--r--build.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/build.js b/build.js
index 0620874..cdc54f5 100644
--- a/build.js
+++ b/build.js
@@ -472,9 +472,13 @@ if (import.meta.main) {
if (await Bun.file('static/coinos.apk').exists()) {
await Bun.write('dist/coinos.apk', Bun.file('static/coinos.apk'));
}
- // default avatars, self-hosted since coinos.io's copies are half-broken
+ // default avatars, self-hosted since coinos.io's copies are half-broken.
+ // punks-sm carries a 128px copy of each: the art is 240px because that's
+ // what a punk published as someone's nostr picture should be, but the
+ // circles the app draws are 18-64px and shouldn't pay for the rest.
const { readdirSync } = await import('node:fs');
- for (const f of readdirSync('static/punks')) await Bun.write('dist/punks/' + f, Bun.file('static/punks/' + f));
+ for (const d of ['punks', 'punks-sm'])
+ for (const f of readdirSync('static/' + d)) await Bun.write(`dist/${d}/${f}`, Bun.file(`static/${d}/${f}`));
const kb = (Buffer.byteLength(html) / 1024).toFixed(0);
const jkb = (Buffer.byteLength(rawJs) / 1024).toFixed(0);