DNA Helix Card
A scientific card featuring a rotating DNA double helix. The base pairs glow with complementary colors, and the sugar-phosphate backbones twist in opposite directions. Hovering accelerates the replication process. Clicking triggers a transcription animation where mRNA strands peel off.
DNA Helix Card
by FreeCsStyles Dev's
CardsSpin / Rotation / Flip
🌐HTML/CSS🎨Tailwind⚛️React💚Vue🅰️Angular🔥Svelte☁️LWC
#dna#helix#genetics#biology#science#double-helix#base-pair#transcription#replication#molecule
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/dna-helix-card.
<iframe src="/embed/dna-helix-card" sandbox="allow-scripts" loading="lazy" title="DNA Helix Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for DNA Helix 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="dna-helix-card">
<div class="dna-container">
<div class="dna-strand">
<div class="dna-backbone"></div>
<div class="dna-base" style="--a:0deg;--c:#ff6b6b"></div>
<div class="dna-base" style="--a:60deg;--c:#6bcbff"></div>
<div class="dna-base" style="--a:120deg;--c:#ffd93d"></div>
<div class="dna-base" style="--a:180deg;--c:#a66cff"></div>
<div class="dna-base" style="--a:240deg;--c:#ff6b6b"></div>
<div class="dna-base" style="--a:300deg;--c:#6bcbff"></div>
</div>
</div>
<div class="dna-content">
<div class="dna-title">DNA Helix</div>
<div class="dna-sub">Double Strand</div>
</div>
</div>CSS
.dna-helix-card { position: relative; width: 220px; min-height: 290px; border-radius: 16px; background: linear-gradient(160deg, #040a14, #020408); border: 1.5px solid rgba(50,150,255,0.12); overflow: hidden; cursor: pointer; }
.dna-helix-card:hover { box-shadow: 0 0 30px rgba(50,150,255,0.08); }
.dna-container { position: absolute; left: 50%; top: 38%; transform: translate(-50%,-50%); width: 80px; height: 100px; }
.dna-strand { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: dnaRotate 4s linear infinite; }
.dna-helix-card:hover .dna-strand { animation-duration: 1.5s; }
@keyframes dnaRotate { 0% { transform: rotateX(0deg) rotateY(0deg); } 100% { transform: rotateX(360deg) rotateY(360deg); } }
.dna-backbone { position: absolute; left: 50%; top: 0; width: 4px; height: 100%; background: linear-gradient(180deg, #88bbff, #4488cc, #88bbff); border-radius: 2px; transform: translateX(-50%) rotateY(20deg); }
.dna-backbone::after { content: ''; position: absolute; left: 10px; top: 0; width: 4px; height: 100%; background: linear-gradient(180deg, #ff8888, #cc4444, #ff8888); border-radius: 2px; }
.dna-base { position: absolute; left: 50%; top: calc(var(--a) / 360 * 100%); width: 10px; height: 4px; background: var(--c); border-radius: 2px; transform: translateX(-50%) rotateY(calc(var(--a) * 1deg)); opacity: 0.6; }
.dna-content { position: absolute; inset-x: 0; bottom: 0; padding: 16px; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); }
.dna-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.dna-sub { font-size: 9px; color: rgba(50,150,255,0.5); }Tailwind CSS
<div class="group relative w-[220px] min-h-[290px] rounded-2xl bg-gradient-to-b from-[#040a14] to-[#020408] border border-blue-500/20 overflow-hidden cursor-pointer group-hover:shadow-[0_0_30px_rgba(50,150,255,0.08)]">
<div class="absolute left-1/2 top-[38%] -translate-x-1/2 -translate-y-1/2 w-20 h-24 [transform-style:preserve-3d] animate-[dnaRotate_4s_linear_infinite] group-hover:animate-[dnaRotate_1.5s_linear_infinite]">
<div class="absolute left-1/2 top-0 w-1 h-full bg-gradient-to-b from-blue-400 to-blue-600 rounded -translate-x-1/2 [transform:rotateY(20deg)]"></div>
<div class="absolute left-[calc(50%+10px)] top-0 w-1 h-full bg-gradient-to-b from-red-400 to-red-600 rounded -translate-x-1/2 [transform:rotateY(-20deg)]"></div>
</div>
<div class="absolute inset-x-0 bottom-0 p-4 bg-gradient-to-t from-black/70 to-transparent">
<p class="text-sm font-bold text-white/90">DNA Helix</p>
<p class="text-[9px] text-blue-500/50">Double Strand</p>
</div>
</div>React
import React, { useRef, useState } from 'react';
import { motion } from 'framer-motion';
export function DNAHelixCard({ width = 220 }) {
const [isHovered, setIsHovered] = useState(false);
const [transcribing, setTranscribing] = useState(false);
const bases = ['#ff6b6b', '#6bcbff', '#ffd93d', '#a66cff', '#ff6b6b', '#6bcbff'];
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); setTranscribing(false); }}>
<motion.div onClick={() => setTranscribing(!transcribing)} whileTap={{ scale: 0.97 }} className="relative cursor-pointer" style={{ width }}>
<motion.div className="relative rounded-2xl overflow-hidden" style={{ minHeight: 290, background: 'linear-gradient(160deg, #040a14, #020408)', border: '1.5px solid rgba(50,150,255,0.12)' }}>
<motion.div className="absolute left-1/2 top-[38%] -translate-x-1/2 -translate-y-1/2" style={{ transformStyle: 'preserve-3d', width: 80, height: 100 }}
animate={{ rotateX: isHovered ? 360 : 0, rotateY: isHovered ? 360 : 0 }} transition={{ duration: isHovered ? 1.5 : 4, repeat: Infinity, ease: 'linear' }}>
<div className="absolute left-1/2 top-0 w-1 h-full rounded -translate-x-1/2" style={{ background: 'linear-gradient(180deg, #88bbff, #4488cc, #88bbff)', transform: 'rotateY(20deg)' }} />
<div className="absolute left-[calc(50%+10px)] top-0 w-1 h-full rounded -translate-x-1/2" style={{ background: 'linear-gradient(180deg, #ff8888, #cc4444, #ff8888)', transform: 'rotateY(-20deg)' }} />
{bases.map((c, i) => (
<motion.div key={i} className="absolute left-1/2 w-2.5 h-1 rounded" style={{ background: c, top: (i / bases.length) * 100 + '%' }}
animate={{ opacity: transcribing ? [0.6, 1, 0.6] : 0.6, scaleX: transcribing ? [1, 1.3, 1] : 1 }}
transition={{ duration: 1, repeat: transcribing ? Infinity : 0, delay: i * 0.1 }} />
))}
</motion.div>
<div className="absolute inset-x-0 bottom-0 p-4" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.7), transparent)' }}>
<p className="text-sm font-bold" style={{ color: 'rgba(255,255,255,0.9)' }}>DNA Helix</p>
<p className="text-[9px]" style={{ color: 'rgba(50,150,255,0.5)' }}>{transcribing ? 'TRANSCRIBING...' : 'Double Strand'}</p>
</div>
</motion.div>
</motion.div>
</div>
);
}Where DNA Helix Card fits
- Science Cards
- BioTech UI
- Medical Dashboards
- Education Tools
- Research Portfolios
Interaction states & animations
- DNA helix rotation
- Base pair glow pulse
- Replication speed change
- Transcription peel-off
- Double helix twist
Topics
- #dna
- #helix
- #genetics
- #biology
- #science
- #double-helix
- #base-pair
- #transcription
- #replication
- #molecule
Accessibility notes
Rotating helix animation may cause motion sensitivity. prefers-reduced-motion shows static DNA structure. Scientific labels remain readable.
Browser support
- Chrome 76+
- Firefox 90+
- Safari 13+
- Edge 79+