Reveal on scroll in WordPress
Steps that fade and slide into view as the page scrolls.
Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.
This component also comes in
The code in WordPress
<?php
/**
* Plugin Name: Forge, Révélation au défilement
* Description: Des étapes qui apparaissent en fondu et en glissant à mesure qu’on fait défiler la page. Ajoute la composition « Révélation au défilement » à l'éditeur de blocs.
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
* Author: Forge
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: forge-effet-revelation-defilement
*<!-- wp:html -->
<section class="efrd" data-efrd aria-labelledby="efrd-titre">
<h2 class="efrd__title" id="efrd-titre">Votre site en quatre étapes</h2>
<p class="efrd__intro">Faites défiler : chaque étape apparaît à son tour, au rythme de votre lecture.</p>
<ol class="efrd__list">
<li class="efrd__item">
<span class="efrd__num" aria-hidden="true">01</span>
<h3 class="efrd__step">Appel découverte</h3>
<p class="efrd__desc">Trente minutes au téléphone pour comprendre votre activité, vos clients et ce que le site doit leur apporter.</p>
</li>
<li class="efrd__item">
<span class="efrd__num" aria-hidden="true">02</span>(() => {
if (!document.querySelector(".efrd")) return;
// Firefox does not support view timelines yet: replay the same range by hand.
if (!CSS.supports("animation-timeline: view()")) {
const reduce = matchMedia("(prefers-reduced-motion: reduce)");
document.querySelectorAll("[data-efrd]").forEach((root) => {
const items = [...root.querySelectorAll("li")];
// A plain fade stands in for the veil: its pseudo-element only exists where view timelines are supported.
const animations = items.map((item) => {
const animation = item.animate(
[
{ opacity: 0, transform: "translateY(2.5rem) scale(0.97)" },:root {
--efrd-text: #172033;
--efrd-body: #4b5563;
--efrd-card: #ffffff;
--efrd-line: #e2e8f0;
--efrd-num: #1d4ed8;
--efrd-bg: #f1f5f9;
--demo-effet-revelation-defilement-bg: #f1f5f9;
--demo-effet-revelation-defilement-text: #172033;
}
@media (prefers-color-scheme: dark) {Free component: copy it freely, including for commercial projects.
Other visual effects components in WordPress
Visual effects components in WordPress
A large heading whose words turn from grey to ink as the page scrolls, then whose key phrases get a marker stroke, in pure CSS with a readable fallback.
- Tailwind
- React
- CSS
- WordPress

Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.
- Tailwind
- React
- CSS
- WordPress

A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.
- Tailwind
- React
- CSS
- WordPress

A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.
- Tailwind
- React
- CSS
- WordPress

A paragraph whose words turn from grey to full ink, one by one, as the page scrolls, in pure CSS with a plain-text fallback.
- Tailwind
- React
- CSS
- WordPress

Four offset, translucent sine waves gently roll along the bottom of a section, each at its own pace.
- Tailwind
- React
- CSS
- WordPress