AI Laboratory Card
A miniature laboratory where an AI scientist performs experiments. Features glass tubes, robots, computer screens, floating holograms, and bubbling liquids.
AI Laboratory Card
by FreeCsStyles Dev's
CardsAI Laboratory
🌐HTML/CSS🎨Tailwind⚛️React
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/ai-laboratory-card.
<iframe src="/embed/ai-laboratory-card" sandbox="allow-scripts" loading="lazy" title="AI Laboratory Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for AI Laboratory 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="lab-card" onclick="this.classList.toggle('running')">
<div class="lab-grid"></div>
<div class="lab-tube" style="left: 22%;"><div class="lab-liquid" style="height: 40%; background: #22d3ee;"></div></div>
<div class="lab-tube" style="left: 38%; height: 64px;"><div class="lab-liquid" style="height: 60%; background: #06b6d4;"></div></div>
<div class="lab-robot">🤖</div>
<div class="lab-content">
<div class="lab-header">
<div><div class="lab-title">Lab Sigma</div><div class="lab-exp">Quantum Flux</div></div>
<div class="lab-status">Ready</div>
</div>
<div class="lab-divider"></div>
<div class="lab-grid-stats">
<div class="lab-stat"><div class="lab-stat-val">Quantum</div><div class="lab-stat-lbl">Research</div></div>
<div class="lab-stat"><div class="lab-stat-val">Run</div><div class="lab-stat-lbl">Result</div></div>
</div>
<div class="lab-hint">[▼ click to start experiment]</div>
</div>
</div>CSS
.lab-card {
position: relative;
width: 220px;
min-height: 300px;
border-radius: 12px;
overflow: hidden;
background: linear-gradient(160deg, #0a1a22, #061218);
border: 1.5px solid rgba(34,211,238,0.08);
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
cursor: pointer;
transition: all 0.4s ease;
}
.lab-card:hover {
box-shadow: 0 0 30px rgba(34,211,238,0.08), 0 15px 40px rgba(0,0,0,0.4);
}
.lab-grid {
position: absolute;
bottom: 15%;
left: 10%;
right: 10%;
height: 64px;
pointer-events: none;
background-image: linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px), linear-gradient(0deg, rgba(34,211,238,0.03) 1px, transparent 1px);
background-size: 10px 10px;
perspective: 100px;
transform: rotateX(60deg);
}
.lab-tube {
position: absolute;
bottom: 25%;
width: 16px;
height: 56px;
border-radius: 50%;
pointer-events: none;
z-index: 5;
border: 1.5px solid rgba(34,211,238,0.12);
background: rgba(34,211,238,0.03);
overflow: hidden;
}
.lab-liquid {
position: absolute;
bottom: 0;
left: 0;
right: 0;
border-radius: 50%;
opacity: 0.3;
transition: height 0.3s ease;
}
.lab-robot {
position: absolute;
bottom: 22%;
right: 18%;
z-index: 5;
pointer-events: none;
font-size: 24px;
transition: all 0.3s ease;
}
.lab-card:hover .lab-robot {
transform: translateY(-4px);
}
.lab-content {
position: relative;
z-index: 10;
padding: 20px;
display: flex;
flex-direction: column;
gap: 12px;
}
.lab-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.lab-title {
font-size: 14px;
font-weight: 700;
color: rgba(255,255,255,0.9);
}
.lab-exp {
font-size: 9px;
color: rgba(34,211,238,0.44);
}
.lab-status {
padding: 2px 8px;
border-radius: 2px;
font-size: 7px;
font-weight: 700;
font-family: monospace;
letter-spacing: 0.1em;
color: #22d3ee;
background: rgba(34,211,238,0.1);
border: 1px solid rgba(34,211,238,0.12);
}
.lab-divider {
height: 1px;
background: linear-gradient(90deg, transparent, rgba(34,211,238,0.08), transparent);
}
.lab-grid-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.lab-stat {
text-align: center;
padding: 8px 4px;
border-radius: 8px;
background: rgba(34,211,238,0.02);
border: 1px solid rgba(34,211,238,0.06);
}
.lab-stat-val {
font-size: 11px;
font-weight: 600;
color: #22d3ee;
}
.lab-stat-lbl {
font-size: 7px;
margin-top: 2px;
color: rgba(255,255,255,0.2);
}
.lab-hint {
text-align: center;
font-size: 7px;
font-family: monospace;
color: rgba(34,211,238,0.2);
}
@media (prefers-reduced-motion: reduce) {
.lab-card { transition: none; }
.lab-liquid { transition: none; }
.lab-robot { transition: none; }
}Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-xl overflow-hidden border border-cyan-400/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(34,211,238,0.08),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-br from-[#0a1a22] to-[#061218] cursor-pointer">
<div class="absolute bottom-[15%] left-[10%] right-[10%] h-16 pointer-events-none" style="background-image: linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px), linear-gradient(0deg, rgba(34,211,238,0.03) 1px, transparent 1px); background-size: 10px 10px; perspective: 100px; transform: rotateX(60deg);"></div>
<div class="absolute bottom-[25%] left-[22%] w-4 h-14 rounded-full pointer-events-none z-[5] border border-cyan-400/20 bg-cyan-400/10"><div class="absolute bottom-0 left-0 right-0 rounded-full h-2/5 bg-cyan-400 opacity-30"></div></div>
<div class="absolute bottom-[25%] left-[38%] w-4 h-16 rounded-full pointer-events-none z-[5] border border-cyan-400/20 bg-cyan-400/10"><div class="absolute bottom-0 left-0 right-0 rounded-full h-3/5 bg-cyan-500 opacity-30"></div></div>
<div class="absolute bottom-[22%] right-[18%] z-[5] pointer-events-none group-hover:-translate-y-1 transition-transform"><div class="w-8 h-8 rounded-lg flex items-center justify-center bg-cyan-400/10 border border-cyan-400/20"><span class="text-xs">🤖</span></div></div>
<div class="relative z-10 p-5 space-y-3">
<div class="flex items-center justify-between">
<div><p class="text-sm font-bold text-white/90">Lab Sigma</p><p class="text-[9px] text-cyan-400/50">Quantum Flux</p></div>
<div class="px-2 py-0.5 rounded-sm text-[7px] font-bold font-mono tracking-widest text-cyan-400 bg-cyan-500/10 border border-cyan-500/20">Ready</div>
</div>
<div class="h-px bg-gradient-to-r from-transparent via-cyan-400/20 to-transparent"></div>
<div class="grid grid-cols-2 gap-2">
<div class="text-center py-2 rounded-lg bg-cyan-400/10 border border-cyan-400/20"><p class="text-[11px] font-semibold text-cyan-400">Quantum</p><p class="text-[7px] mt-0.5 text-white/20">Research</p></div>
<div class="text-center py-2 rounded-lg bg-cyan-400/10 border border-cyan-400/20"><p class="text-[11px] font-semibold text-cyan-500">Run</p><p class="text-[7px] mt-0.5 text-white/20">Result</p></div>
</div>
<div class="text-center"><span class="text-[7px] font-mono text-cyan-400/30">[▼ click to start experiment]</span></div>
</div>
</div>React
import React, { useState, useRef, useCallback } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';
export function AILaboratoryCard() {
const [isHovered, setIsHovered] = useState(false);
const [isRunning, setIsRunning] = useState(false);
const [result, setResult] = useState(null);
const ref = useRef(null);
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();
const cx = rect.left + rect.width / 2;
const cy = rect.top + rect.height / 2;
x.set(-((e.clientX - cx) / (rect.width / 2)) * 6);
y.set(((e.clientY - cy) / (rect.height / 2)) * 6);
};
const handleClick = useCallback(() => {
if (isRunning) return;
setIsRunning(true);
setResult(null);
setTimeout(() => { setIsRunning(false); setResult(`E = mc² · λ = ${(Math.random() * 100).toFixed(2)} nm`); }, 2000);
}, [isRunning]);
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', cursor: 'pointer' }}>
<motion.div className="relative overflow-hidden rounded-xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #0a1a22, #061218)', border: '1.5px solid rgba(34,211,238,0.08)' }}
animate={{ boxShadow: isHovered ? '0 0 30px rgba(34,211,238,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 bottom-[15%] left-[10%] right-[10%] h-16 pointer-events-none" style={{ backgroundImage: 'linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px), linear-gradient(0deg, rgba(34,211,238,0.03) 1px, transparent 1px)', backgroundSize: '10px 10px', perspective: '100px', transform: 'rotateX(60deg)' }} />
<div className="absolute bottom-[25%] left-[22%] w-4 h-14 rounded-full pointer-events-none z-[5]" style={{ border: '1.5px solid rgba(34,211,238,0.12)', background: 'rgba(34,211,238,0.03)' }}>
<motion.div className="absolute bottom-0 left-0 right-0 rounded-full" style={{ background: '#22d3ee', height: '40%' }}
animate={isRunning ? { height: ['40%', '80%', '40%'], opacity: [0.4, 0.8, 0.4] } : { height: '40%', opacity: 0.3 }}
transition={{ duration: 1.5, repeat: isRunning ? Infinity : 0, ease: 'easeInOut' }} />
</div>
<div className="absolute bottom-[25%] left-[38%] w-4 h-16 rounded-full pointer-events-none z-[5]" style={{ border: '1.5px solid rgba(34,211,238,0.12)', background: 'rgba(34,211,238,0.03)' }}>
<motion.div className="absolute bottom-0 left-0 right-0 rounded-full" style={{ background: '#06b6d4', height: '60%' }}
animate={isRunning ? { height: ['60%', '30%', '60%'], opacity: [0.3, 0.7, 0.3] } : { height: '60%', opacity: 0.3 }}
transition={{ duration: 2, repeat: isRunning ? Infinity : 0, ease: 'easeInOut' }} />
</div>
{isHovered && !isRunning && [...Array(4)].map((_, i) => (
<motion.p key={i} className="absolute text-[6px] font-mono pointer-events-none z-[5]" style={{ color: '#22d3ee', opacity: 0.3 }}
initial={{ x: `${20 + i * 15}%`, y: `${30 + i * 8}%`, opacity: 0 }}
animate={{ y: [0, -15 - i * 5], opacity: [0, 0.4, 0] }} transition={{ duration: 2, repeat: Infinity, delay: i * 0.5, ease: 'easeOut' }}>
{['Ψ(x,t)', '∇·E = ρ/ε₀', '∫F·dr', '∂ψ/∂t'][i]}</motion.p>
))}
{isRunning && [...Array(6)].map((_, i) => (
<motion.div key={i} className="absolute w-0.5 h-2 pointer-events-none z-[6]" style={{ background: '#22d3ee', left: `${15 + i * 14}%`, top: `${30 + Math.random() * 20}%` }}
initial={{ opacity: 0, scaleY: 0 }}
animate={{ opacity: [0, 1, 0], scaleY: [0, 2, 0], rotate: [0, 30, -30, 0] }}
transition={{ duration: 0.3, repeat: Infinity, delay: i * 0.08, ease: 'easeOut' }} />
))}
<motion.div className="absolute bottom-[22%] right-[18%] z-[5] pointer-events-none" animate={isHovered ? { y: [0, -2, 0] } : {}} transition={{ duration: 1.5, repeat: isHovered ? Infinity : 0 }}>
<div className="w-8 h-8 rounded-lg flex items-center justify-center" style={{ background: 'rgba(34,211,238,0.08)', border: '1px solid rgba(34,211,238,0.12)' }}><span className="text-xs">🤖</span></div>
</motion.div>
<div className="relative z-10 p-5 space-y-3">
<div className="flex items-center justify-between">
<div><p className="text-sm font-bold text-white/90">Lab Sigma</p><p className="text-[9px]" style={{ color: 'rgba(34,211,238,0.44)' }}>Quantum Flux</p></div>
<motion.div className="px-2 py-0.5 rounded-sm text-[7px] font-bold font-mono tracking-widest" style={{ background: 'rgba(34,211,238,0.1)', border: '1px solid rgba(34,211,238,0.12)', color: '#22d3ee' }}
animate={isRunning ? { opacity: [0.4, 1, 0.4] } : {}} transition={{ duration: 0.5, repeat: isRunning ? Infinity : 0 }}>{isRunning ? 'RUNNING' : 'Ready'}</motion.div>
</div>
<div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(34,211,238,0.08), transparent)' }} />
<div className="grid grid-cols-2 gap-2">
<div className="text-center py-2 rounded-lg" style={{ background: 'rgba(34,211,238,0.02)', border: '1px solid rgba(34,211,238,0.06)' }}>
<p className="text-[11px] font-semibold" style={{ color: '#22d3ee' }}>Quantum</p><p className="text-[7px] mt-0.5 text-white/20">Research</p>
</div>
<div className="text-center py-2 rounded-lg" style={{ background: 'rgba(34,211,238,0.02)', border: '1px solid rgba(34,211,238,0.06)' }}>
<p className="text-[11px] font-semibold" style={{ color: '#06b6d4' }}>{isRunning ? '...' : result ? '✓' : 'Run'}</p><p className="text-[7px] mt-0.5 text-white/20">Result</p>
</div>
</div>
{result && (
<motion.div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(34,211,238,0.04)', border: '1px solid rgba(34,211,238,0.08)' }}
initial={{ opacity: 0, y: 5 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }}>
<span className="text-[7px] font-mono" style={{ color: '#22d3ee' }}>{result}</span>
</motion.div>
)}
<motion.div className="text-center pt-1" animate={isHovered ? { y: [0, -1, 0] } : {}} transition={{ duration: 1.5, repeat: isHovered ? Infinity : 0 }}>
<span className="text-[7px] font-mono" style={{ color: 'rgba(34,211,238,0.2)' }}>{isRunning ? '[⚡ running...]' : result ? '[▼ run again]' : '[▼ click to start experiment]'}</span>
</motion.div>
</div>
</motion.div>
</motion.div>
</div>
);
}Interaction states & animations
- Hover