DOGS
IN MOTION
Through a tilted window,
catch a moment in motion.
GSAP Infinite Image Slider with a Blurred Background Cutout
A blurred background and a sharp foreground share the same rows of images, and a tilted rounded rectangle cuts a clear window through the blur. GSAP sends three rows gliding left and right in a seamless loop.
- Built with
- Published
Where to use it
- Key visuals for brand sites
- Portfolio and work showcases
- Hero visuals for event sites
- Openers for photo galleries
How it works
- The same image rows sit in both the background and the foreground, moving together in GSAP so the cutout stays perfectly aligned
- Only the background gets blur and a dark tint; inside the rounded-rectangle cutout, the images stay sharp
- Each track holds two copies of the image set and moves by exactly one set to loop without a seam
- Three rows run in alternating directions at different speeds, adding depth instead of a flat scroll
- The mask itself is tilted, and the images inside are counter-rotated to stay in sync with the background
- IntersectionObserver pauses GSAP when the slider leaves the viewport
- On phones, the image and text sizes and the cutout's size and angle are adjusted to avoid clipping
- Reduced-motion settings stop the infinite movement and show a still visual
Make it your own
- Size and tilt of the rounded rectangle
- Background blur amount and tint color
- Direction and speed of each row
- Image card ratio and spacing
Before you ship
- Mobile & touch
- It still fills the whole screen on phones, with the cutout and image sizes switched to suit narrow screens.
- Browser support
- Uses clip-path, CSS filter, and GSAP. Works in all major modern browsers.
- Performance (load: Medium)
- Movement uses transform only, and the timeline stops off-screen. The background blur value is fixed and never animated.
- Accessibility
- The image rows are decorative and hidden from screen readers, while the heading remains real HTML text.
- Reduced motion
- With prefers-reduced-motion, the slider and the intro animation stop.
FAQ
How do I keep part of a blurred background sharp?
Stack two identical image layers. Clip the top one with clip-path and apply CSS blur only to the bottom one.
How do I sync the background and the cutout with GSAP?
Move the same image rows in both layers with a single GSAP tween, and counter-rotate only the images inside the mask so their positions line up.
How do I build an infinite slider with no visible seam?
Place two copies of the image set side by side and repeat the track's movement after exactly one set. The loop point is invisible.
Can rows move in different directions?
Yes. Flip the start and end positions per row to mix leftward and rightward motion.
Can I change the shape of the rounded rectangle?
Adjust the mask element's width, height, border-radius, and rotate to change its size, roundness, and tilt.
Does the animation keep running after I scroll away?
IntersectionObserver pauses it when it leaves the screen, and it resumes from the same spot when it comes back.