65

scroll-effects. Code gốc nguyên văn 65

Mỗi file là trang kết quả gốc của tác giả trên CodePen (pen public = MIT) — bấm ảnh để chạy thật, copy nguyên file để dùng, giữ comment ghi công ở đầu file. Chạy local cần HTTP server (python3 -m http.server), không mở bằng file://.

Interactive Cicada Genomics Landing Page

Code

This immersive landing page uses an intricate sequence of vector animations and responsive viewport styling to tell a visual story. Built on top of GSAP ScrollTrigger and MotionPathPlugin, it transitions users through interactive text slides and morphs a tree diagram into organic butterfly wings. Smooth motion path travels, audio ambiance, and SVG stroke-drawing create a highly tailored cinematic web experience.

Interactive Variable Font GSAP Slideshow

Code

This masterfully choreographed full-page slider captures wheel, swipe, and key events to drive a multi-layered transition. Utilizing GSAP Observer, the layout animates parent and child containers in opposite directions, producing a clean split-wipe reveal. Simultaneously, a custom variable font dynamically stretches its width axis (wdth) alongside parallax image transformations to create an organic, tactile sense of momentum.

Native CSS Scroll Snap Time Picker

Code

This date and time wheel selector leverages the cutting-edge CSS Scroll Snap Events API to build an efficient mobile-style picker. By registering event listeners for scrollsnapchanging and scrollsnapchange, the layout dynamically updates the select state in real time as the wheels rotate. It uses native CSS scroll-start-target-block to set initial positions, offering a smooth, lightweight solution.

Observer-Animated Responsive Vertical Timeline

Code

This chronological content layout uses an Intersection Observer to fade and slide events smoothly into view as the user scrolls. Utilizing Faker to populate mock data, the ES6 script generates semantic <time> and <small> nodes on load. On larger viewports, the grid transitions to a split layout with left-aligned dates, while a native @media query auto-toggles dark mode.

Interactive 3D Sphere Image Gallery

Code

An advanced interactive image gallery rendered entirely on an HTML5 Canvas. The script maps a collection of Unsplash images onto the surface of a virtual 3D sphere, calculating scale and opacity based on their normalized distance from the center. Users can rotate the sphere via mouse or touch drag. Hovering over an image highlights it with a tracking focus box, and clicking expands the image with a procedural slicing animation, accompanied by random digital glitch effects.

Scroll-Driven SVG Map Editorial Gallery

Code

This cinematic travel presentation combines scroll-driven vector mapping and nested photographic galleries. Built with GSAP ScrollTrigger and the Intersection Observer API, scrolling initiates a staged intro: the title fades, a detailed SVG map draws its borders, and a specific province highlights. Concurrently, a three-column image grid slides up, transitioning smoothly from greyscale to full color.

Scroll-Driven Godzilla Walk-and-Destroy Animation

Code

An interactive scroll-driven showcase featuring Godzilla walking across a detailed scenic skyline. Scrolling horizontally advances the sprite along an SVG vector path using GSAP MotionPath and ScrollTrigger, adjusting container offsets to dynamically re-center the camera viewpoint. Features vintage film grain dust loops, click-to-destroy targets, and explosive debris particles.

Scroll-Driven Particle WebGL Image Matrix

Code

An advanced scroll-driven WebGL experience powered by Three.js and GSAP. A fixed background canvas uses InstancedMesh to render nearly 50,000 distinct 3D cube particles, colored dynamically by extracting color values from an image mapped onto a hidden canvas. As the user scrolls down the page, the camera’s Z-axis position transitions, causing the scattered cubes to seamlessly converge into a photographic portrait.

Animated Scroll Highlight Annotations

Code

This is an Animated Scroll Highlight Annotations component. It combines a spatial theme toggle with progressive reading indicators that colorfully highlight key text passages as they enter the viewport. Its function is to enhance long-form reading experiences by guiding the user’s eye to critical information through contextual, scroll-bound motion.

Twisted Wave GLSL Image Gallery

lib đổi APICode

