Creative coding · Case study

SVG animations in a GitHub README freeze on their first frame

A score ring was invisible on every GitHub profile because README images load through <img>, where SVG runs in secure static mode and paints the animation's start value, here a full-length stroke-dashoffset. Local tests missed it because cairosvg and resvg ignore <animate> and paint the static attribute. CSS keyframes did not help, since Chrome freezes them at the first keyframe inside <img> too. The fix was to drop the reveal, and one animation whose start state is already a valid frame survived.

Disclosure Describes the author's own gh-stats card.

Read at source
All tutorials