Skip to content

feat(site): add bouncy pop animation to inbox notification badge#26057

Open
jakehwll wants to merge 6 commits into
mainfrom
jakehwll/notification-badge-transition
Open

feat(site): add bouncy pop animation to inbox notification badge#26057
jakehwll wants to merge 6 commits into
mainfrom
jakehwll/notification-badge-transition

Conversation

@jakehwll
Copy link
Copy Markdown
Contributor

@jakehwll jakehwll commented Jun 4, 2026

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

Replaces the basic animate-in fade-in zoom-in duration-200 on the inbox unread badge with a bouncier pop using an overshoot easing.

The badge now pops in from scale(0) with cubic-bezier(0.34, 1.36, 0.64, 1) over 500ms, giving it an elastic overshoot that makes it feel alive. Uses tailwindcss-animate utilities (animate-in zoom-in-0 fade-in-0) with just one arbitrary property for the easing. Conditional rendering is preserved as before.

Also adds a BadgeTransition story with toggle buttons for easy visual verification.

preview-notification-animation

Replace the basic fade-in/zoom-in animation on the inbox unread badge
with the transitions.dev notification-badge pattern. The wrapper slides
diagonally into position while the inner dot pops with an overshoot
bounce easing and blurs out on exit.

All animation is driven through Tailwind: keyframe and animation
registered in tailwind.config.js, timing variables in index.css :root,
and group-data-* variants on the component. No raw CSS classes.

Pure CSS, no JS orchestration. The global prefers-reduced-motion guard
already covers these elements.
jakehwll added 2 commits June 4, 2026 12:00
…all values

Drop the custom keyframe from tailwind.config.js and use the existing
animate-in + slide-in-from-* utilities from tailwindcss-animate. Remove
all --badge-* CSS variables from index.css and inline the durations and
easings directly in the component. Drop the transitions.dev comment.
The CSS custom property was defined on the child UnreadBadge span but
read by the parent wrapper for positioning. Custom properties cascade
down, not up, so the offset resolved to zero.
@jakehwll jakehwll changed the title feat(site): add notification badge pop transition from transitions.dev feat(site): add notification badge pop transition Jun 4, 2026
jakehwll added 3 commits June 4, 2026 12:21
…otifications

The badge DOM is now only mounted once unreadCount has been > 0 at
least once. This avoids the dot visibly shrinking to scale-0 on
first render when there are no notifications. Once mounted it stays
in the tree so subsequent open/close transitions play normally.
The diagonal slide covers too much distance on a small badge and
looks like it flies in from the center of the button. The overshoot
scale + fade on the dot alone is enough.
Without the slide-in or exit animation there is no reason to keep
the badge permanently mounted. Drop the useRef, the wrapper span,
the group-data variants, and use animate-in zoom-in-0 fade-in-0
with the bouncy overshoot easing directly on the UnreadBadge.
@jakehwll jakehwll changed the title feat(site): add notification badge pop transition feat(site): add bouncy pop animation to inbox notification badge Jun 4, 2026
@jakehwll jakehwll marked this pull request as ready for review June 4, 2026 12:47
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.

3 participants