Free
✨ Creative
Marquee Carousel Strip
Infinite marquee that doubles as a draggable carousel — seamless loop, drag to scrub, snap to card.
1.2k views 232 copies 312 palavras
O prompt
# Marquee Carousel Strip — Carousel Component ## Goal Build a horizontally looping strip of cards that auto-scrolls like a marquee, can be grabbed and scrubbed, and snaps to the nearest card on release. It must drop cleanly into an existing Next.js + Tailwind project as a self-contained component. ## Design Spec - Render the card set twice back-to-back and translate by -50% for a seamless loop — never animate `scrollLeft`. - Cards are fixed-width (280px desktop / 220px mobile) with a 16px gutter; the strip is `overflow: hidden` with 32px gradient masks at both edges. - Cursor becomes `grab`, then `grabbing` while dragging; no visible scrollbar at any breakpoint. - Include an optional paused state on hover — on by default for card sets with links, off for pure logo walls. ## Motion Spec - Base drift 30px/s via `transform: translate3d`, driven by rAF with delta-time so speed is frame-rate independent. - Drag adds velocity; on release, momentum decays over ~800ms then snaps to the nearest card boundary with a 320ms ease-out. - Direction reverses smoothly (over 400ms) rather than flipping instantly when `direction` changes. - Reduced motion: no drift at all — becomes a plain scroll-snap container with visible arrows. - Respect `prefers-reduced-motion` — provide a static fallback that still looks intentional. ## Component API - Props: `speed?: number` (px/s, default 30), `direction?: 'left' | 'right'`, `pauseOnHover?: boolean`, `snap?: boolean`. - Children are the cards; the component clones them internally for the loop and marks clones `aria-hidden`. - Keyboard: arrow keys move one card, Home/End jump to ends, and focus inside a card pauses the drift. ## Quality Bar - TypeScript strict, zero `any`. Tailwind only — no external CSS files. - Works on mobile: touch targets ≥ 44px, no hover-only affordances. - 60fps: animate only `transform` and `opacity`; use `will-change` sparingly. - Accessible: correct roles/aria, keyboard operable, focus-visible styles.
Você também pode gostar
Free
Magnetic CTA Cluster
✨ Creative
Buttons that pull toward the cursor within a radius, with the label lagging behind the shell for weight.
3.9k 710CursorClaude CodeLovable
Free
Cast & Render
✨ Creative
Single-file scroll-scrubbed landing for a 3D studio: scrolling scrubs a fixed all-intra background video frame by frame while three text panels cross-fade over it, with no framework and no build step.
1.2k 797CursorClaude CodeLovable
Free
Aethera
✨ Creative
Fullscreen white hero: an Instrument Serif headline over a looping video band that hand-fades in and out on every pass.
4.1k 358CursorClaude CodeLovable
Free
Figurine Carousel Hero
✨ Creative
Full-viewport figurine carousel where background colour, scale, blur and position all crossfade together on one 650ms curve.
2.8k 557CursorClaude CodeLovable