Skip to content

No.104 · Cards· New

Sweep Cards

Three pastel question cards. As they come into view, a demo cursor in each card's colour sweeps the phrase that answers the question, one card after another, and leaves it highlighted. It plays once and stays still.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Dark

Build a row of three question-and-answer cards on black (a fictional 'Masar' explaining how sites get read by AI assistants). Cards: equal columns with about 26px gaps (one column below 56rem), a 24px radius, about 46px padding. Each has a 500-weight heading at about 40px (line-height 1.14, -0.022em, balanced) and a body at about 22px with a very open line-height of 2.25. Colours per card: sky #b9e4fa with a navy heading #0b2a45 and body #164a6e; mint #bdf5d3 with #0d3a22 and #17603a; butter #fff7c2 with #3d2a00 and #5c4300. Sweep: in each body one phrase is marked [[…]]. A demo cursor in that card's darker accent (#0284c7, #15a34a, #d97706: a 19px arrow with rounded corners and a soft shadow) glides in from below-right, presses and drags across the phrase; a solid box (3px wider than the words either side) in the saturated accent (#38bdf8, #22d36b, #fcd34d) with a 1.5px darker edge (#0ea5e9, #16b65b, #eab308) and a 5px radius grows behind the words line by line, while the text keeps its own dark colour. It lets go, the arrow drifts to rest just past the end and stays. The cards go in turn about 1.15s apart, starting half a second after they come into view. It plays once: no loop, no controls. Selected variant — Dark (dark): Palette for this theme (Dark): --swpc-edge transparent; --swpc-page #000000. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "dark". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Nothing to operate: the cards play their sweep once when they come into view, then stay as they are. Motion: Per card: glide 900ms, press 160ms, drag about 340px/s line by line, rest 520ms; cards staggered by 1.15s. After the third, nothing moves again. Reduced motion shows all three highlights and arrows at rest from the start. Accessibility: Cards are articles labelled by their headings; the text is real text, and the boxes and cursors are aria-hidden. Responsive behavior: Three columns stack to one below 56rem; type and padding scale with the container, and wrapped phrases are swept line by line at any width. Touch: Identical on touch; it never depended on the pointer. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Nothing to operate: the cards play their sweep once when they come into view, then stay as they are.
Motion
Per card: glide 900ms, press 160ms, drag about 340px/s line by line, rest 520ms; cards staggered by 1.15s. After the third, nothing moves again. Reduced motion shows all three highlights and arrows at rest from the start.
Accessibility
Cards are articles labelled by their headings; the text is real text, and the boxes and cursors are aria-hidden.
Responsive
Three columns stack to one below 56rem; type and padding scale with the container, and wrapped phrases are swept line by line at any width.
On touch
Identical on touch; it never depended on the pointer.

Featured

373 components