StealThis .dev

Card Automatic Transition

An animated card stack that automatically transitions between cards with smooth scroll-triggered animations, blur effects, and diagonal wipe reveals.

Open in Lab
html css javascript
Targets: JS HTML

Code

Card Automatic Transition

An animated card stack component that automatically cycles through cards with smooth transitions. Each card slides, blurs, and reveals the next scene with a diagonal wipe effect, creating a cinematic scrolling experience.

How it works

The component uses requestAnimationFrame to create a continuous animation loop that cycles through cards automatically. Each card’s visual state is calculated based on its distance from the active card:

  1. Opacity — fades in/out based on proximity
  2. Transform — slides horizontally and scales for depth
  3. Blur — applies blur filter for focus effect
  4. Clip-path — creates diagonal wipe reveal animation
  5. Z-index — manages stacking order dynamically

The animation respects prefers-reduced-motion and adjusts timing accordingly.

Key features

  • Automatic card cycling with smooth transitions
  • Scroll-triggered animations with diagonal wipe reveals
  • Blur and scale effects for depth perception
  • Responsive design with mobile-friendly layouts
  • Accessibility support with prefers-reduced-motion
  • Customizable card data and themes

When to use it

  • Product showcases with multiple items
  • Feature highlights in landing pages
  • Portfolio galleries with smooth transitions
  • Storytelling sections with sequential content
  • Hero sections with animated card stacks