2D and 3D transforms - tilts, cubes, perspective and chained motion - driven only by hover and keyframes.
13D Card Tilt
Tilts a card in 3D with a moving glare on hover - a pure CSS take on the mouse-follow tilt. Class: fx-3d-card-tilt
Meet the makers behind our ceramics
$106.19
<div class="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<div class="card border-0 shadow-sm fx-3d-card-tilt" style="width:12rem">
<img src="https://images.unsplash.com/photo-1441984904996-e0b6ba687e04?auto=format&fit=crop&w=1200&h=800&q=70" alt="Card cover" class="card-img-top object-cover" style="height:100px">
<div class="card-body py-2">
<h3 class="h6 mb-0">Meet the makers behind our ceramics</h3>
<p class="small text-muted mb-0">$106.19</p>
</div>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-3d-card-tilt {
position: relative; overflow: hidden; transform-style: preserve-3d;
transform: perspective(900px) rotateX(0deg) rotateY(0deg);
transition: transform .55s cubic-bezier(.2, .8, .2, 1), box-shadow .55s;
}
.fx-3d-card-tilt::after {
content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 48%, transparent 62%);
transform: translateX(-60%); transition: transform .7s ease, opacity .4s;
}
.fx-3d-card-tilt:hover, .fx-3d-card-tilt:focus-within {
transform: perspective(900px) rotateX(8deg) rotateY(-12deg) translateY(-4px);
box-shadow: 18px 22px 40px -18px rgba(var(--wt-primary-rgb), .55);
}
.fx-3d-card-tilt:hover::after, .fx-3d-card-tilt:focus-within::after { opacity: 1; transform: translateX(60%); }
@media (prefers-reduced-motion: reduce) {
.fx-3d-card-tilt, .fx-3d-card-tilt::before, .fx-3d-card-tilt::after, .fx-3d-card-tilt *, .fx-3d-card-tilt *::before, .fx-3d-card-tilt *::after { animation: none !important; transition: none !important; }
}2Rotate 3D
A badge or tile that rocks around a diagonal axis with rotate3d() - eye-catching for feature icons. Class: fx-rotate-3d
<div class="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<div class="fx-rotate-3d rounded-xl text-bg-primary grid text-4xl shadow-md" style="width:96px;height:96px;place-items:center">
<i class="bi bi-layers-fill" aria-hidden="true"></i>
</div>
<div class="fx-rotate-3d rounded-xl border grid text-4xl text-primary-ink" style="width:96px;height:96px;place-items:center;animation-delay:-2s">
<i class="bi bi-stars" aria-hidden="true"></i>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-rotate-3d { animation: fx-rotate-3d-rock 4s ease-in-out infinite; }
.fx-rotate-3d:hover { animation-play-state: paused; }
@keyframes fx-rotate-3d-rock {
0%, 100% { transform: perspective(600px) rotate3d(1, 1, 0, 0deg); }
50% { transform: perspective(600px) rotate3d(1, 1, 0, 32deg); }
}
@media (prefers-reduced-motion: reduce) {
.fx-rotate-3d, .fx-rotate-3d::before, .fx-rotate-3d::after, .fx-rotate-3d *, .fx-rotate-3d *::before, .fx-rotate-3d *::after { animation: none !important; transition: none !important; }
}3Scale & Rotate
A springy scale-and-twist on hover for icons, avatars, logos and small buttons. Class: fx-scale-rotate
<div class="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<img src="../assets/img/avatar-4.svg" alt="Avatar" class="fx-scale-rotate rounded-full shadow-sm" style="width:72px;height:72px">
<button type="button" class="btn btn-primary btn-lg rounded-full fx-scale-rotate" aria-label="Favourite"><i class="bi bi-star-fill" aria-hidden="true"></i></button>
<img src="../assets/img/logo-3.svg" alt="Brand logo" class="fx-scale-rotate" style="width:110px">
</div>
/* CSS (already in assets/css/effects.css) */
.fx-scale-rotate { transition: transform .45s cubic-bezier(.34, 1.8, .64, 1); }
.fx-scale-rotate:hover, .fx-scale-rotate:focus-visible { transform: scale(1.15) rotate(-8deg); }
@media (prefers-reduced-motion: reduce) {
.fx-scale-rotate, .fx-scale-rotate::before, .fx-scale-rotate::after, .fx-scale-rotate *, .fx-scale-rotate *::before, .fx-scale-rotate *::after { animation: none !important; transition: none !important; }
}