Topographic Contour Card
A card that is a 3D topographic map with elevation lines. Content peaks rise like mountains from the base plane. Hover casts a sun that dramatically changes the lighting and shadow, revealing new contours. Clicking floods the map to a certain elevation, submerging lower content. Each data point's importance determines its elevation.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/topographic-contour-card.
<iframe src="/embed/topographic-contour-card" sandbox="allow-scripts" loading="lazy" title="Topographic Contour Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Topographic Contour 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="topographic-contour-card">
<div class="contour-lines">
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
<div class="contour-ring"></div>
</div>
<div class="contour-peaks">
<div class="peak-marker" style="left:50%;top:55%;width:14px;height:14px;"></div>
<div class="peak-marker" style="left:30%;top:62%;width:11px;height:11px;"></div>
<div class="peak-marker" style="left:70%;top:58%;width:12px;height:12px;"></div>
</div>
<div class="contour-sun"></div>
<div class="contour-compass"></div>
<div class="contour-content">
<div class="contour-header">
<div><div class="contour-title">Mount Datalore</div><div class="contour-sub">Summit · 2,847m</div></div>
<div class="contour-badge">MAP</div>
</div>
<div class="contour-grid">
<div class="contour-stat"><div class="contour-stat-val">6</div><div class="contour-stat-lbl">Peaks Visible</div></div>
<div class="contour-stat"><div class="contour-stat-val">2,847m</div><div class="contour-stat-lbl">Elevation</div></div>
</div>
<div class="contour-hint">[▼ click to flood map]</div>
</div>
</div>CSS
.topographic-contour-card { position: relative; width: 220px; min-height: 300px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #0e1410, #080c08); border: 1.5px solid rgba(107,142,90,0.12); box-shadow: 0 10px 30px rgba(0,0,0,0.3); cursor: pointer; }
.topographic-contour-card:hover { box-shadow: 0 0 30px rgba(255,220,150,0.08), 0 15px 40px rgba(0,0,0,0.4); }
.contour-lines { position: absolute; inset: 0; z-index: 2; pointer-events: none; transform-style: preserve-3d; }
.contour-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%; border: 1px solid rgba(107,142,90,0.3); transition: all 0.3s ease; }
.contour-ring:nth-child(1) { width: 40%; height: 30%; top: 57%; opacity: 0.4; border-color: rgba(107,142,90,0.5); }
.contour-ring:nth-child(2) { width: 50%; height: 38%; top: 53%; opacity: 0.44; border-color: rgba(107,142,90,0.3); }
.contour-ring:nth-child(3) { width: 60%; height: 46%; top: 49%; opacity: 0.48; border-color: rgba(107,142,90,0.5); }
.contour-ring:nth-child(4) { width: 70%; height: 54%; top: 45%; opacity: 0.52; border-color: rgba(107,142,90,0.3); }
.contour-ring:nth-child(5) { width: 80%; height: 62%; top: 41%; opacity: 0.56; border-color: rgba(107,142,90,0.5); }
.contour-ring:nth-child(6) { width: 90%; height: 70%; top: 37%; opacity: 0.6; border-color: rgba(107,142,90,0.3); }
.contour-ring:nth-child(7) { width: 100%; height: 78%; top: 33%; opacity: 0.64; border-color: rgba(107,142,90,0.5); }
.contour-ring:nth-child(8) { width: 110%; height: 86%; top: 29%; opacity: 0.68; border-color: rgba(107,142,90,0.3); }
.contour-peaks { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.peak-marker { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #d4a060, rgba(107,142,90,0.6)); transform: translate(-50%,-50%); transition: all 0.3s ease; }
.topographic-contour-card:hover .peak-marker { filter: brightness(1.2); }
.contour-sun { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 55% 40%, rgba(255,220,150,0.08), transparent 50%); opacity: 0.2; transition: opacity 0.5s; }
.topographic-contour-card:hover .contour-sun { opacity: 0.5; }
.contour-compass { position: absolute; top: 6%; right: 6%; z-index: 6; pointer-events: none; opacity: 0.3; transition: transform 0.5s; }
.topographic-contour-card:hover .contour-compass { transform: rotate(45deg); }
.contour-content { position: absolute; inset-x: 0; bottom: 0; z-index: 10; padding: 20px; background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent); }
.contour-header { display: flex; justify-content: space-between; align-items: center; }
.contour-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.contour-sub { font-size: 9px; color: rgba(107,142,90,0.44); }
.contour-badge { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #6b8e5a; background: rgba(107,142,90,0.06); border: 1px solid rgba(107,142,90,0.12); }
.contour-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.contour-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(107,142,90,0.04); border: 1px solid rgba(107,142,90,0.06); }
.contour-stat-val { font-size: 10px; font-weight: 600; color: #6b8e5a; }
.contour-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.contour-hint { text-align: center; margin-top: 8px; font-size: 7px; font-family: monospace; color: rgba(107,142,90,0.2); }
@media (prefers-reduced-motion: reduce) { .contour-ring { animation: none !important; } }Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-emerald-700/30 shadow-lg group-hover:shadow-[0_0_30px_rgba(255,220,150,0.08),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-b from-[#0e1410] to-[#080c08] cursor-pointer">
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[40%] h-[30%] top-[57%] border border-emerald-700/30 opacity-40"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[50%] h-[38%] top-[53%] border border-emerald-600/30 opacity-44"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[60%] h-[46%] top-[49%] border border-emerald-700/30 opacity-48"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[70%] h-[54%] top-[45%] border border-emerald-600/30 opacity-52"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[80%] h-[62%] top-[41%] border border-emerald-700/30 opacity-56"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[90%] h-[70%] top-[37%] border border-emerald-600/30 opacity-60"></div>
<div class="absolute left-1/2 -translate-x-1/2 rounded-full w-[100%] h-[78%] top-[33%] border border-emerald-700/30 opacity-64"></div>
<div class="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2 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">Mount Datalore</p><p class="text-[9px] text-emerald-600/50">Summit · 2,847m</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-emerald-600 bg-emerald-700/10 border border-emerald-700/20">MAP</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-emerald-700/10 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-1.5 rounded-lg bg-emerald-700/10 border border-emerald-700/20"><p class="text-[10px] font-semibold text-emerald-600">6</p><p class="text-[7px] mt-0.5 text-white/20">Peaks Visible</p></div>
<div class="text-center py-1.5 rounded-lg bg-emerald-700/10 border border-emerald-700/20"><p class="text-[10px] font-semibold text-emerald-600">2,847m</p><p class="text-[7px] mt-0.5 text-white/20">Elevation</p></div>
</div>
<div class="text-center"><span class="text-[7px] font-mono text-emerald-700/30">[▼ click to flood map]</span></div>
</div>
</div>React
import React, { useState, useRef, useCallback } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function TopographicContourCard({ mapName = 'Mount Datalore', elevation = '2,847m', width = 220 }) {
const [isHovered, setIsHovered] = useState(false);
const [floodLevel, setFloodLevel] = useState(0);
const ref = useRef(null);
const x = useMotionValue(0);
const y = useMotionValue(0);
const rotateX = useSpring(y, { damping: 22, stiffness: 220 });
const rotateY = useSpring(x, { damping: 22, stiffness: 220 });
const peaks = [{ id: 0, x: 50, y: 55, e: 8 }, { id: 1, x: 30, y: 62, e: 5 }, { id: 2, x: 70, y: 58, e: 6 }, { id: 3, x: 20, y: 45, e: 3 }, { id: 4, x: 80, y: 50, e: 4 }, { id: 5, x: 40, y: 35, e: 2 }];
const handleMouseMove = (e) => {
if (!ref.current) return;
const rect = ref.current.getBoundingClientRect();
x.set(-((e.clientX - rect.left - rect.width / 2) / (rect.width / 2)) * 8);
y.set(((e.clientY - rect.top - rect.height / 2) / (rect.height / 2)) * 8);
};
const handleClick = () => {
let lv = 0;
const int = setInterval(() => { lv += 1; setFloodLevel(lv); if (lv >= 6) { clearInterval(int); setTimeout(() => setFloodLevel(0), 2000); } }, 350);
};
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, minHeight: 300, background: 'linear-gradient(160deg, #0e1410, #080c08)', border: '1.5px solid rgba(107,142,90,0.12)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(255,220,150,0.08), 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 }}>
{[...Array(8)].map((_, lv) => (
<motion.div key={lv} className="absolute left-1/2 -translate-x-1/2 rounded-full" style={{ width: (40 + lv * 10) + '%', height: (30 + lv * 8) + '%', top: (55 - lv * 4) + '%', border: '1px solid ' + (lv % 2 === 0 ? 'rgba(107,142,90,0.5)' : 'rgba(107,142,90,0.3)'), borderRadius: (40 + lv * 3) + '%' + ' ' + (40 + lv * 3) + '%', opacity: 0.4 + lv * 0.03 }}
animate={{ scale: isHovered ? [1, 1.01, 1] : 1 }} transition={{ duration: 2 + lv * 0.2, repeat: isHovered ? Infinity : 0, delay: lv * 0.1 }} />
))}
{peaks.map((peak) => (
<motion.div key={peak.id} className="absolute" style={{ left: peak.x + '%', top: peak.y + '%', transform: 'translate(-50%,-50%)' }}
animate={{ opacity: floodLevel > 0 && peak.e <= floodLevel ? 0.15 : 1 }} transition={{ duration: 0.5 }}>
<div className="rounded-full" style={{ width: 8 + peak.e, height: 8 + peak.e, background: 'radial-gradient(circle at 40% 30%, #d4a060, rgba(107,142,90,0.6))', opacity: 0.6 + peak.e * 0.04 }} />
</motion.div>
))}
{floodLevel > 0 && (
<motion.div className="absolute left-0 right-0 bottom-0 z-[5] pointer-events-none" style={{ height: floodLevel * 10 + '%', background: 'linear-gradient(0deg, rgba(70,130,180,0.3), rgba(70,130,180,0.15))', backdropFilter: 'blur(1px)' }} initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.3 }} />
)}
<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.6), transparent)' }}>
<div className="flex items-center justify-between">
<div><p className="text-sm font-bold" style={{ color: 'rgba(255,255,255,0.9)' }}>{mapName}</p><p className="text-[9px]" style={{ color: 'rgba(107,142,90,0.44)' }}>Summit · {elevation}</p></div>
<div className="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest" style={{ background: 'rgba(107,142,90,0.06)', border: '1px solid rgba(107,142,90,0.12)', color: '#6b8e5a' }}>{floodLevel > 0 ? 'FLOODING' : 'MAP'}</div>
</div>
<div className="text-center"><span className="text-[7px] font-mono" style={{ color: 'rgba(107,142,90,0.2)' }}>{floodLevel > 0 ? '[▼ receding...]' : '[▼ click to flood map]'}</span></div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Topographic Contour Card fits
- Geographic data displays
- Elevation mapping
- Data topography
- Scientific dashboards
- Interactive mapping
Interaction states & animations
- Contour pulse
- Sun tracking
- Flood animation
- Peak glow
- Water ripple
Topics
- #topographic
- #contour
- #elevation
- #map
- #3d
- #flood
- #mountains
- #geography
- #terrain
Accessibility notes
The flood animation may be disorienting. Ensure sufficient contrast for elevation labels. Provide prefers-reduced-motion fallback that disables the contour pulsing and flood effects.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+