Skip to content

Rotating sunburst background in WordPress

An announcement set on sun rays that slowly turn from the centre, fading towards the edges.

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-rayons-tournants.php
<?php
/**
 * Plugin Name: Forge, Fond à rayons tournants
 * Description: Une annonce posée sur des rayons de soleil qui tournent lentement depuis le centre, fondus vers les bords. Ajoute la composition « Fond à rayons tournants » à 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-rayons-tournants
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "efrt", "layout": {"type": "default"}} -->
<section class="wp-block-group efrt"><!-- wp:html -->
<span class="efrt__rays" aria-hidden="true"></span>
<!-- /wp:html -->
<!-- wp:paragraph {"className": "efrt__eyebrow"} -->
<p class="efrt__eyebrow">Grand jeu de l’été · Office de tourisme de Biarritz</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "efrt__title", "anchor": "efrt-titre"} -->
<h2 class="wp-block-heading efrt__title" id="efrt-titre">Gagnez un week-end pour deux face à l’océan</h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "efrt__text"} -->
<p class="efrt__text">Deux nuits en chambre vue mer, un cours de surf et un dîner au port. Tirage au sort le 31 août, participation gratuite.</p>
style.css
:root {
  --efrt-bg: #fef3c7;
  --efrt-ray: #fde68a;
  --efrt-text: #1c1408;
  --efrt-body: #57431c;
  --efrt-accent: #9a3412;
  --efrt-on-accent: #ffffff;
  --demo-effet-rayons-tournants-bg: #fffbeb;
  --demo-effet-rayons-tournants-text: #1c1408;
}

@media (prefers-color-scheme: dark) {

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