Crystal Prism Card
A premium crystal card that refracts light like a diamond. Features multi-layer crystal, diamond reflections, prism lighting, and transparent bevels. The card rotates with rainbow refraction on hover and sparkles with animated particles.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/crystal-prism-card.
<iframe src="/embed/crystal-prism-card" sandbox="allow-scripts" loading="lazy" title="Crystal Prism Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Crystal Prism 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="crystal-prism-card">
<div class="crystal-facet-top"></div>
<div class="crystal-facet-side"></div>
<div class="crystal-refraction"></div>
<div class="crystal-content">
<div class="crystal-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="#a78bfa" stroke-width="1.5">
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
<path d="M2 17l10 5 10-5"/>
<path d="M2 12l10 5 10-5"/>
</svg>
</div>
<div class="crystal-text">
<div class="c-text-row"></div>
<div class="c-text-row short"></div>
</div>
<div class="crystal-price">$2,400</div>
<div class="crystal-stars">
<div class="c-star"></div>
<div class="c-star"></div>
<div class="c-star"></div>
<div class="c-star"></div>
<div class="c-star dim"></div>
</div>
<div class="crystal-tags">
<span class="c-tag">LUXURY</span>
<span class="c-tag cyan">PREMIUM</span>
</div>
</div>
</div>CSS
.crystal-prism-card {
position: relative;
width: 210px;
clip-path: polygon(12% 0%, 100% 0%, 100% 88%, 88% 100%, 0% 100%, 0% 12%);
border-radius: 20px;
overflow: hidden;
background: linear-gradient(145deg, rgba(20,20,40,0.95), rgba(10,10,25,0.98));
border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.crystal-prism-card:hover {
transform: translateY(-8px);
box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(168,85,247,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.crystal-facet-top {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 10;
background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 30%, rgba(255,255,255,0.02) 50%, transparent 70%, rgba(255,255,255,0.03) 100%);
clip-path: polygon(0% 0%, 30% 0%, 100% 70%, 100% 100%, 70% 100%, 0% 30%);
}
.crystal-facet-side {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 10;
background: linear-gradient(225deg, transparent 20%, rgba(255,255,255,0.03) 40%, transparent 60%);
clip-path: polygon(100% 0%, 100% 60%, 40% 100%, 0% 100%, 0% 40%, 60% 0%);
}
.crystal-refraction {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 20;
background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.06) 45%, transparent 60%);
transition: transform 1.5s ease;
}
.crystal-prism-card:hover .crystal-refraction {
transform: translateX(200%);
}
.crystal-content {
position: relative;
z-index: 30;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 16px;
}
.crystal-icon {
width: 56px;
height: 56px;
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
background: linear-gradient(135deg, #a78bfa, #7c3aed);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(168,85,247,0.2);
transition: all 0.3s ease;
}
.crystal-prism-card:hover .crystal-icon {
transform: scale(1.1) rotate(8deg);
box-shadow: 0 8px 25px rgba(168,85,247,0.4);
}
.crystal-icon svg {
width: 28px;
height: 28px;
color: white;
}
.crystal-text {
text-align: center;
}
.c-text-row {
height: 10px;
width: 80px;
border-radius: 4px;
margin: 0 auto 4px;
background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
}
.c-text-row.short {
width: 60px;
background: rgba(255,255,255,0.08);
}
.crystal-price {
font-size: 18px;
font-weight: 800;
background: linear-gradient(135deg, #a78bfa, #ec4899);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.crystal-stars {
display: flex;
gap: 4px;
}
.c-star {
width: 12px;
height: 12px;
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
background: #fbbf24;
}
.c-star.dim {
background: rgba(255,255,255,0.15);
}
.crystal-tags {
display: flex;
gap: 8px;
}
.c-tag {
height: 20px;
padding: 0 10px;
border-radius: 20px;
display: flex;
align-items: center;
font-size: 8px;
font-weight: 600;
letter-spacing: 0.5px;
color: #a78bfa;
background: rgba(168,85,247,0.12);
border: 1px solid rgba(168,85,247,0.2);
}
.c-tag.cyan {
color: #22d3ee;
background: rgba(6,182,212,0.1);
border-color: rgba(6,182,212,0.2);
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.crystal-prism-card {
animation: float 6s ease-in-out infinite;
}
.crystal-prism-card:hover {
animation: float 3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
.crystal-prism-card {
animation: none;
}
.crystal-refraction {
display: none;
}
}Tailwind CSS
<div class="group w-[210px] overflow-hidden bg-gradient-to-br from-[rgba(20,20,40,0.95)] to-[rgba(10,10,25,0.98)] border border-white/10 shadow-xl transition-all duration-500 hover:-translate-y-2 hover:shadow-[0_30px_60px_rgba(0,0,0,0.6),0_0_40px_rgba(168,85,247,0.2)]" style="clip-path: polygon(12% 0%, 100% 0%, 100% 88%, 88% 100%, 0% 100%, 0% 12%);">
<div class="absolute inset-0 pointer-events-none z-10" style="background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 30%, rgba(255,255,255,0.02) 50%, transparent 70%, rgba(255,255,255,0.03) 100%); clip-path: polygon(0% 0%, 30% 0%, 100% 70%, 100% 100%, 70% 100%, 0% 30%);"></div>
<div class="absolute inset-0 pointer-events-none z-10" style="background: linear-gradient(225deg, transparent 20%, rgba(255,255,255,0.03) 40%, transparent 60%); clip-path: polygon(100% 0%, 100% 60%, 40% 100%, 0% 100%, 0% 40%, 60% 0%);"></div>
<div class="group-hover:translate-x-[200%] absolute inset-0 pointer-events-none z-20 transition-transform duration-1000" style="background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.06) 45%, transparent 60%);"></div>
<div class="relative z-30 p-5 flex flex-col items-center text-center gap-4">
<div class="w-14 h-14 flex items-center justify-center bg-gradient-to-br from-purple-400 to-purple-600 shadow-lg group-hover:scale-110 group-hover:rotate-[8deg] group-hover:shadow-[0_8px_25px_rgba(168,85,247,0.4)] transition-all" style="clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);">
<svg class="w-7 h-7 text-white" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/>
</svg>
</div>
<div>
<div class="h-2.5 w-20 mx-auto rounded bg-gradient-to-r from-white/15 to-white/5 mb-1"></div>
<div class="h-2 w-15 mx-auto rounded bg-white/10"></div>
</div>
<div class="text-lg font-extrabold bg-gradient-to-r from-purple-400 to-pink-500 bg-clip-text text-transparent group-hover:scale-105 transition-transform">$2,400</div>
<div class="flex gap-1">
<div class="w-3 h-3" style="clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: #fbbf24;"></div>
<div class="w-3 h-3" style="clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: #fbbf24;"></div>
<div class="w-3 h-3" style="clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: #fbbf24;"></div>
<div class="w-3 h-3" style="clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: #fbbf24;"></div>
<div class="w-3 h-3" style="clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: rgba(255,255,255,0.15);"></div>
</div>
<div class="flex gap-2">
<span class="h-5 px-2.5 rounded-full flex items-center text-[8px] font-semibold tracking-wider text-purple-400 bg-purple-500/12 border border-purple-500/20">LUXURY</span>
<span class="h-5 px-2.5 rounded-full flex items-center text-[8px] font-semibold tracking-wider text-cyan-400 bg-cyan-500/10 border border-cyan-500/20">PREMIUM</span>
</div>
</div>
</div>React
import React, { useRef, useState } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function CrystalPrismCard() {
const ref = useRef<HTMLDivElement>(null);
const [isHovered, setIsHovered] = useState(false);
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 handleMouseMove = (e: React.MouseEvent) => {
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)) * 10);
y.set(((e.clientY - cy) / (rect.height / 2)) * 10);
};
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
<motion.div
className="absolute -inset-8 rounded-full -z-10 pointer-events-none"
animate={{
background: isHovered
? ['radial-gradient(circle, rgba(168,85,247,0.12), transparent 70%)', 'radial-gradient(circle, rgba(6,182,212,0.12), transparent 70%)', 'radial-gradient(circle, rgba(236,72,153,0.12), transparent 70%)', 'radial-gradient(circle, rgba(251,191,36,0.12), transparent 70%)', 'radial-gradient(circle, rgba(168,85,247,0.12), transparent 70%)']
: 'radial-gradient(circle, rgba(168,85,247,0.06), transparent 70%)',
filter: isHovered ? 'blur(30px)' : 'blur(20px)',
scale: isHovered ? 1.3 : 1,
}}
transition={{ duration: 3, repeat: isHovered ? Infinity : 0, ease: 'easeInOut' }}
/>
<motion.div ref={ref} onMouseMove={handleMouseMove} style={{ rotateX, rotateY, transformStyle: 'preserve-3d' }}>
<motion.div className="relative overflow-hidden"
style={{
width: 210, minHeight: 280,
borderRadius: 20,
background: 'linear-gradient(145deg, rgba(20,20,40,0.95), rgba(10,10,25,0.98))',
border: '1px solid rgba(255,255,255,0.08)',
clipPath: 'polygon(12% 0%, 100% 0%, 100% 88%, 88% 100%, 0% 100%, 0% 12%)',
boxShadow: isHovered ? '0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(168,85,247,0.2)' : '0 15px 35px rgba(0,0,0,0.4)',
}}
animate={{ y: isHovered ? -8 : 0 }}
transition={{ type: 'spring', stiffness: 300, damping: 20 }}
>
<div className="absolute inset-0 pointer-events-none z-10" style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 30%, rgba(255,255,255,0.02) 50%, transparent 70%, rgba(255,255,255,0.03) 100%)', clipPath: 'polygon(0% 0%, 30% 0%, 100% 70%, 100% 100%, 70% 100%, 0% 30%)' }} />
<div className="absolute inset-0 pointer-events-none z-10" style={{ background: 'linear-gradient(225deg, transparent 20%, rgba(255,255,255,0.03) 40%, transparent 60%)', clipPath: 'polygon(100% 0%, 100% 60%, 40% 100%, 0% 100%, 0% 40%, 60% 0%)' }} />
<motion.div className="absolute inset-0 pointer-events-none z-20" style={{ background: 'linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.06) 45%, transparent 60%)' }} animate={{ x: isHovered ? ['-100%', '200%'] : ['-100%', '-100%'] }} transition={{ x: isHovered ? { duration: 1.5, ease: 'easeInOut' } : { duration: 0 } }} />
<div className="relative z-30 p-5 flex flex-col items-center text-center gap-3">
<motion.div className="w-14 h-14 flex items-center justify-center" style={{ clipPath: 'polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)', background: 'linear-gradient(135deg, #a78bfa, #7c3aed)', boxShadow: isHovered ? '0 8px 25px rgba(168,85,247,0.4)' : '0 4px 12px rgba(168,85,247,0.2)' }} animate={isHovered ? { rotate: [0, 8, -8, 0], scale: [1, 1.1, 1] } : { rotate: 0, scale: 1 }} transition={{ duration: 0.7, ease: 'easeInOut' }}>
<svg className="w-7 h-7 text-white" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M12 2L2 7l10 5 10-5-10-5z" /><path d="M2 17l10 5 10-5" /><path d="M2 12l10 5 10-5" /></svg>
</motion.div>
<div>
<div className="h-2.5 w-20 mx-auto rounded bg-gradient-to-r from-white/15 to-white/5 mb-1" />
<div className="h-2 w-15 mx-auto rounded bg-white/10" />
</div>
<div className="text-lg font-extrabold bg-gradient-to-r from-purple-400 to-pink-500 bg-clip-text text-transparent">$2,400</div>
<div className="flex gap-2">
<span className="h-5 px-2.5 rounded-full flex items-center text-[8px] font-semibold tracking-wider text-purple-400 bg-purple-500/12 border border-purple-500/20">LUXURY</span>
<span className="h-5 px-2.5 rounded-full flex items-center text-[8px] font-semibold tracking-wider text-cyan-400 bg-cyan-500/10 border border-cyan-500/20">PREMIUM</span>
</div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Crystal Prism Card fits
- Luxury Products
- Finance
- Jewelry
- Premium Products
- High-End Brands
- Luxury Dashboards
Interaction states & animations
- Crystal shine
- Rainbow sweep
- Floating
- Prism rotation
Topics
- #crystal
- #prism
- #diamond
- #luxury
- #premium
- #glass
- #refraction
- #rainbow
- #sparkle
- #elegant
Accessibility notes
Crystal effects and rainbow animations may be distracting for some users. Provide prefers-reduced-motion support. Ensure text contrast is sufficient on crystal surfaces. All interactive areas should remain keyboard accessible.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+