Layered parallax in WordPress
A mountain landscape in several planes that slide at different speeds while scrolling.
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, Parallaxe en couches
* Description: Un paysage de montagnes en plusieurs plans qui glissent à des vitesses différentes pendant le défilement. Ajoute la composition « Parallaxe en couches » à 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-parallaxe-couches
*<!-- wp:html -->
<section class="efpx" data-efpx aria-labelledby="efpx-titre">
<div class="efpx__scene">
<span class="efpx__decor" aria-hidden="true">
<span class="efpx__layer efpx__sun"></span>
<svg class="efpx__layer efpx__far" viewBox="0 0 1200 300" preserveAspectRatio="none" focusable="false"><path d="M0 300V170l90-50 110 60 140-110 120 80 100-40 150 90 130-120 150 100 110-40 100 50V300Z"/></svg>
<svg class="efpx__layer efpx__mid" viewBox="0 0 1200 300" preserveAspectRatio="none" focusable="false"><path d="M0 300V210l120-40 130 50 160-90 140 70 110-30 150 60 120-70 140 50 130-20V300Z"/></svg>
<svg class="efpx__layer efpx__near" viewBox="0 0 1200 300" preserveAspectRatio="none" focusable="false"><path d="M0 300V250c150-40 250-30 400 5s320-50 470-20 230 30 330 0V300Z"/></svg>
</span>
<div class="efpx__copy">
<p class="efpx__eyebrow">Refuge du Lac Blanc · Chamonix</p>
<h2 class="efpx__title" id="efpx-titre">Marcher au-dessus des nuages</h2>(() => {
if (!document.querySelector(".efpx")) return;
if (!CSS.supports("animation-timeline: view()")) {
const reduce = matchMedia("(prefers-reduced-motion: reduce)");
const scenes = [...document.querySelectorAll("[data-efpx]")].map((root) => root.firstElementChild);
let queued = false;
const update = () => {
queued = false;
scenes.forEach((scene) => {
const box = scene.getBoundingClientRect();
const progress = reduce.matches ? 0 : Math.min(Math.max(1 - box.bottom / Math.min(innerHeight, box.height), 0), 1);
for (const layer of scene.firstElementChild.children) {:root {
--efpx-sky-top: #e0f2fe;
--efpx-sky-bottom: #fef3c7;
--efpx-sun: #fcd34d;
--efpx-far: #c7d2e5;
--efpx-mid: #7d8fab;
--efpx-near: #1f3b57;
--efpx-text: #0c4a6e;
--efpx-body: #164e63;
--efpx-accent: #0c4a6e;
--efpx-on-accent: #ffffff;
--efpx-term: #bfdbfe;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