Memory Capsule Card
A futuristic time capsule card that stores and preserves memories. Floating capsule with transparent shell, floating particles, and soft ambient glow.
Memory Capsule Card
by FreeCsStyles Dev's
CardsMemory Capsule
🌐HTML/CSS🎨Tailwind⚛️React
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/memory-capsule-card.
<iframe src="/embed/memory-capsule-card" sandbox="allow-scripts" loading="lazy" title="Memory Capsule Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Memory Capsule 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="capsule-card" onclick="this.classList.toggle('opened')">
<div class="capsule-ambient"></div>
<div class="capsule-shell">
<div class="capsule-lid">💊</div>
<div class="capsule-inner">
<div class="capsule-memories">
<span>🌊</span><span>🌴</span><span>🐠</span><span>🍹</span>
</div>
</div>
</div>
<div class="capsule-content">
<div class="capsule-header">
<div>
<div class="capsule-title">Summer '26</div>
<div class="capsule-date">July 24, 2026</div>
</div>
<div class="capsule-icon">⏳</div>
</div>
<div class="capsule-divider"></div>
<div class="capsule-grid">
<div class="capsule-stat"><div class="capsule-val">Photograph</div><div class="capsule-lbl">Type</div></div>
<div class="capsule-stat"><div class="capsule-val">Maldives</div><div class="capsule-lbl">Location</div></div>
</div>
<div class="capsule-hint">[✦ TAP TO OPEN ✦]</div>
</div>
</div>CSS
.capsule-card {
position: relative;
width: 220px;
min-height: 300px;
border-radius: 16px;
overflow: hidden;
background: linear-gradient(160deg, #1a1408, #120e06);
border: 1.5px solid rgba(251,191,36,0.15);
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
cursor: pointer;
transition: all 0.4s ease;
}
.capsule-card:hover {
box-shadow: 0 0 30px rgba(251,191,36,0.08), 0 15px 40px rgba(0,0,0,0.4);
}
.capsule-ambient {
position: absolute;
inset: 0;
pointer-events: none;
transition: background 0.8s;
}
.capsule-card:hover .capsule-ambient {
background: radial-gradient(ellipse at 50% 50%, rgba(251,191,36,0.08), transparent 70%);
}
.capsule-shell {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100px;
height: 140px;
border-radius: 50px;
pointer-events: none;
border: 2px solid rgba(251,191,36,0.15);
background: linear-gradient(180deg, rgba(251,191,36,0.06), rgba(251,191,36,0.12), rgba(251,191,36,0.06));
box-shadow: inset 0 0 20px rgba(251,191,36,0.08);
}
.capsule-lid {
position: absolute;
top: -4px;
left: 50%;
transform: translateX(-50%);
width: 102px;
height: 35px;
border-radius: 50px 50px 0 0;
border: 2px solid rgba(251,191,36,0.15);
background: linear-gradient(160deg, #1a1408, #120e06);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
transform-origin: bottom center;
}
.capsule-card.opened .capsule-lid {
transform: translateX(-50%) rotateX(-90deg) translateY(-20px);
}
.capsule-inner {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
.capsule-memories {
display: flex;
gap: 6px;
font-size: 14px;
}
.capsule-card.opened .capsule-memories {
display: none;
}
.capsule-content {
position: relative;
z-index: 10;
padding: 20px;
display: flex;
flex-direction: column;
gap: 8px;
height: 100%;
justify-content: flex-end;
}
.capsule-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.capsule-title {
font-size: 14px;
font-weight: 700;
color: rgba(255,255,255,0.9);
}
.capsule-date {
font-size: 9px;
color: rgba(251,191,36,0.5);
}
.capsule-icon {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
border: 2px solid rgba(251,191,36,0.15);
animation: pulse 2s ease-in-out infinite;
}
.capsule-card:hover .capsule-icon {
border-color: #fbbf24;
scale: 1.08;
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.08); }
}
.capsule-divider {
height: 1px;
background: linear-gradient(90deg, transparent, rgba(251,191,36,0.15), transparent);
}
.capsule-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.capsule-stat {
text-align: center;
padding: 8px 4px;
border-radius: 8px;
background: rgba(251,191,36,0.08);
border: 1px solid rgba(251,191,36,0.15);
}
.capsule-val {
font-size: 11px;
font-weight: 700;
color: #fbbf24;
}
.capsule-lbl {
font-size: 7px;
margin-top: 2px;
color: rgba(255,255,255,0.25);
}
.capsule-hint {
text-align: center;
font-size: 7px;
letter-spacing: 0.1em;
color: rgba(251,191,36,0.3);
}
.capsule-card:hover .capsule-hint {
animation: hintGlow 2s ease-in-out infinite;
}
@keyframes hintGlow {
0%, 100% { opacity: 0.3; }
50% { opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
.capsule-card { transition: none; }
.capsule-lid { transition: none; }
.capsule-icon { animation: none; }
.capsule-card:hover .capsule-icon { scale: 1; }
.capsule-card:hover .capsule-hint { animation: none; }
}Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-amber-400/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(251,191,36,0.08),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-br from-[#1a1408] to-[#120e06] cursor-pointer">
<div class="absolute inset-0 pointer-events-none group-hover:bg-[radial-gradient(ellipse_at_50%_50%,rgba(251,191,36,0.08),transparent_70%)]"></div>
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[100px] h-[140px] rounded-[50px] pointer-events-none border-2 border-amber-400/20 bg-gradient-to-b from-amber-400/10 to-amber-400/15 to-amber-400/10 shadow-[inset_0_0_20px_rgba(251,191,36,0.08)]">
<div class="absolute -top-1 left-1/2 -translate-x-1/2 w-[102px] h-[35px] rounded-[50px_50px_0_0] border-2 border-amber-400/20 bg-gradient-to-br from-[#1a1408] to-[#120e06] flex items-center justify-center text-2xl transition-all duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] origin-bottom group-hover:rotate-x-[-90deg] group-hover:-translate-y-5">💊</div>
<div class="absolute inset-0 flex items-center justify-center group-hover:hidden"><div class="text-2xl">💊</div></div>
</div>
<div class="relative z-10 p-5 space-y-2 flex flex-col justify-end min-h-[300px]">
<div class="flex items-center justify-between">
<div><p class="text-sm font-bold text-white/90">Summer '26</p><p class="text-[9px] text-amber-400/50">July 24, 2026</p></div>
<div class="w-10 h-10 rounded-full flex items-center justify-center text-base border-2 border-amber-400/20 group-hover:border-amber-400 group-hover:scale-105 transition-all duration-300">⏳</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-amber-400/20 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-2 rounded-lg bg-amber-400/10 border border-amber-400/20"><p class="text-[11px] font-bold text-amber-400">Photograph</p><p class="text-[7px] mt-0.5 text-white/25">Type</p></div>
<div class="text-center py-2 rounded-lg bg-amber-400/10 border border-amber-400/20"><p class="text-[11px] font-bold text-amber-400">Maldives</p><p class="text-[7px] mt-0.5 text-white/25">Location</p></div>
</div>
<div class="text-center"><span class="text-[7px] tracking-widest text-amber-400/50">[✦ TAP TO OPEN ✦]</span></div>
</div>
</div>React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function MemoryCapsuleCard() {
const [isHovered, setIsHovered] = useState(false);
const [isClicked, setIsClicked] = useState(false);
const ref = useRef(null);
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();
const cx = rect.left + rect.width / 2;
const cy = rect.top + rect.height / 2;
x.set(-((e.clientX - cx) / (rect.width / 2)) * 6);
y.set(((e.clientY - cy) / (rect.height / 2)) * 6);
};
const memories = [{ icon: '🌊', label: 'Beach Sunset' }, { icon: '🌴', label: 'Palm Walk' }, { icon: '🐠', label: 'Reef Dive' }, { icon: '🍹', label: 'Cocktail Hour' }];
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
<motion.div ref={ref} onMouseMove={handleMouseMove} onClick={() => setIsClicked(!isClicked)} style={{ rotateX, rotateY, transformStyle: 'preserve-3d', cursor: 'pointer' }}>
<motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #1a1408, #120e06)', border: '1.5px solid rgba(251,191,36,0.15)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(251,191,36,0.08), 0 15px 40px rgba(0,0,0,0.4)' : '0 10px 30px rgba(0,0,0,0.3)' }} transition={{ type: 'spring', stiffness: 280, damping: 20 }}>
<motion.div className="absolute inset-0 pointer-events-none" animate={{ background: isHovered ? 'radial-gradient(ellipse at 50% 50%, rgba(251,191,36,0.08), transparent 70%)' : 'transparent' }} transition={{ duration: 0.8 }} />
{isHovered && [...Array(8)].map((_, i) => (
<motion.div key={i} className="absolute w-1 h-1 rounded-full pointer-events-none" style={{ background: '#fbbf24', opacity: 0.4 }}
initial={{ x: `${20 + Math.random() * 60}%`, y: `${20 + Math.random() * 60}%`, scale: 0 }}
animate={{ y: [0, -30 - i * 5], opacity: [0.4, 0], scale: [1, 0] }} transition={{ duration: 2 + i * 0.3, repeat: Infinity, delay: i * 0.25, ease: 'easeOut' }} />
))}
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[100px] h-[140px] rounded-[50px] pointer-events-none" style={{ border: '2px solid rgba(251,191,36,0.15)', background: 'linear-gradient(180deg, rgba(251,191,36,0.06), rgba(251,191,36,0.12), rgba(251,191,36,0.06))', boxShadow: 'inset 0 0 20px rgba(251,191,36,0.08)' }}>
<motion.div className="absolute -top-1 left-1/2 -translate-x-1/2 w-[102px] h-[35px] rounded-[50px_50px_0_0]" style={{ border: '2px solid rgba(251,191,36,0.15)', background: 'linear-gradient(160deg, #1a1408, #120e06)', transformOrigin: 'bottom center' }}
animate={isClicked ? { rotateX: -90, y: -20 } : { rotateX: 0, y: 0 }} transition={{ type: 'spring', stiffness: 200, damping: 18 }} />
{isClicked ? (
<div className="absolute inset-0 flex items-center justify-center"><motion.p className="text-[7px] tracking-widest" style={{ color: '#fbbf24' }} initial={{ scale: 0 }} animate={{ scale: 1 }} transition={{ delay: 0.2, type: 'spring' }}>OPENED</motion.p></div>
) : (
<div className="absolute inset-0 flex items-center justify-center">{isHovered && <motion.div className="text-2xl" animate={{ scale: [1, 1.1, 1] }} transition={{ duration: 2, repeat: Infinity }}>💊</motion.div>}</div>
)}
</div>
{isHovered && memories.map((mem, i) => (
<motion.div key={mem.label} className="absolute pointer-events-none flex items-center gap-1" style={{ left: `${15 + i * 18}%`, top: `${50 + (i % 2 === 0 ? -20 : 10)}%` }}
initial={{ opacity: 0, scale: 0.5 }} animate={{ opacity: [0, 1, 0], scale: [0.5, 1, 0.5], x: [0, (i % 2 === 0 ? 1 : -1) * (15 + i * 5)], y: [0, -20 - i * 8] }}
transition={{ duration: 3, repeat: Infinity, delay: i * 0.4, ease: 'easeInOut' }}>
<span className="text-[10px]">{mem.icon}</span><span className="text-[5px]" style={{ color: '#fbbf24' }}>{mem.label}</span>
</motion.div>
))}
{isHovered && (
<div className="absolute bottom-[18%] left-[15%] right-[15%] flex items-end gap-[2px] h-6 pointer-events-none">
{[3, 6, 4, 8, 5, 10, 6, 8, 4, 7, 5, 3].map((h, i) => (
<motion.div key={i} className="flex-1 rounded-t-sm" style={{ background: '#fbbf24', opacity: 0.3 }}
animate={{ height: [`${h * 2}px`, `${(h + (i % 3 === 0 ? 4 : -2)) * 2}px`, `${h * 2}px`] }}
transition={{ duration: 0.8 + i * 0.05, repeat: Infinity, ease: 'easeInOut', delay: i * 0.06 }} />
))}
</div>
)}
<div className="relative z-10 p-5 space-y-2">
<div className="flex items-center justify-between">
<div><p className="text-sm font-bold text-white/90">Summer '26</p><p className="text-[9px]" style={{ color: 'rgba(251,191,36,0.5)' }}>July 24, 2026</p></div>
<motion.div className="w-10 h-10 rounded-full flex items-center justify-center" style={{ border: '2px solid rgba(251,191,36,0.15)' }}
animate={isHovered ? { scale: [1, 1.08, 1], borderColor: ['rgba(251,191,36,0.15)', '#fbbf24', 'rgba(251,191,36,0.15)'] } : {}} transition={{ duration: 2, repeat: isHovered ? Infinity : 0 }}>
<span className="text-base">⏳</span>
</motion.div>
</div>
<div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(251,191,36,0.15), transparent)' }} />
<div className="grid grid-cols-2 gap-2">
<div className="text-center py-2 rounded-lg" style={{ background: 'rgba(251,191,36,0.08)', border: '1px solid rgba(251,191,36,0.15)' }}>
<p className="text-[11px] font-bold" style={{ color: '#fbbf24' }}>Photograph</p><p className="text-[7px] mt-0.5 text-white/25">Type</p>
</div>
<div className="text-center py-2 rounded-lg" style={{ background: 'rgba(251,191,36,0.08)', border: '1px solid rgba(251,191,36,0.15)' }}>
<p className="text-[11px] font-bold" style={{ color: '#fbbf24' }}>Maldives</p><p className="text-[7px] mt-0.5 text-white/25">Location</p>
</div>
</div>
<motion.div className="text-center" animate={isHovered ? { opacity: [0.3, 0.6, 0.3] } : {}} transition={{ duration: 2, repeat: isHovered ? Infinity : 0 }}>
<span className="text-[7px] tracking-widest" style={{ color: 'rgba(251,191,36,0.3)' }}>{isClicked ? '✦ OPENED ✦' : '✦ TAP TO OPEN ✦'}</span>
</motion.div>
</div>
</motion.div>
</motion.div>
</div>
);
}Interaction states & animations
- Hover