Next.js Tools Run Astronomy Math and 1080x1350 Share Cards Entirely in the Browser
A developer describes building three client-side consumer tools in Next.js, including a moon phase calculator, a birth-date soulmate calculator, and a no-contact stage locator. The team moved all calculations, SVG visuals, and PNG share-card export into browser TypeScript to avoid serverless cold-start delays and image-rendering costs. They replaced a simple synodic-month modulo with Jean Meeus's lunar anomaly corrections, since the Moon's elliptical orbit can shift phase estimates by 12 to 18 hours. A 180-degree geometry bug in the phase-matching logic was caught only through headless Chrome screenshots, and the developer also shared tips on Canvas text wrapping and Canvas-based PNG download. The author reports instant interactions, zero image-generation costs, and zero layout shift on mobile.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in