Menu

Zero-Dependency 1080x1350 Shareable Cards in Pure HTML5 Canvas (Path2D + Deterministic FNV-1a Shuffle)
📰

Zero-Dependency 1080x1350 Shareable Cards in Pure HTML5 Canvas (Path2D + Deterministic FNV-1a Shuffle)

DEV Community: frontend·Quiet Stack Lab·7 days ago
#l2eJiAcy
#devtofrontend#devto#dev#card#const
Long article (1385 words) — no AI summary yet.
Reading 0:00
15s threshold

Most "shareable result card" web apps reach for html2canvas , a headless Chromium screenshot API, or a server-side Puppeteer worker. All three add latency, font-loading flakes, or CORS headaches.

When we built FateCard 2027 (a zero-backend, bilingual EN/KO 3-card archetype & 2027 aura generator), we wanted two guarantees:

Deterministic draws with zero database: the same birth date + focus always yields the exact same 3-card spread across devices, with zero API calls or cookies.

Crisp 1080×1350 PNG export in pure browser JS: no html2canvas , no SVG-to- <img> tainting bugs, and proper CJK + Latin typography fallback.

Here is the exact zero-dependency code powering both halves.

1. Preventing Silent Date Rollover & Seeding a Reproducible Shuffle

JavaScript's new Date("2026-02-31T00:00:00Z") silently rolls over to March 3 instead of failing. Round-tripping the ISO slice catches invalid calendar dates in two lines:

export function localIso ( date = new Date ( ) ) { return [ date .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.