Skip to content

fix(landing): clamp canvas size to avoid exceeding browser max - #47

Merged
gnacho merged 5 commits into
mainfrom
feat/46-landing-canvas-kofi
Aug 11, 2026
Merged

gnacho merged 5 commits into
mainfrom
feat/46-landing-canvas-kofi

Conversation

@gnacho

@gnacho gnacho commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What

Two fixes for the public landing (helios.cloudless.club):

  1. Canvas exceeds max size on resize (the bug you reported). The frame loop sized the chart canvases to clientWidth × devicePixelRatio with no cap; during a transient layout state on window resize the browser got a size past its max canvas area and setTransform threw a DOMException that broke the draw loop (reproduced in Firefox; same crash surfaced in Chrome/Edge). Fix: fitCanvas() skips redraw when the layout size is out of bounds and clamps physical canvas pixels to a safe ceiling.

  2. Ko-fi donation block in the final CTA, with humble/warm/lightly humorous copy (es/en) inviting optional support, since Helios is free and not the author's main income.

Also: the landing source is now versioned in landing/ (same pattern as the other apps); it previously only lived on the server.

Verification

  • Local: stress resize (240 resizes) in Chromium + Firefox → 0 pageerrors (before: Firefox crashed on the first aggressive resize round).
  • i18n parity 103/103 es/en, no em dashes in prose.
  • Deployed to VPS (nginx static-helios-web.conf, root /opt/helios-web/public), md5 prod == repo 4/4.
  • Prod verified with Playwright: 0 errors after 140 resizes in Chromium + Firefox; Ko-fi block renders with correct href in es/en.

Closes #46

gnacho added 5 commits August 11, 2026 20:18
Resize transients could size theater/sky canvases past the browser
limit and throw 'Canvas exceeds max size' from setTransform. fitCanvas
skips redraw when the layout size is out of bounds and clamps physical
canvas pixels. Also add a Ko-fi donation block with humble copy to the
final CTA (es/en).
The theater grid used 1fr rows and flex:1 canvases, so cards always
stretched to fill the full 100svh sticky (392px+ each, more after every
resize). Switch to auto rows, fixed canvas heights and drop the flex:1
from the battery body so cards keep their natural size and stay
centered.
The statutes section shared the .statutes class with its <ol>, so the
3-column grid was applied to the whole <section>, squeezing the card
list into a 638px track (202px per card). Scope the grid to ol.statutes
so the three cards stretch across the full width, and give the Cloudless
Club button a proper amber pill style with an animated arrow.
- Center all .section-head (features/how/screens/faq/statutes).
- Theater: bigger title/sub font, dark translucent card backgrounds so
  the white text is readable over a bright sky ('white on white' fix),
  and center the home icon in its energy-flow node.
- Move the 'Thanks, Home Assistant' card to its own section right
  before the footer.
- Footer links: inline SVG icons (club globe, play, github, heart);
  drop the arrow from footer.club since the icon replaces it.
@gnacho
gnacho merged commit 48a7780 into main Aug 11, 2026
4 checks passed
@gnacho
gnacho deleted the feat/46-landing-canvas-kofi branch August 11, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Landing: canvas exceeds max size on resize + add Ko-fi donation block

1 participant