This is a Twisted Wave GLSL Image Gallery. It’s a high-performance, full-screen WebGL experience that uses custom shaders to create sophisticated visual effects. Its function is to transform a standard image carousel into a cinematic journey with two distinct interactions: a localized sine-wave distortion on mouse hover and a global radial blur that intensifies with the speed of the scroll.

GSAP ScrollTrigger List Expansion

Code

This snippet showcases a GSAP ScrollTrigger List Expansion effect. It mimics the native iOS “Notification Center” or “Wallet” card stack behavior. Its function is to condense a long list of items into a compact, layered visual stack, and then fluidly expand them into full, scrollable cards as the user scrolls down the container, creating a highly tactile mobile UI experience.

Cinematic Zoom Blur Image Gallery

hỏng tại nguồnCode

This is a Cinematic Zoom Blur Image Gallery. It utilizes custom GLSL fragment shaders and Three.js to create a high-fidelity transition between image textures. Its function is to provide an immersive navigational layer for visual portfolios, where spatial depth and radial blur replace standard linear crossfades.

Lenis Smooth Scroll & GSAP Page

Code

This is a Lenis Smooth Scroll & GSAP Page. It transforms a standard one-page website into a high-end, cinematic scrolling experience. Its function is to provide an exceptionally fluid and responsive interface by replacing native “jumpy” browser scrolling with the physics-based smoothness of Lenis, while using GSAP’s ScrollTrigger to orchestrate a series of staggered animations that reveal content as the user navigates down the page.

Lenis Smooth Scroll Cinematic Experience

Code

This is a Lenis Smooth Scroll Cinematic Experience. It transforms a standard single-page portfolio or narrative website into an immersive, high-end digital journey. Its primary function is to replace jarring browser scrolling with the fluid, physics-based motion of Lenis, while using GSAP’s ScrollTrigger plugin to orchestrate a complex sequence of cinematic animations, including a “film roll” header, an expanding video player, and a dramatic footer reveal.

Shattering Image Gallery Transition

hỏng tại nguồnCode

This is a Shattering Image Gallery Transition. It utilizes the WebGL API via Three.js to deconstruct 2D images into a matrix of 3D particles. Its function is to replace standard fade or slide slideshows with a highly cinematic, physics-based explosion effect, transitioning between photographs by blowing the current image apart to reveal the next one underneath.

Auto-Generated Anchor Positioned TOC

Code

This is an Auto-Generated Anchor Positioned TOC. It parses an article’s heading structure on the fly and constructs a sticky navigation menu. Its primary function is to replace heavy JavaScript scroll-spies (Intersection Observers) with native CSS Anchor Positioning and Scroll Targeting, moving an animated highlight alongside the active content section.

Infinite 3D Poster Scroll Wall

Code

This is an Infinite 3D Poster Scroll Wall. It constructs a dense, continuous grid of cinematic assets rendered entirely in WebGL. Its function is to provide a visually overwhelming, highly performant “hero” background that automatically fetches live data from an external API and perpetually scrolls along a tilted perspective plane.

Smooth 3D Scroll-Driven Reveal

Code

This is a Smooth 3D Scroll-Driven Reveal. It replaces the native scroll behavior with a custom, momentum-based scrolling engine that orchestrates complex 3D transforms. Its function is to create a gallery experience where images feel weightless, tilting and translating in 3D space based on their velocity and position relative to the viewport.

Scroll-Driven Dynamic Marquee Frame

Code

This is a Scroll-Driven Dynamic Marquee Frame. It creates a continuous perimeter ticker that bounds the viewport. Its function is to provide persistent context by reflecting the currently active section’s title. It transforms static reading into a reactive environment, updating both edge typography and core background colors as the user scrolls.

Pinned Split-Screen Mask Reveal

Code

Pinned Split-Screen Mask Reveal is a high-performance scroll-driven layout. It synchronizes fixed image stacks with flowing text content. This element creates a cinematic transition where images are “unmasked” as the user progresses through sections. It is designed to bridge the gap between static information and immersive visual storytelling.

