Fossil Excavation Card
A slab of sedimentary rock with faint bone-like ridges. Hover acts as a brush, sweeping away dust to reveal fossil fragments. Clicking cracks open a nodule containing a perfectly preserved piece. Progress increases as you explore; the complete skeleton is only visible after thorough excavation.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/fossil-excavation-card.
<iframe src="/embed/fossil-excavation-card" sandbox="allow-scripts" loading="lazy" title="Fossil Excavation Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Fossil Excavation 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="fossil-card" onclick="crackNodule(this)">
<div class="fossil-layers"></div>
<div class="fossil-bones" id="fossil-bones"></div>
<div class="fossil-nodule" id="fossil-nodule">
<div class="nodule-body"></div>
<span class="nodule-label">chisel</span>
</div>
<div class="fossil-content">
<div class="fossil-header">
<div><div class="fossil-title">Fossil Bed</div><div class="fossil-sub">Jurassic Layer 7</div></div>
<div class="fossil-status" id="fossil-status">0%</div>
</div>
<div class="fossil-divider"></div>
<div class="fossil-grid">
<div class="fossil-stat"><div class="fossil-stat-val" id="fossil-prog">0%</div><div class="fossil-stat-lbl">Excavated</div></div>
<div class="fossil-stat"><div class="fossil-stat-val" id="fossil-bones-count">0/8</div><div class="fossil-stat-lbl">Bones</div></div>
</div>
<div class="fossil-progress"><div class="fossil-progress-bar" id="fossil-bar"></div></div>
<div class="fossil-hint" id="fossil-hint">[▼ hover to sweep away dust]</div>
</div>
</div>
<script>
let progress = 0;
let noduleCracked = false;
function crackNodule(el) {
if (!noduleCracked) {
noduleCracked = true;
progress = Math.min(100, progress + 25);
document.getElementById('fossil-status').textContent = progress + '%';
document.getElementById('fossil-prog').textContent = progress + '%';
document.getElementById('fossil-hint').textContent = '[▼ crack revealing content...]';
}
}
document.querySelector('.fossil-card').addEventListener('mouseenter', function() {
const interval = setInterval(() => {
if (progress < 100) {
progress = Math.min(100, progress + 1);
document.getElementById('fossil-status').textContent = progress + '%';
document.getElementById('fossil-prog').textContent = progress + '%';
document.getElementById('fossil-bar').style.width = progress + '%';
if (progress >= 40) document.getElementById('fossil-hint').textContent = '[▼ click nodule to crack open]';
if (progress >= 100) {
document.getElementById('fossil-hint').textContent = '[▼ fully excavated]';
document.getElementById('fossil-bones-count').textContent = '8/8';
clearInterval(interval);
}
}
}, 200);
this.addEventListener('mouseleave', () => clearInterval(interval), { once: true });
});
</script>CSS
.fossil-card {
position: relative;
width: 220px;
min-height: 300px;
border-radius: 16px;
overflow: hidden;
background: linear-gradient(160deg, #1a1814, #12100c, #0a0806);
border: 1.5px solid rgba(180,160,140,0.1);
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
cursor: pointer;
transition: box-shadow 0.4s ease;
}
.fossil-card:hover {
box-shadow: 0 0 30px rgba(180,160,140,0.04), 0 15px 40px rgba(0,0,0,0.5);
}
.fossil-layers {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 1;
}
.fossil-layers::before {
content: '';
position: absolute;
top: 15%; left: 0; right: 0; height: 8px;
background: linear-gradient(90deg, transparent, rgba(160,140,120,0.06), transparent);
transform: rotate(0.5deg);
}
.fossil-layers::after {
content: '';
position: absolute;
top: 35%; left: 0; right: 0; height: 10px;
background: linear-gradient(90deg, transparent, rgba(160,140,120,0.08), transparent);
transform: rotate(-0.5deg);
}
.fossil-bones {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 3;
}
.fossil-nodule {
position: absolute;
left: 65%;
top: 38%;
z-index: 5;
cursor: pointer;
pointer-events: auto;
transition: transform 0.3s ease;
}
.fossil-nodule:hover {
transform: scale(1.05);
}
.nodule-body {
width: 20px;
height: 18px;
border-radius: 40% 40% 50% 50%;
background: radial-gradient(ellipse at 40% 30%, rgba(160,140,120,0.3), rgba(80,70,60,0.4));
border: 1.5px solid rgba(160,140,120,0.3);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.nodule-label {
display: block;
text-align: center;
font-size: 5px;
font-family: monospace;
color: rgba(160,140,120,0.2);
margin-top: 2px;
}
.fossil-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);
}
.fossil-header { display: flex; justify-content: space-between; align-items: center; }
.fossil-title { font-size: 14px; font-weight: 700; color: rgba(220,200,180,0.9); }
.fossil-sub { font-size: 9px; color: rgba(180,160,140,0.44); }
.fossil-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #d4a574; background: rgba(180,160,140,0.1); border: 1px solid rgba(180,160,140,0.12); }
.fossil-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(180,160,140,0.12), transparent); }
.fossil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fossil-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(180,160,140,0.03); border: 1px solid rgba(180,160,140,0.08); }
.fossil-stat-val { font-size: 10px; font-weight: 600; color: #d4a574; }
.fossil-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.fossil-progress { height: 4px; border-radius: 2px; overflow: hidden; background: rgba(180,160,140,0.06); }
.fossil-progress-bar { height: 100%; border-radius: 2px; background: linear-gradient(90deg, rgba(180,160,140,0.15), rgba(220,200,180,0.3)); transition: width 0.3s ease; width: 0%; }
.fossil-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(180,160,140,0.2); }
@media (prefers-reduced-motion: reduce) {
.fossil-card { transition: none; }
.fossil-progress-bar { transition: none; }
}Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-amber-800/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(180,160,140,0.04),0_15px_40px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#1a1814] via-[#12100c] to-[#0a0806] cursor-pointer">
<div class="absolute inset-0 pointer-events-none z-1"><div class="absolute top-[15%] left-0 right-0 h-2 bg-gradient-to-r from-transparent via-amber-800/10 to-transparent rotate-0.5"></div><div class="absolute top-[35%] left-0 right-0 h-2.5 bg-gradient-to-r from-transparent via-amber-800/10 to-transparent -rotate-0.5"></div></div>
<div class="absolute left-[65%] top-[38%] z-5 cursor-pointer group/nodule">
<div class="w-5 h-[18px] rounded-[40%_40%_50%_50%] bg-gradient-radial from-amber-700/30 to-amber-900/40 border border-amber-700/30 shadow-inner group-hover/nodule:scale-105 transition-transform"></div>
<p class="text-[5px] font-mono text-center mt-0.5 text-amber-700/30">chisel</p>
</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-amber-100/90">Fossil Bed</p><p class="text-[9px] text-amber-600/50">Jurassic Layer 7</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-amber-600 bg-amber-500/10 border border-amber-500/20">0%</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-amber-600/20 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-1.5 rounded-lg bg-amber-500/10 border border-amber-500/20"><p class="text-[10px] font-semibold text-amber-600">0%</p><p class="text-[7px] mt-0.5 text-white/20">Excavated</p></div>
<div class="text-center py-1.5 rounded-lg bg-amber-500/10 border border-amber-500/20"><p class="text-[10px] font-semibold text-amber-600">0/8</p><p class="text-[7px] mt-0.5 text-white/20">Bones</p></div>
</div>
<div class="h-1 rounded-full overflow-hidden bg-amber-900/20"><div class="h-full rounded-full bg-gradient-to-r from-amber-600/20 to-amber-400/30 transition-all duration-300" style="width: 0%"></div></div>
<div class="text-center"><span class="text-[7px] font-mono text-amber-600/30">[▼ hover to sweep away dust]</span></div>
</div>
</div>React
import React, { useState, useRef, useEffect } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function FossilExcavationCard() {
const [isHovered, setIsHovered] = useState(false);
const [progress, setProgress] = useState(0);
const [noduleCracked, setNoduleCracked] = useState(false);
const [noduleRevealed, setNoduleRevealed] = useState(false);
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 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)) * 10);
y.set(((e.clientY - cy) / (rect.height / 2)) * 10);
if (isHovered && progress < 100) setProgress((p) => Math.min(100, p + 0.3));
};
const handleClick = () => {
if (!noduleCracked) {
setNoduleCracked(true);
setTimeout(() => { setNoduleRevealed(true); setProgress((p) => Math.min(100, p + 25)); }, 600);
}
};
const isComplete = progress >= 95;
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', perspective: 800 }} className="relative cursor-pointer">
<motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #1a1814, #12100c, #0a0806)', border: '1.5px solid rgba(180,160,140,0.1)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(180,160,140,0.04), 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 }}>
{!noduleCracked && progress > 30 && (
<motion.div className="absolute z-[5] cursor-pointer" style={{ left: '65%', top: '38%' }}
animate={isHovered ? { scale: [1, 1.05, 1] } : {}}
transition={{ duration: 2, repeat: isHovered ? Infinity : 0 }}>
<div className="w-5 h-[18px] rounded-[40%_40%_50%_50%]" style={{ background: 'radial-gradient(ellipse at 40% 30%, rgba(160,140,120,0.3), rgba(80,70,60,0.4))', border: '1.5px solid rgba(160,140,120,0.3)' }} />
</motion.div>
)}
{noduleRevealed && (
<motion.div className="absolute z-[5]" style={{ left: '62%', top: '36%' }} initial={{ opacity: 0, scale: 0.3 }} animate={{ opacity: 1, scale: 1 }} transition={{ type: 'spring', stiffness: 200, damping: 15, delay: 0.2 }}>
<div className="w-7 h-7 rounded-full flex items-center justify-center" style={{ background: 'radial-gradient(circle at 40% 35%, rgba(180,220,255,0.3), rgba(100,150,200,0.15))', border: '1px solid rgba(180,220,255,0.2)' }}>
<span style={{ color: 'rgba(200,230,255,0.6)' }}>✦</span>
</div>
</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(220,200,180,0.9)' }}>Fossil Bed</p>
<p className="text-[9px]" style={{ color: 'rgba(180,160,140,0.44)' }}>Jurassic Layer 7</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(180,160,140,0.03)', border: '1px solid rgba(180,160,140,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#d4a574' }}>{isComplete ? '100%' : `${Math.round(progress)}%`}</p><p className="text-[7px] text-white/20">Excavated</p></div>
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(180,160,140,0.03)', border: '1px solid rgba(180,160,140,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#d4a574' }}>{isComplete ? 'Archaeopteryx' : `${Math.min(8, Math.floor(progress / 12.5))}/8`}</p><p className="text-[7px] text-white/20">{isComplete ? 'Species' : 'Bones'}</p></div>
</div>
<div className="h-1 rounded-full overflow-hidden" style={{ background: 'rgba(180,160,140,0.06)' }}>
<motion.div className="h-full rounded-full" style={{ background: 'linear-gradient(90deg, rgba(180,160,140,0.15), rgba(220,200,180,0.3))' }} animate={{ width: `${progress}%` }} transition={{ duration: 0.3 }} />
</div>
<div className="text-center"><span className="text-[7px] font-mono" style={{ color: 'rgba(180,160,140,0.2)' }}>{isComplete ? '[▼ fully excavated ✓]' : noduleCracked ? '[▼ crack revealing...]' : progress > 30 ? '[▼ click nodule to crack open]' : '[▼ hover to sweep away dust]'}</span></div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Fossil Excavation Card fits
- Paleontology
- Archaeology
- Education
- Science
- History
- Interactive Storytelling
Interaction states & animations
- Sweep reveal
- Bone emergence
- Nodule crack
- Dust particles
- Progress fill
Topics
- #fossil
- #excavation
- #dinosaur
- #bone
- #paleontology
- #archaeology
- #sediment
- #rock
- #skeleton
- #science
Accessibility notes
Hover-to-reveal content should also be accessible through click interactions. Progress bar provides clear feedback. Text contrast is maintained on the sediment background. respect prefers-reduced-motion.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+