Ripple press

A circular ink ripple expands from the touch point and fades, the Material press feedback.

ButtonPress Web Animations API time-based Targets: App · Web All modern browsers
Target
Implement the "Ripple press" effect in vanilla HTML/CSS/JS.

Context: A circular ink ripple expands from the touch point and fades, the Material press feedback.
Trigger: the element is pressed (pointerdown → pointerup).
Timeline: time-based (duration + easing).

Motion tokens (normal):
- scale (ripple): 0 → 1 (covers the farthest corner)
- opacity (ripple): 0.32 → 0
- duration: 550ms
- easing: cubic-bezier(0.4, 0, 0.2, 1)

Motion tokens (prefers-reduced-motion):
- opacity (whole surface overlay): 0 → 0.12 then back
- duration: 150ms
- easing: ease-out
- note: no expanding circle, a flat flash instead

Technique: Web Animations API is acceptable.

Acceptance:
- animate only transform and opacity unless the spec lists other properties
- no layout shift; content is visible without the animation
- when prefers-reduced-motion is set, use the reduced tokens only
- ripple radius is computed so the circle reaches the farthest corner of the surface
- container has overflow hidden and position relative; ripple is pointer-events none

Generated from the spec. Prompts differ by target name only; the tokens are the source of truth.