Hall of Mirrors Card
A single central figure reflected infinitely into a dark, smoky abyss. Each reflection is a past version or variation of related content. Hovering over a reflection sharpens it while dimming others. Clicking steps into that reflection, making it the new central figure. A disorienting, elegant depth effect that creates a maze of self-similar content.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/hall-of-mirrors-card.
<iframe src="/embed/hall-of-mirrors-card" sandbox="allow-scripts" loading="lazy" title="Hall of Mirrors Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Hall of Mirrors Card, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<div class="mirror-card" onclick="cycleMirror(this)">
<div class="mirror-fog"></div>
<div class="mirror-reflections">
<div class="mirror-figure depth-0" data-figure="0"><div class="mirror-dot"></div></div>
<div class="mirror-figure depth-1" data-figure="1"><div class="mirror-dot"></div></div>
<div class="mirror-figure depth-2" data-figure="2"><div class="mirror-dot"></div></div>
<div class="mirror-figure depth-3" data-figure="3"><div class="mirror-dot"></div></div>
<div class="mirror-figure depth-4" data-figure="4"><div class="mirror-dot"></div></div>
<div class="mirror-figure depth-5" data-figure="5"><div class="mirror-dot"></div></div>
</div>
<div class="mirror-content">
<div class="mirror-header">
<div><div class="mirror-title">Hall of Mirrors</div><div class="mirror-sub" id="mirror-sub">Original</div></div>
<div class="mirror-status">6 Reflections</div>
</div>
<div class="mirror-divider"></div>
<div class="mirror-grid">
<div class="mirror-stat"><div class="mirror-stat-val">6</div><div class="mirror-stat-lbl">Reflections</div></div>
<div class="mirror-stat"><div class="mirror-stat-val">∞</div><div class="mirror-stat-lbl">Depth</div></div>
</div>
<div class="mirror-hint" id="mirror-hint">[▼ click a reflection to enter]</div>
</div>
</div>
<script>
const labels = ['Original', 'Past Echo', 'Mirror Twin', 'Shadow Self', 'Future Glimpse', 'Distorted Copy'];
let mirrorIdx = 0;
function cycleMirror(el) {
mirrorIdx = (mirrorIdx + 1) % 6;
document.getElementById('mirror-sub').textContent = labels[mirrorIdx];
}
</script>CSS
.mirror-card {
position: relative;
width: 220px;
min-height: 300px;
border-radius: 16px;
overflow: hidden;
background: linear-gradient(160deg, #0c0814, #08040e, #04020a);
border: 1.5px solid rgba(167,139,250,0.08);
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
cursor: pointer;
transition: box-shadow 0.4s ease;
}
.mirror-card:hover {
box-shadow: 0 0 40px rgba(167,139,250,0.05), 0 15px 40px rgba(0,0,0,0.5);
}
.mirror-fog {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 1;
background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.3) 70%);
}
.mirror-reflections {
position: absolute;
inset: 0;
z-index: 3;
}
.mirror-figure {
position: absolute;
left: 50%;
transform: translateX(-50%);
pointer-events: auto;
cursor: pointer;
}
.mirror-dot {
width: 24px;
height: 24px;
border-radius: 50%;
background: radial-gradient(circle at 40% 35%, #a78bfa, #7c3aed);
box-shadow: 0 0 10px rgba(167,139,250,0.2);
margin: 0 auto;
}
.mirror-card:hover .depth-0 { top: 30%; }
.mirror-card:hover .depth-1 { top: 33%; transform: translateX(-50%) scale(0.88); opacity: 0.31; }
.mirror-card:hover .depth-2 { top: 36%; transform: translateX(-50%) scale(0.76); opacity: 0.27; }
.mirror-card:hover .depth-3 { top: 39%; transform: translateX(-50%) scale(0.64); opacity: 0.23; }
.mirror-card:hover .depth-4 { top: 42%; transform: translateX(-50%) scale(0.52); opacity: 0.19; }
.mirror-card:hover .depth-5 { top: 45%; transform: translateX(-50%) scale(0.4); opacity: 0.15; }
.mirror-content {
position: absolute;
inset-x: 0;
bottom: 0;
z-index: 10;
padding: 16px;
padding-top: 48px;
display: flex;
flex-direction: column;
gap: 8px;
background: linear-gradient(0deg, rgba(0,0,0,0.7) 30%, transparent);
}
.mirror-header { display: flex; justify-content: space-between; align-items: center; }
.mirror-title { font-size: 14px; font-weight: 700; color: rgba(230,220,255,0.9); }
.mirror-sub { font-size: 9px; color: rgba(167,139,250,0.44); }
.mirror-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #a78bfa; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.12); }
.mirror-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(167,139,250,0.12), transparent); }
.mirror-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mirror-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(167,139,250,0.03); border: 1px solid rgba(167,139,250,0.08); }
.mirror-stat-val { font-size: 10px; font-weight: 600; color: #a78bfa; }
.mirror-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.mirror-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(167,139,250,0.2); }
@media (prefers-reduced-motion: reduce) {
.mirror-card { transition: none; }
}Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-purple-400/20 shadow-lg group-hover:shadow-[0_0_40px_rgba(167,139,250,0.05),0_15px_40px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#0c0814] via-[#08040e] to-[#04020a] cursor-pointer">
<div class="absolute inset-0 pointer-events-none z-1" style="background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.3) 70%);"></div>
<div class="absolute top-[30%] left-1/2 -translate-x-1/2 z-[3] w-20 h-20 rounded-lg border border-purple-400/20 bg-gradient-to-br from-purple-500/10 to-black/30 shadow-[0_0_20px_rgba(167,139,250,0.1)] flex items-center justify-center"><div class="w-7 h-7 rounded-full bg-gradient-radial from-purple-400 to-purple-600 shadow-[0_0_15px_rgba(167,139,250,0.3)]"></div></div>
<div class="absolute inset-x-0 bottom-0 z-10 p-4 pt-12 space-y-2 bg-gradient-to-t from-black/70 via-transparent">
<div class="flex items-center justify-between">
<div><p class="text-sm font-bold text-purple-100/90">Hall of Mirrors</p><p class="text-[9px] text-purple-400/50">Original</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-purple-400 bg-purple-500/10 border border-purple-500/20">6 Reflections</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-purple-400/20 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-1.5 rounded-lg bg-purple-500/10 border border-purple-500/20"><p class="text-[10px] font-semibold text-purple-400">6</p><p class="text-[7px] mt-0.5 text-white/20">Reflections</p></div>
<div class="text-center py-1.5 rounded-lg bg-purple-500/10 border border-purple-500/20"><p class="text-[10px] font-semibold text-purple-400">∞</p><p class="text-[7px] mt-0.5 text-white/20">Depth</p></div>
</div>
<div class="text-center"><span class="text-[7px] font-mono text-purple-400/30">[▼ click a reflection to enter]</span></div>
</div>
</div>React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring, AnimatePresence } from 'framer-motion';
export function HallOfMirrorsCard() {
const [isHovered, setIsHovered] = useState(false);
const [centralIdx, setCentralIdx] = useState(0);
const [hoveredIdx, setHoveredIdx] = useState(null);
const ref = useRef(null);
const x = useMotionValue(0);
const y = useMotionValue(0);
const rotateX = useSpring(y, { damping: 25, stiffness: 250 });
const rotateY = useSpring(x, { damping: 25, stiffness: 250 });
const labels = ['Original', 'Past Echo', 'Mirror Twin', 'Shadow Self', 'Future Glimpse', 'Distorted Copy'];
const reflections = Array.from({ length: 6 }, (_, i) => ({ id: i, depth: i, scale: 1 - i * 0.12, opacity: 0.35 - i * 0.04, hueShift: i * 15 }));
const handleMouseMove = (e) => {
if (!ref.current) return;
const rect = ref.current.getBoundingClientRect();
const cx = rect.left + rect.width / 2;
const cy = rect.top + rect.height / 2;
x.set(-((e.clientX - cx) / (rect.width / 2)) * 12);
y.set(((e.clientY - cy) / (rect.height / 2)) * 12);
};
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); setHoveredIdx(null); }}>
<motion.div ref={ref} onMouseMove={handleMouseMove} style={{ rotateX, rotateY, transformStyle: 'preserve-3d', perspective: 800 }} className="relative cursor-pointer">
<motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #0c0814, #08040e, #04020a)', border: '1.5px solid rgba(167,139,250,0.08)' }}
animate={{ boxShadow: isHovered ? '0 0 40px rgba(167,139,250,0.05), 0 15px 40px rgba(0,0,0,0.5)' : '0 10px 30px rgba(0,0,0,0.4)' }} transition={{ type: 'spring', stiffness: 280, damping: 20 }}>
{reflections.map((r) => {
const isCentral = r.id === centralIdx;
const isHover = hoveredIdx === r.id;
return (
<motion.div key={r.id} className="absolute" style={{ left: '50%', top: `${30 + r.depth * 3}%`, x: '-50%' }}
onClick={() => setCentralIdx(r.id)}
onMouseEnter={() => setHoveredIdx(r.id)}
onMouseLeave={() => setHoveredIdx(null)}
animate={isCentral ? { scale: 1, opacity: 1, filter: 'brightness(1)' } : { scale: isHover ? r.scale + 0.1 : r.scale, opacity: isHover ? 0.8 : r.opacity, filter: isHover ? 'brightness(1)' : `brightness(0.6) hue-rotate(${r.hueShift}deg)` }}
transition={{ type: 'spring', stiffness: 200, damping: 20 }}>
<div className="rounded-lg overflow-hidden flex items-center justify-center" style={{ width: isCentral ? 80 : 70 - r.depth * 4, height: isCentral ? 80 : 70 - r.depth * 4, border: `1px solid rgba(167,139,250,${isHover ? '0.27' : '0.09'})`, background: `linear-gradient(135deg, rgba(167,139,250,${isCentral ? '0.09' : '0.03'}), rgba(0,0,0,0.3))`, boxShadow: isCentral ? '0 0 20px rgba(167,139,250,0.1)' : 'none' }}>
<div className="rounded-full" style={{ width: isCentral ? 30 : 24 - r.depth * 1.5, height: isCentral ? 30 : 24 - r.depth * 1.5, background: isCentral ? 'radial-gradient(circle at 40% 35%, #a78bfa, #7c3aed)' : `radial-gradient(circle at 40% 35%, hsl(${r.hueShift}, 70%, 60%), hsl(${r.hueShift}, 50%, 30%))`, boxShadow: isCentral ? '0 0 15px rgba(167,139,250,0.3)' : 'none' }} />
</div>
{isHover && <motion.p className="text-[6px] font-mono text-center mt-1" style={{ color: 'rgba(167,139,250,0.5)' }} initial={{ opacity: 0 }} animate={{ opacity: 1 }}>{labels[r.id]}</motion.p>}
</motion.div>
);
})}
<div className="absolute inset-x-0 bottom-0 z-10 p-4 pt-12 space-y-2" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.7) 30%, transparent)' }}>
<div className="space-y-1" style={{ transform: 'translateZ(20px)' }}>
<p className="text-sm font-bold" style={{ color: 'rgba(230,220,255,0.9)' }}>Hall of Mirrors</p>
<p className="text-[9px]" style={{ color: 'rgba(167,139,250,0.44)' }}>{labels[centralIdx]}</p>
</div>
<div className="grid grid-cols-2 gap-2" style={{ transform: 'translateZ(15px)' }}>
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(167,139,250,0.03)', border: '1px solid rgba(167,139,250,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#a78bfa' }}>6</p><p className="text-[7px] text-white/20">Reflections</p></div>
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(167,139,250,0.03)', border: '1px solid rgba(167,139,250,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#a78bfa' }}>∞</p><p className="text-[7px] text-white/20">Depth</p></div>
</div>
<div className="text-center"><span className="text-[7px] font-mono" style={{ color: 'rgba(167,139,250,0.2)' }}>[▼ click a reflection to enter]</span></div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Hall of Mirrors Card fits
- Portfolio
- Galleries
- Identity
- Multiverse
- Narrative
- Collections
Interaction states & animations
- Fog drift
- Scale depth
- Reflection sharpen
- Hue shift
- Central pulse
Topics
- #mirror
- #reflection
- #infinite
- #depth
- #abyss
- #smoky
- #elegant
- #dark
- #maze
- #identity
Accessibility notes
Depth perception effects may be disorienting. Provide prefers-reduced-motion fallback to collapse reflections. Text contrast should be maintained across all depths.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+