Skip to content

Scrolling words marquee in WordPress

Two rows of large words scrolling in opposite directions, faded at the edges, with a pause button.

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

Open in a new tab

The code in WordPress

effet-bandeau-defilant.php
<?php
/**
 * Plugin Name: Forge, Bandeau de mots défilant
 * Description: Deux rangées de grands mots qui défilent en sens inverse, fondues sur les bords, avec un bouton pause. Ajoute la composition « Bandeau de mots défilant » à 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-bandeau-defilant
 *
pattern.html
<!-- wp:html -->
<section class="efbd" data-efbd aria-label="Nos savoir-faire et nos clients">
        <div class="efbd__row">
          <ul class="efbd__track" role="list">
            <li class="efbd__item">Identité visuelle<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
            <li class="efbd__item">Sites vitrines<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
            <li class="efbd__item">Boutiques en ligne<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
            <li class="efbd__item">Photographie<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
            <li class="efbd__item">Rédaction<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
          </ul>
          <ul class="efbd__track" role="list" aria-hidden="true">
            <li class="efbd__item">Identité visuelle<svg class="efbd__star" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z"/></svg></li>
script.js
(() => {
  if (!document.querySelector(".efbd")) return;
  document.querySelectorAll("[data-efbd]").forEach((root) => {
    const button = root.querySelector("[data-efbd-toggle]");
    button.hidden = false;
    button.addEventListener("click", () => {
      const paused = button.getAttribute("aria-pressed") !== "true";
      button.setAttribute("aria-pressed", String(paused));
      button.textContent = paused ? "Relancer le défilement" : "Mettre en pause";
      root.toggleAttribute("data-paused", paused);
    });
  });
style.css
:root {
  --efbd-text: #1c1917;
  --efbd-alt: #9a3412;
  --efbd-star: #ea580c;
  --efbd-line: #d6d3d1;
  --efbd-btn: #44403c;
  --demo-effet-bandeau-defilant-bg: #fafaf9;
  --demo-effet-bandeau-defilant-text: #1c1917;
}

@media (prefers-color-scheme: dark) {
  :root.forge-follows-system:not([data-theme="light"]) {

Free component: copy it freely, including for commercial projects.

Visual effects components in 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
    Component
  • 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
    Component
  • 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
    Component
  • 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
    Component
  • Four offset, translucent sine waves gently roll along the bottom of a section, each at its own pace.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component