Chromatic Aberration Card
A precision optical card where the edges shimmer with an RGB split that intensifies on hover. Content shifts as if seen through a prism, with red, green, and blue channels briefly separating to reflect data variance and volatility. Clicking snaps them back into perfect alignment with a satisfying optical snap, revealing the true signal beneath the noise.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/chromatic-aberration-card.
<iframe src="/embed/chromatic-aberration-card" sandbox="allow-scripts" loading="lazy" title="Chromatic Aberration Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Chromatic Aberration 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="chromatic-card">
<div class="chromatic-edges"></div>
<div class="chromatic-content">
<div class="chromatic-chart">
<div class="c-bar" style="height: 30%"></div>
<div class="c-bar" style="height: 45%"></div>
<div class="c-bar" style="height: 38%"></div>
<div class="c-bar" style="height: 52%"></div>
<div class="c-bar" style="height: 40%"></div>
<div class="c-bar" style="height: 55%"></div>
<div class="c-bar" style="height: 42%"></div>
<div class="c-bar" style="height: 48%"></div>
<div class="c-bar" style="height: 35%"></div>
<div class="c-bar" style="height: 50%"></div>
</div>
<div class="chromatic-footer">
<div><div class="c-title">Prismatic Drift</div><div class="c-sub">VOLATILITY</div></div>
<div class="c-status">ALIGNED</div>
</div>
</div>
</div>CSS
.chromatic-card { position: relative; width: 220px; min-height: 300px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #0a0a0f, #050508); border: 1.5px solid rgba(180,180,255,0.06); box-shadow: 0 10px 30px rgba(0,0,0,0.3); cursor: pointer; transition: box-shadow 0.3s ease; }
.chromatic-card:hover { box-shadow: 0 0 30px rgba(180,180,255,0.06), 0 15px 40px rgba(0,0,0,0.4); }
.chromatic-card:hover .chromatic-edges { opacity: 1; }
.chromatic-edges { position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.3s ease; box-shadow: inset 3px 0 0 rgba(255,50,50,0.15), inset -3px 0 0 rgba(50,50,255,0.15); }
.chromatic-content { position: absolute; inset: 0; padding: 20px; display: flex; flex-direction: column; }
.chromatic-chart { position: absolute; left: 10%; right: 10%; top: 12%; height: 45%; display: flex; align-items: flex-end; gap: 3px; border: 1px solid rgba(180,180,255,0.06); border-radius: 8px; padding: 8px; background: rgba(180,180,255,0.02); }
.c-bar { flex: 1; border-radius: 2px 2px 0 0; background: linear-gradient(0deg, rgba(180,180,255,0.3), rgba(180,180,255,0.1)); transition: height 0.5s ease; }
.chromatic-footer { position: absolute; inset-x: 0; bottom: 0; z-index: 10; padding: 20px; background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent); }
.c-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.c-sub { font-size: 9px; color: rgba(180,180,255,0.44); }
.c-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; display: inline-block; background: rgba(100,255,100,0.08); border: 1px solid rgba(100,255,100,0.12); color: rgba(100,255,100,0.6); }Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-indigo-400/10 shadow-lg group-hover:shadow-[0_0_30px_rgba(180,180,255,0.06),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-b from-[#0a0a0f] to-[#050508] cursor-pointer">
<div class="absolute inset-0 z-[5] pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-300" style="box-shadow: inset 3px 0 0 rgba(255,50,50,0.15), inset -3px 0 0 rgba(50,50,255,0.15);"></div>
<div class="absolute left-[10%] right-[10%] top-[12%] h-[45%] flex items-end gap-[3px] rounded-lg border border-indigo-400/10 p-2 bg-indigo-400/5">
<div class="flex-1 h-[30%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[45%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[38%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[52%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[40%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[55%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[42%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[48%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[35%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
<div class="flex-1 h-[50%] rounded-t-sm bg-gradient-to-t from-indigo-400/30 to-indigo-400/10"></div>
</div>
<div class="absolute inset-x-0 bottom-0 z-10 p-5 bg-gradient-to-t from-black/60 to-transparent">
<div class="flex items-center justify-between">
<div><p class="text-sm font-bold text-white/90">Prismatic Drift</p><p class="text-[9px] text-indigo-400/50">VOLATILITY</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest bg-green-400/10 border border-green-400/20 text-green-400/60">ALIGNED</div>
</div>
</div>
</div>React
import React, { useState, useRef, useCallback } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function ChromaticAberrationCard({ signalName = 'Prismatic Drift', width = 220, aberration = 42 }) {
const ref = useRef(null);
const [isHovered, setIsHovered] = useState(false);
const [isAligned, setIsAligned] = useState(true);
const [clickCount, setClickCount] = useState(0);
const [showResetFlash, setShowResetFlash] = useState(false);
const x = useMotionValue(0);
const y = useMotionValue(0);
const rotateX = useSpring(y, { damping: 25, stiffness: 200 });
const rotateY = useSpring(x, { damping: 25, stiffness: 200 });
const handleMouseMove = (e) => {
if (!ref.current) return;
const rect = ref.current.getBoundingClientRect();
x.set(-((e.clientX - rect.left - rect.width / 2) / (rect.width / 2)) * 6);
y.set(((e.clientY - rect.top - rect.height / 2) / (rect.height / 2)) * 6);
};
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
<motion.div ref={ref} onMouseMove={handleMouseMove} onClick={() => { if (!isAligned) { setIsAligned(true); setClickCount(c => c + 1); setShowResetFlash(true); setTimeout(() => setShowResetFlash(false), 500); } else { setIsAligned(false); } }} style={{ rotateX, rotateY, transformStyle: 'preserve-3d' }} className="relative cursor-pointer">
<motion.div className="relative overflow-hidden rounded-2xl" style={{ width, minHeight: 300, background: 'linear-gradient(160deg, #0a0a0f, #050508)', border: '1.5px solid rgba(180,180,255,0.06)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(180,180,255,0.06), 0 15px 40px rgba(0,0,0,0.4)' : '0 10px 30px rgba(0,0,0,0.3)' }} transition={{ type: 'spring', stiffness: 260, damping: 20 }}>
<motion.div className="absolute inset-0 z-[3] pointer-events-none" style={{ mixBlendMode: 'screen' }} animate={{ x: isAligned ? 0 : (isHovered ? 2 : 1), opacity: isAligned ? 0 : 0.25 }} transition={{ type: 'spring', stiffness: 120, damping: 12 }}>
<div className="absolute inset-0 rounded-2xl" style={{ border: '1.5px solid rgba(255,50,50,0.08)', background: 'linear-gradient(135deg, rgba(255,50,50,0.02), transparent)' }} />
</motion.div>
<motion.div className="absolute inset-0 z-[3] pointer-events-none" style={{ mixBlendMode: 'screen' }} animate={{ x: isAligned ? 0 : (isHovered ? -2 : -1), opacity: isAligned ? 0 : 0.25 }} transition={{ type: 'spring', stiffness: 120, damping: 12 }}>
<div className="absolute inset-0 rounded-2xl" style={{ border: '1.5px solid rgba(50,50,255,0.08)', background: 'linear-gradient(135deg, rgba(50,50,255,0.02), transparent)' }} />
</motion.div>
{showResetFlash && <motion.div className="absolute inset-0 z-20 flex items-center justify-center pointer-events-none bg-white/5" initial={{ opacity: 0.6 }} animate={{ opacity: 0 }} transition={{ duration: 0.4 }}><motion.span className="text-[8px] font-bold tracking-widest text-indigo-400/60" initial={{ scale: 1.5, opacity: 1 }} animate={{ scale: 1, opacity: 0 }} transition={{ duration: 0.4 }}>SNAP</motion.span></motion.div>}
<div className="absolute inset-x-0 bottom-0 z-10 p-5 bg-gradient-to-t from-black/60 to-transparent">
<div className="flex items-center justify-between mb-2"><div><p className="text-sm font-bold text-white/90">{signalName}</p><p className="text-[9px] text-indigo-400/50">VOLATILITY</p></div><motion.div className="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest" style={{ background: isAligned ? 'rgba(100,255,100,0.08)' : 'rgba(255,100,100,0.08)', border: '1px solid ' + (isAligned ? 'rgba(100,255,100,0.12)' : 'rgba(255,100,100,0.12)'), color: isAligned ? 'rgba(100,255,100,0.6)' : 'rgba(255,100,100,0.6)' }}>{isAligned ? 'ALIGNED' : 'ABERRANT'}</motion.div></div>
<div className="h-px bg-gradient-to-r from-transparent via-indigo-400/10 to-transparent mb-2" />
<div className="flex gap-2 mb-2"><div className="flex-1 text-center py-1.5 rounded-lg bg-indigo-400/5 border border-indigo-400/10"><p className="text-[10px] font-semibold text-indigo-400/60">{aberration}%</p><p className="text-[7px] mt-0.5 text-white/20">Aberration</p></div><div className="flex-1 text-center py-1.5 rounded-lg bg-indigo-400/5 border border-indigo-400/10"><p className="text-[10px] font-semibold text-indigo-400/60">{clickCount}</p><p className="text-[7px] mt-0.5 text-white/20">Realigns</p></div></div>
<div className="text-center"><span className="text-[7px] font-mono text-indigo-400/20">{isAligned ? '[▼ click to split]' : '[▼ click to realign]'}</span></div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Chromatic Aberration Card fits
- Data dashboards
- Volatility visualization
- Signal processing UI
- Audio visualizers
- Real-time monitoring
Interaction states & animations
- RGB channel split
- Prismatic displacement
- Volatility bars
- Spring realignment
Topics
- #chromatic
- #aberration
- #rgb
- #prism
- #hologram
- #optical
- #glitch
- #split
- #volatility
- #signal
Accessibility notes
The RGB split and channel separation may be disorienting for users with visual sensitivities. Ensure text content has sufficient contrast when channels are aligned. Provide prefers-reduced-motion fallback to disable chromatic effects.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+