3D tilt card on hover in HTML and CSS
Each card pivots in perspective towards the hovered area, with a glare and a cast shadow that follow the mouse.
Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.
This component also comes in
The code in HTML and CSS
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Carte qui s’incline en 3D au survol</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="demo">
<section class="efci" aria-labelledby="efci-titre" data-efci>
<header class="efci__head">:root {
--efci-bg: #f1e8dc;
--efci-card: #fffaf3;
--efci-line: #e2d3c1;
--efci-text: #2a1d14;
--efci-body: #5b4636;
--efci-accent: #9a3412;
--efci-shine: rgb(255 255 255 / 0.7);
--efci-cast: rgb(91 52 26 / 0.4);
--efci-tilt: 10deg;
--efci-depth: 50rem;
--efci-radius: 1.25rem;document.querySelectorAll("[data-efci]").forEach((zone) => {
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)");
const clamp = (value) => Math.max(-1, Math.min(1, value));
zone.querySelectorAll("[data-efci-item]").forEach((item) => {
let point = null;
let frame = 0;
const paint = () => {
frame = 0;
const box = item.getBoundingClientRect();
item.style.setProperty("--efci-tx", clamp(((point.x - box.left) / box.width) * 2 - 1).toFixed(3));Free component: copy it freely, including for commercial projects.
Other visual effects components in HTML and CSS
Visual effects components in HTML and CSS
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