Skip to content

Confetti shower in WordPress

A celebration banner where coloured confetti tumbles down behind the announcement.

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-confettis.php
<?php
/**
 * Plugin Name: Forge, Pluie de confettis
 * Description: Un bandeau de fête où des confettis de couleur tombent en tournoyant derrière l’annonce. Ajoute la composition « Pluie de confettis » à 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-confettis
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "efcn", "layout": {"type": "default"}} -->
<section class="wp-block-group efcn"><!-- wp:html -->
<span class="efcn__sky" aria-hidden="true">
          <span class="efcn__lane efcn__lane--1"><span class="efcn__piece efcn__piece--rect efcn__piece--c1 efcn__piece--1"></span></span>
          <span class="efcn__lane efcn__lane--2"><span class="efcn__piece efcn__piece--round efcn__piece--c2 efcn__piece--2"></span></span>
          <span class="efcn__lane efcn__lane--3"><span class="efcn__piece efcn__piece--strip efcn__piece--c3 efcn__piece--3"></span></span>
          <span class="efcn__lane efcn__lane--4"><span class="efcn__piece efcn__piece--rect efcn__piece--c4 efcn__piece--4"></span></span>
          <span class="efcn__lane efcn__lane--5"><span class="efcn__piece efcn__piece--strip efcn__piece--c2 efcn__piece--5"></span></span>
          <span class="efcn__lane efcn__lane--6"><span class="efcn__piece efcn__piece--round efcn__piece--c1 efcn__piece--6"></span></span>
          <span class="efcn__lane efcn__lane--7"><span class="efcn__piece efcn__piece--rect efcn__piece--c3 efcn__piece--7"></span></span>
          <span class="efcn__lane efcn__lane--8"><span class="efcn__piece efcn__piece--strip efcn__piece--c4 efcn__piece--8"></span></span>
          <span class="efcn__lane efcn__lane--9"><span class="efcn__piece efcn__piece--rect efcn__piece--c1 efcn__piece--9"></span></span>
style.css
:root {
  --efcn-bg: #faf5ff;
  --efcn-text: #3b0764;
  --efcn-body: #581c87;
  --efcn-accent: #7e22ce;
  --efcn-on-accent: #ffffff;
  --efcn-c1: #a855f7;
  --efcn-c2: #f59e0b;
  --efcn-c3: #ec4899;
  --efcn-c4: #14b8a6;
  --demo-effet-confettis-bg: #fdfaff;
  --demo-effet-confettis-text: #3b0764;

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