Skip to content

Liquid glass card in 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.

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-liquid-glass-carte-refraction.php
<?php
/**
 * Plugin Name: Forge, Carte verre liquide
 * Description: Une carte translucide au flou sursaturé, dont le bord plus net réfracte les formes colorées qui passent derrière, avec un repli opaque si la transparence est réduite. Ajoute la composition « Carte verre liquide » à 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-liquid-glass-carte-refraction
 *
pattern.html
<!-- wp:html -->
<section class="eflg" aria-labelledby="eflg-titre" lang="fr">
        <div class="eflg__scene" data-eflg-scene aria-hidden="true">
          <span class="eflg__blob eflg__blob--1"></span>
          <span class="eflg__blob eflg__blob--2"></span>
          <span class="eflg__blob eflg__blob--3"></span>
          <span class="eflg__blob eflg__blob--4"></span>
          <span class="eflg__blob eflg__blob--5"></span>
        </div>
        <article class="eflg__glass">
          <span class="eflg__pane" data-eflg-pane aria-hidden="true"></span>
          <div class="eflg__content">
style.css
:root {
  --eflg-bg1: #f4f1ff;
  --eflg-bg2: #ffeef0;
  --eflg-line: rgba(60, 40, 140, 0.08);
  --eflg-b1: #ff7a59;
  --eflg-b2: #4f7dff;
  --eflg-b3: #1fb894;
  --eflg-b4: #ffc23d;
  --eflg-b5: #b56cff;
  --eflg-tint: rgba(255, 255, 255, 0.42);
  --eflg-solid: #fbfaff;
  --eflg-border: #c9c1ee;

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 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
  • A row of cards where the hovered card lights up with a halo that follows the mouse and brightens its edge closest to the pointer.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component