Cursor-lit grid background in WordPress
A grid background whose cells light up around the mouse, under a blue glow that follows the pointer.
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, Grille lumineuse suivant le curseur
* Description: Un fond quadrillé dont les cellules s’allument autour de la souris, sous un halo bleu qui suit le pointeur. Ajoute la composition « Grille lumineuse suivant le curseur » à 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-fond-grille-lueur-curseur
*<!-- wp:html -->
<section class="efgc" aria-labelledby="efgc-titre" data-efgc>
<div aria-hidden="true" data-efgc-decor>
<span data-efgc-grid></span>
<span data-efgc-cell></span>
<span data-efgc-lit></span>
<span data-efgc-glow></span>
</div>
<div class="efgc__inner">
<p class="efgc__eyebrow">Cabinet Arpent · Géomètres-experts à Nantes</p>
<h2 class="efgc__title" id="efgc-titre">Vos limites de terrain, tracées au centimètre près</h2>
<p class="efgc__text">Bornage, division parcellaire et plan topographique pour les particuliers, les notaires et les promoteurs, avec un devis sous 48 heures.</p>(() => {
if (!document.querySelector(".efgc")) return;
document.querySelectorAll("[data-efgc]").forEach((zone) => {
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)");
const cell = zone.querySelector("[data-efgc-cell]");
let point = null;
let frame = 0;
const paint = () => {
frame = 0;
const box = zone.getBoundingClientRect();
const size = cell.getBoundingClientRect().width || 40;:root {
--demo-effet-fond-grille-lueur-curseur-bg: #eef1f6;
--demo-effet-fond-grille-lueur-curseur-text: #0f172a;
}
@media (prefers-color-scheme: dark) {
:root.forge-follows-system:not([data-theme="light"]) {
--demo-effet-fond-grille-lueur-curseur-bg: #05070d;
--demo-effet-fond-grille-lueur-curseur-text: #f1f5f9;
}
}
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