Skip to content

Animate the score when it updates - #46

Merged
ylynfatt merged 1 commit into
mainfrom
animate-score-on-update
Jun 14, 2026
Merged

ylynfatt merged 1 commit into
mainfrom
animate-score-on-update

Conversation

@ylynfatt

Copy link
Copy Markdown
Owner

Why

When a goal arrived over the realtime channel, the score digit just swapped silently — easy to miss. This makes the change pop.

Change

New AnimatedScore component renders a score number that pops and flashes whenever its value changes (never on the initial render). Used in both the gamecast header and the live scoreboard cards.

  • The flash colour is themeable (flash prop) so it stays legible on the dark pitch header (volt) and the light scoreboard cards (primary green).
  • Honours prefers-reduced-motion — no animation for users who opt out.
  • Only the side that scored animates (each number is its own instance), and a second quick goal restarts the animation via a double-requestAnimationFrame class reset.

Verification

Verified the pop/flash in isolation for both contexts (the dev stack — serve/Reverb/Vite — was stopped, so no end-to-end run this round; the realtime score-patch path was confirmed in earlier work). vue-tsc shows no new type errors from these files; component is Prettier-clean.

Note: a production deploy needs npm run build.

🤖 Generated with Claude Code

A goal arriving over the realtime channel used to swap the digit silently.
Add a small AnimatedScore component that pops and flashes the number
whenever its value changes (never on first render), and use it for both
the gamecast header and the live scoreboard cards. The flash colour is
themeable so it stays legible on the dark pitch header (volt) and the
light scoreboard cards (primary); the animation honours
prefers-reduced-motion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ylynfatt
ylynfatt merged commit f1d3798 into main Jun 14, 2026
1 check passed
@ylynfatt
ylynfatt deleted the animate-score-on-update branch June 14, 2026 05:44
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.

1 participant