Gene Sequencer Card
A scientific visualization of genetic data. A twisting double helix made of colored nucleotide nodes (A, T, G, C) animates continuously. Hovering over a gene highlights it and reveals the trait it codes for. Clicking unzips the helix, splitting the card into two parallel comparison views. Subtle data replication and mutation animations play on reload.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/gene-sequencer-card.
<iframe src="/embed/gene-sequencer-card" sandbox="allow-scripts" loading="lazy" title="Gene Sequencer Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Gene Sequencer 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="gene-card" onclick="toggleGene(this)">
<div class="gene-grid"></div>
<div class="gene-helix">
<svg viewBox="0 0 220 300" class="gene-strands">
<path d="M 70 20 C 40 60, 100 80, 70 120 C 40 160, 100 180, 70 220 C 40 260, 100 280, 70 300" fill="none" stroke="rgba(74,222,128,0.2)" stroke-width="1.5"/>
<path d="M 150 20 C 180 60, 120 80, 150 120 C 180 160, 120 180, 150 220 C 180 260, 120 280, 150 300" fill="none" stroke="rgba(74,222,128,0.2)" stroke-width="1.5"/>
</svg>
</div>
<div class="gene-content">
<div class="gene-header">
<div><div class="gene-title">Genome Explorer</div><div class="gene-sub">Arabidopsis thaliana</div></div>
<div class="gene-status" id="gene-status">COILED</div>
</div>
<div class="gene-divider"></div>
<div class="gene-grid-stats">
<div class="gene-stat"><div class="gene-stat-val">24</div><div class="gene-stat-lbl">Base Pairs</div></div>
<div class="gene-stat"><div class="gene-stat-val">4</div><div class="gene-stat-lbl">Nucleotides</div></div>
</div>
<div class="gene-hint" id="gene-hint">[▼ click to unzip]</div>
</div>
</div>
<script>
let geneUnzipped = false;
function toggleGene(el) {
geneUnzipped = !geneUnzipped;
el.classList.toggle('unzipped', geneUnzipped);
document.getElementById('gene-status').textContent = geneUnzipped ? 'UNZIPPED' : 'COILED';
document.getElementById('gene-hint').textContent = geneUnzipped ? '[▼ click to zip]' : '[▼ click to unzip]';
}
</script>CSS
.gene-card {
position: relative;
width: 220px;
min-height: 300px;
border-radius: 16px;
overflow: hidden;
background: linear-gradient(160deg, #080e0a, #040a06, #020604);
border: 1.5px solid rgba(74,222,128,0.08);
box-shadow: 0 10px 30px rgba(0,0,0,0.4);
cursor: pointer;
transition: box-shadow 0.4s ease;
}
.gene-card:hover {
box-shadow: 0 0 30px rgba(74,222,128,0.06), 0 15px 40px rgba(0,0,0,0.5);
}
.gene-grid {
position: absolute;
inset: 0;
pointer-events: none;
opacity: 0.03;
background-image: linear-gradient(rgba(74,222,128,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(74,222,128,0.3) 1px, transparent 1px);
background-size: 20px 20px;
}
.gene-helix {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 2;
}
.gene-strands {
width: 100%;
height: 100%;
}
.gene-card.unzipped .gene-strands path:first-child {
d: path("M 30 20 L 30 300");
}
.gene-card.unzipped .gene-strands path:last-child {
d: path("M 190 20 L 190 300");
}
.gene-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);
}
.gene-header { display: flex; justify-content: space-between; align-items: center; }
.gene-title { font-size: 14px; font-weight: 700; color: rgba(200,255,220,0.9); }
.gene-sub { font-size: 9px; font-family: monospace; color: rgba(74,222,128,0.44); }
.gene-status { padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: #4ade80; background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.12); }
.gene-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(74,222,128,0.12), transparent); }
.gene-grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gene-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(74,222,128,0.03); border: 1px solid rgba(74,222,128,0.08); }
.gene-stat-val { font-size: 10px; font-weight: 600; color: #4ade80; }
.gene-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.gene-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(74,222,128,0.2); }
@keyframes helixSpin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.gene-card { transition: none; }
}Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-green-400/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(74,222,128,0.06),0_15px_40px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#080e0a] via-[#040a06] to-[#020604] cursor-pointer">
<div class="absolute inset-0 pointer-events-none opacity-[0.03]" style="background-image: linear-gradient(rgba(74,222,128,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(74,222,128,0.3) 1px, transparent 1px); background-size: 20px 20px;"></div>
<svg viewBox="0 0 220 300" class="absolute inset-0 w-full h-full pointer-events-none z-2 opacity-60"><path d="M 70 20 C 40 60, 100 80, 70 120 C 40 160, 100 180, 70 220 C 40 260, 100 280, 70 300" fill="none" stroke="rgba(74,222,128,0.2)" stroke-width="1.5"/><path d="M 150 20 C 180 60, 120 80, 150 120 C 180 160, 120 180, 150 220 C 180 260, 120 280, 150 300" fill="none" stroke="rgba(74,222,128,0.2)" stroke-width="1.5"/></svg>
<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-green-100/90">Genome Explorer</p><p class="text-[9px] font-mono text-green-400/50">Arabidopsis thaliana</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-green-400 bg-green-500/10 border border-green-500/20">COILED</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-green-400/20 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-1.5 rounded-lg bg-green-500/10 border border-green-500/20"><p class="text-[10px] font-semibold text-green-400">24</p><p class="text-[7px] mt-0.5 text-white/20">Base Pairs</p></div>
<div class="text-center py-1.5 rounded-lg bg-green-500/10 border border-green-500/20"><p class="text-[10px] font-semibold text-green-400">4</p><p class="text-[7px] mt-0.5 text-white/20">Nucleotides</p></div>
</div>
<div class="text-center"><span class="text-[7px] font-mono text-green-400/30">[▼ click to unzip]</span></div>
</div>
</div>React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring, AnimatePresence } from 'framer-motion';
export function GeneSequencerCard() {
const [isHovered, setIsHovered] = useState(false);
const [isUnzipped, setIsUnzipped] = useState(false);
const [hoveredGene, setHoveredGene] = useState(null);
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 bases = [
{ label: 'A', color: '#4ade80', trait: 'Creation Date' },
{ label: 'T', color: '#f87171', trait: 'Sequence ID' },
{ label: 'G', color: '#60a5fa', trait: 'Author Origin' },
{ label: 'C', color: '#fbbf24', trait: 'Mutation Count' },
];
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);
};
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); setHoveredGene(null); }}>
<motion.div ref={ref} onMouseMove={handleMouseMove} onClick={() => setIsUnzipped(!isUnzipped)} 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, #080e0a, #040a06, #020604)', border: '1.5px solid rgba(74,222,128,0.08)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(74,222,128,0.06), 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 }}>
{Array.from({ length: 12 }).map((_, i) => {
const bp = bases[i % 4];
const isHover = hoveredGene === i;
return (
<motion.div key={i} className="absolute z-[3]"
onMouseEnter={() => setHoveredGene(i)}
onMouseLeave={() => setHoveredGene(null)}
style={{ left: `${isUnzipped ? 30 : 70 + (i % 2 === 0 ? 12 : -12)}%`, top: `${5 + i * 7}%` }}>
<motion.div className="rounded-full flex items-center justify-center pointer-events-auto cursor-pointer"
style={{ width: isHover ? 14 : 10, height: isHover ? 14 : 10, background: isHover ? bp.color : `${bp.color}33`, border: `1.5px solid ${bp.color}66`, boxShadow: isHover ? `0 0 12px ${bp.color}66` : 'none' }}
animate={!isUnzipped ? { y: [0, -2, 0, 2, 0] } : {}} transition={{ duration: 3 + i * 0.2, repeat: Infinity, ease: 'easeInOut', delay: i * 0.1 }}>
<span style={{ fontSize: isHover ? 7 : 5, color: isHover ? '#fff' : bp.color }} className="font-bold">{bp.label}</span>
</motion.div>
{isHover && <motion.div className="absolute z-20 px-2 py-1 rounded pointer-events-none" style={{ left: '-50%', top: '-4%', background: 'rgba(0,0,0,0.85)', border: `1px solid ${bp.color}44` }} initial={{ opacity: 0 }} animate={{ opacity: 1 }}><span className="text-[7px] whitespace-nowrap" style={{ color: bp.color }}>{bp.label} = {bp.trait}</span></motion.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(200,255,220,0.9)' }}>Genome Explorer</p>
<p className="text-[9px] font-mono" style={{ color: 'rgba(74,222,128,0.44)' }}>Arabidopsis thaliana</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(74,222,128,0.03)', border: '1px solid rgba(74,222,128,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#4ade80' }}>24</p><p className="text-[7px] text-white/20">Base Pairs</p></div>
<div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(74,222,128,0.03)', border: '1px solid rgba(74,222,128,0.08)' }}><p className="text-[10px] font-semibold" style={{ color: '#4ade80' }}>4</p><p className="text-[7px] text-white/20">Nucleotides</p></div>
</div>
<div className="text-center"><span className="text-[7px] font-mono" style={{ color: 'rgba(74,222,128,0.2)' }}>{isUnzipped ? '[▼ click to zip]' : '[▼ click to unzip]'}</span></div>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Gene Sequencer Card fits
- Genomics
- Bioinformatics
- Science Education
- Health Dashboards
- Research
- Data Visualization
Interaction states & animations
- Helix twist
- Unzip
- Node highlight
- Mutation flash
- Replication particles
Topics
- #dna
- #helix
- #genetics
- #science
- #sequencing
- #biology
- #nucleotide
- #research
- #genome
- #laboratory
Accessibility notes
Color-coded base pairs should also include text labels for colorblind users. Unzip animation may be disorienting; respect prefers-reduced-motion. Scientific labels provide sufficient contrast.
Browser support
- Chrome 90+
- Firefox 105+
- Safari 15+
- Edge 90+