Skip to content

Card framed on hover in WordPress

An offer card around which four frame corners slide into place on hover or keyboard focus.

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-coins-cadre-survol.php
<?php
/**
 * Plugin Name: Forge, Carte encadrée au survol
 * Description: Une carte d’offre autour de laquelle quatre coins de cadre glissent en place au survol ou au focus clavier. Ajoute la composition « Carte encadrée au survol » à 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-coins-cadre-survol
 *
pattern.html
<!-- wp:group {"tagName": "article", "className": "efcc", "layout": {"type": "default"}} -->
<article class="wp-block-group efcc"><!-- wp:html -->
<span class="efcc__corner efcc__corner--tl" aria-hidden="true"></span>
<!-- /wp:html -->
<!-- wp:html -->
<span class="efcc__corner efcc__corner--tr" aria-hidden="true"></span>
<!-- /wp:html -->
<!-- wp:html -->
<span class="efcc__corner efcc__corner--bl" aria-hidden="true"></span>
<!-- /wp:html -->
<!-- wp:html -->
<span class="efcc__corner efcc__corner--br" aria-hidden="true"></span>
style.css
:root {
  --efcc-card: #ffffff;
  --efcc-border: #e7e5e4;
  --efcc-text: #1c1917;
  --efcc-body: #57534e;
  --efcc-corner: #b45309;
  --efcc-accent: #1c1917;
  --efcc-on-accent: #ffffff;
  --efcc-shadow: rgb(28 25 23 / 0.18);
  --demo-effet-coins-cadre-survol-bg: #f5f5f4;
  --demo-effet-coins-cadre-survol-text: #1c1917;
}

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