REFERENCE
- Gallery page: https://magpui.com/en/i/filters-melt-into-the-counter-0f3e00
- First frame (image): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/filters-melt-into-the-counter-0f3e00/shot.jpg
- Clip (mp4): https://dnioievkvxejjbxgwvko.supabase.co/storage/v1/object/public/media/filters-melt-into-the-counter-0f3e00/clip.mp4
- Original post: https://x.com/AlbiaHossain/status/2119029653763674397 by @AlbiaHossain
Before building, download the first frame and look at it. If ffmpeg is available, download the clip and extract frames (ffmpeg -i clip.mp4 -vf fps=2 frame-%02d.png), then study the motion frame by frame. Match what you see; the text below describes it, the frames are the truth.
BUILD: Create a compact results counter and two filter chips that merge into its black pill when selected and pull free when deselected. Animate the count with rolling digits. Build only this component.
DESIGN SYSTEM: Warm off-white #F6F7F2 background, near-black #111111 surfaces. Counter 164 by 56px; chips 110-126 by 54px; full pill radii, 2px outlines, 18px gaps. Neutral sans-serif labels at 23px, semibold; bold white counts and muted gray results label. No shadows. Selected chips have white labels on a shared black surface with a faint divider near the counter.
MOTION: On activation move the chip toward the counter and merge its shape through a narrow liquid neck over 480ms, cubic-bezier(0.22,1,0.36,1). Reverse and separate over 420ms, cubic-bezier(0.34,1.3,0.64,1). Roll count digits upward through a clipped viewport over 300ms. Apply a subtle 1.06 horizontal stretch during attachment. These timings are suggested implementation targets.
SECTIONS: Idle shows a black results pill and outlined Cycling and Tennis chips. Selected chips join the filled pill. Deselection returns a chip to the available row while the other chips close the gap. Support both selections and rapid state changes.
IMPLEMENTATION: Use React and Motion for transforms, layout and digit transitions. An SVG blur and color-matrix mask should affect only the shape layer; keep HTML labels outside the filter to preserve crisp text. Real buttons with aria-pressed, visible keyboard focus and keyboard activation. Derive counts from selected filters. Scope the SVG filter to the small component; avoid full-screen blur. For prefers-reduced-motion change states and counts instantly without liquid travel.
ADAPT TO THE PROJECT: Reuse existing project tokens, components and fonts, mapping colors to the closest existing tokens. Never copy logos, brand names, photos or illustrations from the original; use placeholders.
SUCCESS CHECK:
- Chips attach and separate without blurring text or clipping the liquid neck.
- Counts and active filters remain synchronized during rapid toggles.
- Keyboard and reduced-motion users get the same selected states.