Breathing Coral Card
A living coral structure with tiny, waving polyps. Content is hosted within the coral's calcium skeleton, peeking out through pores. Hover feeds the polyps - they reach toward the cursor, and retract when the cursor leaves quickly. Clicking triggers a synchronized spawning event where tiny glowing particles drift upward. The coral slowly grows new branches as the user visits over days and weeks.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/breathing-coral-card.
<iframe src="/embed/breathing-coral-card" sandbox="allow-scripts" loading="lazy" title="Breathing Coral Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Breathing Coral 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="coral-card">
<svg class="coral-skeleton" viewBox="0 0 100 100">
<line x1="50" y1="60" x2="30" y2="25" stroke="rgba(244,63,94,0.12)" stroke-width="0.6"/>
<line x1="50" y1="60" x2="70" y2="20" stroke="rgba(244,63,94,0.12)" stroke-width="0.6"/>
<line x1="50" y1="60" x2="45" y2="15" stroke="rgba(244,63,94,0.08)" stroke-width="0.4"/>
</svg>
<div class="coral-polyps"></div>
<div class="coral-content">
<div class="coral-header">
<div><div class="coral-title">The Great Barrier</div><div class="coral-sub">Marine Biologist</div></div>
<div class="coral-status">REST</div>
</div>
<div class="coral-grid">
<div class="coral-stat"><div class="coral-stat-val">16</div><div class="coral-stat-lbl">Polyps</div></div>
<div class="coral-stat"><div class="coral-stat-val">85%</div><div class="coral-stat-lbl">Health</div></div>
</div>
<div class="coral-hint">[▼ click to trigger spawn]</div>
</div>
</div>
<style>
.coral-card { position: relative; width: 220px; min-height: 300px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #0a080e, #06040a); border: 1.5px solid rgba(244,63,94,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.3); cursor: pointer; }
.coral-card:hover { box-shadow: 0 0 30px rgba(244,63,94,0.08), 0 15px 40px rgba(0,0,0,0.4); }
.coral-skeleton { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.coral-polyps { position: absolute; top: 5%; left: 5%; width: 90%; height: 55%; z-index: 3; pointer-events: none; }
.coral-content { position: absolute; inset-x: 0; bottom: 0; z-index: 10; padding: 20px; background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent); }
.coral-header { display: flex; justify-content: space-between; align-items: center; }
.coral-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.coral-sub { font-size: 9px; color: rgba(244,63,94,0.44); }
.coral-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #f43f5e; background: rgba(244,63,94,0.08); border: 1px solid rgba(244,63,94,0.12); }
.coral-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coral-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(244,63,94,0.02); border: 1px solid rgba(244,63,94,0.04); }
.coral-stat-val { font-size: 10px; font-weight: 600; color: #f43f5e; }
.coral-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.coral-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(244,63,94,0.2); }</style>CSS
.coral-card { position: relative; width: 220px; min-height: 300px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #0a080e, #06040a); border: 1.5px solid rgba(244,63,94,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.3); cursor: pointer; }
.coral-card:hover { box-shadow: 0 0 30px rgba(244,63,94,0.08), 0 15px 40px rgba(0,0,0,0.4); }
.coral-skeleton { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.coral-polyps { position: absolute; top: 5%; left: 5%; width: 90%; height: 55%; z-index: 3; pointer-events: none; }
.coral-content { position: absolute; inset-x: 0; bottom: 0; z-index: 10; padding: 20px; background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent); }
.coral-header { display: flex; justify-content: space-between; align-items: center; }
.coral-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.coral-sub { font-size: 9px; color: rgba(244,63,94,0.44); }
.coral-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #f43f5e; background: rgba(244,63,94,0.08); border: 1px solid rgba(244,63,94,0.12); }
.coral-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coral-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(244,63,94,0.02); border: 1px solid rgba(244,63,94,0.04); }
.coral-stat-val { font-size: 10px; font-weight: 600; color: #f43f5e; }
.coral-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.coral-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(244,63,94,0.2); }Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-rose-500/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(244,63,94,0.08),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-b from-[#0a080e] to-[#06040a] cursor-pointer">
<svg class="absolute inset-0 z-[2] pointer-events-none" viewBox="0 0 100 100">
<line x1="50" y1="60" x2="30" y2="25" stroke="rgba(244,63,94,0.12)" stroke-width="0.6"/>
<line x1="50" y1="60" x2="70" y2="20" stroke="rgba(244,63,94,0.12)" stroke-width="0.6"/>
<line x1="50" y1="60" x2="45" y2="15" stroke="rgba(244,63,94,0.08)" stroke-width="0.4"/>
</svg>
<div class="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2 bg-gradient-to-t from-black/50 to-transparent">
<div class="flex items-center justify-between">
<div><p class="text-sm font-bold text-white/90">The Great Barrier</p><p class="text-[9px] text-rose-500/50">Marine Biologist</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-rose-500 bg-rose-500/10 border border-rose-500/20">REST</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-rose-500/10 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-1.5 rounded-lg bg-rose-500/10 border border-rose-500/20"><p class="text-[10px] font-semibold text-rose-500">16</p><p class="text-[7px] mt-0.5 text-white/20">Polyps</p></div>
<div class="text-center py-1.5 rounded-lg bg-rose-500/10 border border-rose-500/20"><p class="text-[10px] font-semibold text-rose-500">85%</p><p class="text-[7px] mt-0.5 text-white/20">Health</p></div>
</div>
<div class="text-center"><span class="text-[7px] font-mono text-rose-500/30">[▼ click to trigger spawn]</span></div>
</div>
</div>React
import React, { useState, useRef, useCallback, useEffect } from 'react';
import { motion, useMotionValue, useSpring, AnimatePresence } from 'framer-motion';
export function BreathingCoralCard() {
const ref = useRef(null);
const [isHovered, setIsHovered] = useState(false);
const [spawning, setSpawning] = useState(false);
const [particles, setParticles] = useState([]);
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);
};
const polyps = Array.from({ length: 16 }, (_, i) => ({ id: i, x: 10 + Math.random() * 80, y: 10 + Math.random() * 40, phase: Math.random() * Math.PI * 2 }));
const handleClick = () => {
if (spawning) return;
setSpawning(true);
const newParticles = Array.from({ length: 20 }, (_, i) => ({ id: Date.now() + i, x: 20 + Math.random() * 60, y: 30 + Math.random() * 15, driftX: (Math.random()-0.5)*20, driftY: -(10+Math.random()*25), size: 1.5+Math.random()*2 }));
setParticles(newParticles);
setTimeout(() => { setParticles([]); setSpawning(false); }, 2500);
};
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
<motion.div ref={ref} onMouseMove={handleMouseMove} onClick={handleClick} style={{ rotateX, rotateY, transformStyle: 'preserve-3d' }} className="relative cursor-pointer">
<motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #0a080e, #06040a)', border: '1.5px solid rgba(244,63,94,0.08)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(244,63,94,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 }}>
<div className="absolute inset-0 z-[3] pointer-events-none" style={{ top: '5%', left: '5%', width: '90%', height: '55%' }}>
{polyps.map((polyp) => (
<motion.div key={polyp.id} className="absolute" style={{ left: `${polyp.x}%`, top: `${polyp.y}%`, transform: 'translate(-50%,0)' }}
animate={{
y: isHovered ? [0, -3, 0] : [0, -2, 0],
scale: isHovered ? [1, 1.15, 1] : [1, 1.05, 1],
}}
transition={{ duration: 1.5 + polyp.phase, repeat: Infinity, ease: 'easeInOut', delay: polyp.id * 0.05 }}>
<motion.div className="mx-auto rounded-full" style={{ width: 4, height: 4, background: 'radial-gradient(circle at 35% 30%, rgba(244,63,94,0.3), transparent)', border: '0.5px solid rgba(244,63,94,0.1)' }} />
</motion.div>
))}
</div>
<AnimatePresence>{particles.map((p) => (
<motion.div key={p.id} className="absolute z-[6] pointer-events-none rounded-full"
style={{ left: `${p.x}%`, top: `${p.y}%`, width: p.size, height: p.size, background: 'radial-gradient(circle, rgba(253,164,175,0.6), transparent)', filter: 'blur(0.5px)' }}
initial={{ opacity: 0.8, scale: 0.5 }}
animate={{ x: `${p.driftX}%`, y: `${p.driftY}%`, opacity: [0.8, 0.4, 0], scale: [0.5, 1.5, 0.3] }}
exit={{ opacity: 0 }}
transition={{ duration: 2.5, ease: 'easeOut' }} />
))}</AnimatePresence>
<div className="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.5), transparent)' }}>
<div className="flex items-center justify-between">
<div><p className="text-sm font-bold" style={{ color: 'rgba(255,255,255,0.9)' }}>The Great Barrier</p><p className="text-[9px]" style={{ color: 'rgba(244,63,94,0.44)' }}>Marine Biologist</p></div>
<motion.div className="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest" style={{ background: 'rgba(244,63,94,0.08)', border: '1px solid rgba(244,63,94,0.12)', color: '#f43f5e' }}>{spawning ? 'SPAWN' : isHovered ? 'FEED' : 'REST'}</motion.div>
</div>
<div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(244,63,94,0.1), transparent)' }} />
<div className="grid grid-cols-2 gap-2">
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(244,63,94,0.02)', border: '1px solid rgba(244,63,94,0.04)' }}><p className="text-[10px] font-semibold" style={{ color: '#f43f5e' }}>{polyps.length}</p><p className="text-[7px] mt-0.5" style={{ color: 'rgba(255,255,255,0.2)' }}>Polyps</p></div>
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(244,63,94,0.02)', border: '1px solid rgba(244,63,94,0.04)' }}><p className="text-[10px] font-semibold" style={{ color: '#e11d48' }}>85%</p><p className="text-[7px] mt-0.5" style={{ color: 'rgba(255,255,255,0.2)' }}>Health</p></div>
</div>
<motion.div className="text-center" animate={isHovered ? { y: [0, -1, 0] } : {}} transition={{ duration: 1.5, repeat: isHovered ? Infinity : 0 }}>
<span className="text-[7px] font-mono" style={{ color: 'rgba(244,63,94,0.2)' }}>{spawning ? '[▼ spawning...]' : '[▼ click to spawn]'}</span>
</motion.div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Breathing Coral Card fits
- Marine ecology dashboards
- Living wall interfaces
- Growth simulation panels
- Underwater UI themes
- Natural data visualization
Interaction states & animations
- Polyp waving
- Skeleton branching
- Spawning particle rise
- Growth accretion
- Reach animation
Topics
- #coral
- #polyp
- #reef
- #marine
- #spawning
- #organic
- #living
- #branching
- #growth
- #underwater
Accessibility notes
The waving polyp and spawning particle animations may be visually stimulating. Provide reduced motion alternative. The growth mechanic relies on visit frequency tracking.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+