Commit Graph
9 Commits
Author SHA1 Message Date
tiennm99 75441d650a feat: add touch support, cooldown bar, and cap batch size
- Cap MAX_BATCH_SIZE to 32 (was 256) to limit burst grief damage
- Add touch handlers: pinch-zoom, drag-pan, long-press to place pixel
- Add credit bar visualization with fill animation and color states
  (yellow while regenerating, green when full)
2026-04-16 16:52:00 +07:00
tiennm99 7793163e0b fix: critical Upstash API and UX issues from second review
- Fix setPixels() to use Upstash bitfield builder (.set().exec())
  instead of flat array (would throw at runtime)
- Fix getFullCanvas() to use GETRANGE for reliable binary retrieval
  instead of GET which may mangle BITFIELD data
- Fix getUserId hash overflow: use >>> 0 instead of Math.abs()
- Add client-side credit regeneration timer (1/sec)
- Add exponential backoff to WebSocket reconnection (1s → 30s cap)
2026-04-16 16:37:07 +07:00
tiennm99 b3b4916263 fix: address code review findings
- Fix WebSocket reconnection logic in App.svelte (was a no-op)
- Remove spoofable x-forwarded-for fallback, use cf-connecting-ip only
- Wrap Durable Object broadcast in try/catch to prevent place failures
- Cache OffscreenCanvas to avoid re-allocation every render frame
2026-04-16 16:27:35 +07:00
tiennm99 2ccf1c9779 refactor: migrate from Next.js/Vercel to Svelte/Hono/Cloudflare Workers
Replace Next.js + SSE with Svelte frontend + Hono API + Durable Objects
WebSocket on Cloudflare Workers. Single worker serves static assets and
API routes. Native WebSocket replaces SSE polling for real-time updates.
17kb gzipped client bundle vs 90kb+ React runtime.
2026-04-16 16:23:27 +07:00
tiennm99 3beaa9d43f feat: implement core pixel canvas with real-time updates
Next.js App Router + Upstash Redis BITFIELD for 2048x2048 canvas.
- 32-color palette (5-bit encoding) from rplace.live
- Batch pixel placement API (up to 256 pixels per request)
- Stackable credit rate limiting via Redis Lua script
- SSE real-time broadcasting via Redis sorted set
- HTML5 Canvas frontend with zoom/pan and color picker
2026-04-16 15:56:20 +07:00
tiennm99 1c6b2edcff add implementation plan for rplace pixel canvas
7-phase plan: setup, canvas backend (Redis BITFIELD), rate limiting
(stackable credits), SSE real-time updates, frontend canvas, auth, deploy.
2026-04-16 15:24:55 +07:00
tiennm99 62188d26d2 update references and add credits to README
Remove unfetchable URLs (redditinc, reddit.com, tejash.dev, rplace.live).
Add credits section to README attributing all referenced projects.
2026-04-16 15:24:50 +07:00
tiennm99 9bdde946a0 add r/place reference links and resources
Curated collection of official post-mortems, technical walkthroughs,
open-source implementations, and live instances for r/place research.
2026-04-16 14:43:23 +07:00
tiennm99 8ca80531cc Initial commit 2026-04-16 14:36:24 +07:00