A highly interactive, responsive macOS/iOS style scroll-driven dock featuring app icons that scale, blur, or parallax as they scroll.

Scroll-Driven macOS iOS Dock Concept

Pure CSS Scroll-Driven macOS iOS Dock recreates Apple’s legendary dock using the native CSS Scroll-Driven Animations API. Icons dynamically scale, blur, and shift depth completely without JavaScript. Utilizing @supports (animation-timeline: scroll()), the layout safely handles horizontal and vertical snaps. A zero-dependency, ultra-lightweight demonstrator of modern CSS capabilities. (Requires: gsap.js, scroll-trigger.js)

Technologies:
HTML CSS JavaScript (Babel)
Difficulty: Advanced
Browser Support (as of Jun 2026):
Chrome Chrome 115+ Edge Edge 115+ Safari Safari 26+
Features:
Scroll-Driven Animation GSAP Fallback Dynamic Scaling
Code by: Jhey Jhey
License: MIT
Horizontal text marquee with faded edges, demonstrating an infinite scrolling animation using pure CSS

Pure CSS Faded Infinite Text Marquee

This is a Faded Infinite CSS Text Marquee. It creates a continuous, horizontal scrolling display for text elements using advanced CSS animation math. Its function is to showcase lists of keywords, tags, or announcements in a constrained space, using gradient masks to seamlessly blend the moving text into the background.

Technologies:
Pug SCSS
Difficulty: Intermediate
Browser Support (as of May 2026):
Chrome Chrome 104+ Edge Edge 104+ Firefox Firefox 104+ Safari Safari 14.1+
Features:
Infinite Loop CSS Masking Negative Delays
Code by: Ana Tudor Ana Tudor
License: MIT
A UI background starting as white at the top with gray grid lines, fading into a vibrant teal-to-purple gradient at the bottom.

Fading Grid Gradient Background

This Fading Grid Gradient Background creates a clean, architectural aesthetic suitable for SaaS landing pages or documentation sites. It features a technical vertical grid pattern that gently dissolves into a vibrant teal-and-purple gradient at the bottom. The effect mimics a “horizon” line, adding depth and structure to an otherwise flat page without using any images.

Technologies:
HTML CSS
Difficulty: Beginner
Browser Support (as of Feb 2026):
Chrome Chrome 80+ Edge Edge 80+ Firefox Firefox 53+ Safari Safari 15.4+
Features:
CSS Masks Stacked Gradients Pattern Generation Responsive Background
Code by: kencode7 kencode7
License: MIT
Fading Away Text Effect

Fading Away Text Effect

This demo shows how to create a dynamic text fade effect using CSS variables and JavaScript. Each character is wrapped in a <span> with a unique index, which is then used in calc() to apply a blur and opacity effect.

See the Pen Fading Away Text Effect.

Scroll Mask Indicators

A modern and clean way to indicate scrollability: the “fade-to-mist” effect is implemented using mask-image and linear-gradient, while key parameters of the fade phase are precisely tuned using @property.

See the Pen Scroll Mask Indicators.

Fancy Fading Footer

A sleek Glassmorphism footer effect that gracefully blurs underlying fixed content upon scrolling. By combining backdrop-filter with a CSS gradient mask (mask-image), this snippet creates a premium, depth-rich UI overlay ideal for modern landing pages.

See the Pen Fancy Fading Footer.

Horizontal Scroller Edge Fade Mask

A polished horizontal scrolling container featuring soft fade-out edges achieved via CSS mask-image and linear gradients. This technique eliminates harsh content cut-offs, creating a seamless and premium UI experience for image galleries or sliding card lists.

Frequently Asked Questions

What is the core benefit of utilizing @starting-style over JavaScript for element entry fades?

The @starting-style rule allows developers to declare the initial rendering state of a newly mounted node directly in the stylesheet. This enables smooth opacity transitions from display: none without needing setTimeout timing hacks or third-party mounting wrappers, drastically simplifying DOM orchestration.

How should accessibility be preserved when introducing fade-out or fade-in visual states?

Fading an element to an opacity of 0 only renders it visually hidden; it remains fully present in the accessibility tree and reachable via keyboard navigation. To maintain semantic integrity, developers must pair the opacity transition with display or visibility: hidden (supported natively via allow-discrete transitions) and respect system settings using the prefers-reduced-motion media feature.

How do native CSS scroll-driven timelines improve performance compared to older scroll-based fading libraries?

Native view-timeline and scroll-timeline properties bind keyframe interpolation directly to viewport coordinates on the browser’s compositor thread. This completely bypasses main-thread event loops, requestAnimationFrame handlers, and IntersectionObserver callbacks, keeping the thread idle and preserving a stellar Interaction to Next Paint (INP) score.

Why is it critical to only animate opacity rather than properties like filter: blur() or rgba() background-colors for high-speed fade actions?

Properties like opacity are highly optimized because they do not trigger paint or layout stages in the rendering pipeline, operating purely as a composition layer on the GPU. Modifying complex filters or color functions during rapid transitions forces expensive rasterization and repaints, which can degrade animation smoothness.

How can the View Transitions API be utilized to create elegant fades during route changes?

The View Transitions API captures snapshots of the active and incoming DOM state, allowing developers to target the entire page transition using the pseudo-elements ::view-transition-old(root) and ::view-transition-new(root). Applying a basic fade on these snapshots replaces complex client-side router motion hacks with native, hardware-accelerated rendering.