Parallax Jungle Leaves Reveal

Code

This Parallax Jungle Leaves Reveal creates a cinematic opening for a landing page. As the user scrolls, dense layers of tropical SVG leaves part ways - some moving left, some right - while smaller leaves float randomly in the background. The effect culminates in the reveal of a typography-based logo, creating a sense of depth and discovery perfect for storytelling or adventure-themed websites.

Scroll-Triggered Text Highlights

Code

This Scroll-Triggered Text Highlight effect mimics the experience of marking important passages with a highlighter pen as you read. Using GSAP ScrollTrigger, the highlights animate seamlessly from left to right exactly when the text enters the reader’s viewport. The component offers multiple visual styles (full background, half-height, or underline) and fully supports dark mode, making it an excellent addition to long-form articles, documentation, or educational content.

Scroll-Driven Image Swapper

Code

This Scroll-Driven Image Swapper demonstrates the bleeding edge of web animation. It uses the native CSS Scroll-driven Animations API to create a complex parallax-like effect where two columns of different heights scroll in sync. As you scroll, the images in the shorter column slide and crossfade to match the context of the taller column. Crucially, the code implements a Progressive Enhancement strategy: it checks for native browser support and falls back to GSAP ScrollTrigger for browsers that haven’t implemented the spec yet.

Sticky Observer Navigation

Code

The Sticky Observer Navigation is a performance-first header component designed for modern landing pages. It uses an elegant dark-blue color palette with “Abril Fatface” typography to create a high-contrast, premium look. The navigation intelligently shrinks and hides the central title as the user scrolls, providing more screen real estate for content while maintaining essential link icons within a fixed bar.

ScrollMagic Pizza Assembly Animation

Code

This ScrollMagic Pizza Assembly Animation transforms a standard product landing page into an interactive storytelling experience. As the user scrolls down, individual pizza ingredients - peppers, mushrooms, olives - fly in from different directions to assemble a complete pizza. The sequence is tightly choreographed using GSAP timelines pinned to the scroll position, giving the user direct control over the “cooking” process.

Ink Transition Scroll Effect

Code

This Ink Transition Scroll Effect brings digital storytelling to life by mimicking the organic spread of ink on paper. Designed for a biography page, it reveals images using a “splatter” transition triggered by scrolling. It combines ScrollMagic for timing, GSAP for smooth text entry, and CSS Sprites for the complex ink mask animation.

Smooth Parallax Scroll Layout

thiếu ảnhCode

This GSAP ScrollSmoother Parallax Gallery represents a high-end implementation of scroll-based storytelling suitable for portfolios or luxury brand landing pages. It leverages the full power of the GreenSock ecosystem - specifically the premium ScrollSmoother and SplitText plugins - to create a “buttery” smooth scroll experience where content reveals itself with elegant, staggered animations and depth-inducing parallax.

GSAP ScrollTrigger Parallax Effect

Code

This demo is a masterclass in scroll-driven animation, where GSAP’s ScrollTrigger plugin choreographs multiple, layered effects. A fluid parallax effect is created by using scrub: 1 to tie the yPercent and rotation of decorative elements directly to the scrollbar. This is complemented by a sophisticated text reveal, where GSAP’s SplitText plugin animates characters into view with a staggered opacity and y tween, demonstrating a powerful and modular approach to building complex, interactive scrolling experiences.

Infinite Scrolling with Image Cards

thiếu ảnhCode

This infinitely scrolling image grid employs an IntersectionObserver with baton-passing observation to dynamically load content from the Pixabay API, creating cards through DOM manipulation as the user scrolls. JavaScript manages the paginated requests while CSS Grid provides responsive layout adaptation, with custom properties enabling seamless dark/light theme switching and clip-path animations.

pen đã xoá

Pixelated Lazy Load for Images

pen đã xoá

Pure JavaScript and CSS demonstrate how to replace a heavily pixelated placeholder with a full-size image using the data-src attribute and switching the image-rendering styles.