Skip to content

fix(pet): animate HTML layers, not SVG groups, so old iPads do not freeze - #1128

Merged
tempus2016 merged 1 commit into
mainfrom
fix/1126-pet-animation-old-webkit
Oct 24, 2026
Merged

tempus2016 merged 1 commit into
mainfrom
fix/1126-pet-animation-old-webkit

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Fixes #1126

The kiosk froze on older iPads once a pet had hatched. #1115 fixed the same freeze for the unhatched egg, but every other pet animation (bounce, sway, wobble, hop, evolve, the laid egg) still ran as a CSS transform on an SVG <g>, and the sleepy mood put a CSS filter on that group. Old iOS Safari repaints an animated SVG group on the main thread every frame.

Fix

  • The pet scene is now stacked full-size SVG layers (back, pet, front, laid egg) on the same canvas
  • The pet and egg layers sit inside HTML elements, and those carry the animation and the sleepy filter, so Safari moves them on the GPU
  • It looks the same: the pivot points are set to the pet's and egg's feet as before

Tested

  • Old and new card rendered side by side on a dev Home Assistant (content dog, sleepy dino, proud legendary dragon with full home, accessories and a laid egg), animations paused at the same moments: identical, and every animation now targets an HTML element, none an SVG group
  • New render test: no SVG group carries an animated class, and no transform-box or SVG animation/filter in the card styles
  • npm run lint clean, npm test 1175/1175

Every pet animation (bounce, sway, wobble, hop, evolve, the laid egg) ran as
a CSS transform on an SVG <g> with transform-box: fill-box, and the sleepy
mood put a CSS filter on that group. Old iOS Safari repaints an animated SVG
group on the main thread every frame, so the kiosk froze once a pet hatched,
just as the clipped egg did before #1115.

The scene is now stacked full-size SVG layers (back, pet, front, laid egg);
the pet and egg layers sit in HTML elements that carry the animation and the
filter, which Safari moves on the GPU. It looks the same.

Fixes #1126
@github-actions github-actions Bot added cards Lovelace cards / frontend (www/*.js) tests Test suite labels Oct 24, 2026
@tempus2016
tempus2016 merged commit 0ea31ce into main Oct 24, 2026
16 checks passed
@tempus2016
tempus2016 deleted the fix/1126-pet-animation-old-webkit branch October 24, 2026 15:07
@tempus2016 tempus2016 mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cards Lovelace cards / frontend (www/*.js) tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Kiosk Page frozen after pet egg hatched

1 participant