Skip to content

Magic Stage Card

The card is a miniature theater. Curtains open, spotlight turns on, a tiny actor presents the content, and curtains close when finished.

Magic Stage Card

by FreeCsStyles Dev's

CardsMagic Stage
🌐🎨⚛️

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/magic-stage-card.

<iframe src="/embed/magic-stage-card" sandbox="allow-scripts" loading="lazy" title="Magic Stage Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Magic Stage 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="stage-card" onclick="this.classList.toggle('open')">
  <div class="stage-floor"></div>
  <div class="stage-spotlight"></div>
  <div class="stage-curtain-left"></div>
  <div class="stage-curtain-right"></div>
  <div class="stage-valance"></div>
  <div class="stage-actor">
    <div class="actor-emoji">🎩</div>
    <p class="actor-text">Abracadabra!</p>
    <div class="actor-props">🐇 🕊️ 🎴</div>
  </div>
  <div class="stage-content">
    <div class="stage-header">
      <div><div class="stage-title">The Great Illusion</div><div class="stage-performer">Magician</div></div>
      <div class="stage-status" id="stage-status">CLOSED</div>
    </div>
    <div class="stage-divider"></div>
    <div class="stage-grid">
      <div class="stage-stat"><div class="stage-stat-val">Illusion</div><div class="stage-stat-lbl">Type</div></div>
      <div class="stage-stat"><div class="stage-stat-val">🎭</div><div class="stage-stat-lbl">Theater</div></div>
    </div>
    <div class="stage-hint">[▼ curtain open]</div>
  </div>
</div>
CSS
.stage-card {
  position: relative;
  width: 220px;
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #120808, #0a0404);
  border: 1.5px solid rgba(251,191,36,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.4s ease;
}

.stage-card:hover {
  box-shadow: 0 0 30px rgba(220,38,38,0.08), 0 15px 40px rgba(0,0,0,0.5);
}

.stage-floor {
  position: absolute;
  bottom: 25%;
  left: 5%;
  right: 5%;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.08), transparent);
  filter: blur(2px);
}

.stage-spotlight {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 128px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(180deg, rgba(251,191,36,0.12), transparent);
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
  opacity: 0;
  transition: opacity 0.5s;
}

.stage-card.open .stage-spotlight {
  opacity: 0.6;
}

.stage-curtain-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(180deg, #7f1d1d, #450a0a);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: left center;
}

.stage-card.open .stage-curtain-left {
  transform: rotateY(-90deg) translateX(-20%);
}

.stage-curtain-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px);
}

.stage-curtain-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(180deg, #7f1d1d, #450a0a);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: right center;
}

.stage-card.open .stage-curtain-right {
  transform: rotateY(90deg) translateX(20%);
}

.stage-curtain-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(270deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px);
}

.stage-valance {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(180deg, #7f1d1d, #450a0a);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top center;
}

.stage-card.open .stage-valance {
  transform: scaleY(0) translateY(-100%);
}

.stage-actor {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.stage-card.open .stage-actor {
  display: flex;
  animation: reveal 0.5s ease-out;
}

@keyframes reveal {
  from { opacity: 0; scale: 0.5; }
  to { opacity: 1; scale: 1; }
}

.actor-emoji { font-size: 36px; margin-bottom: 4px; }
.actor-text { font-size: 9px; font-weight: 700; color: #fbbf24; }
.actor-props { display: flex; gap: 4px; justify-content: center; font-size: 14px; margin-top: 4px; }

.stage-content {
  position: absolute;
  inset-x: 0;
  bottom: 0;
  z-index: 20;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent);
}

.stage-header { display: flex; justify-content: space-between; align-items: center; }
.stage-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.stage-performer { font-size: 9px; color: rgba(251,191,36,0.44); }
.stage-status {
  padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em;
  color: #fbbf24; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.12);
}
.stage-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(251,191,36,0.08), transparent); }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage-stat { text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(251,191,36,0.02); border: 1px solid rgba(251,191,36,0.06); }
.stage-stat-val { font-size: 10px; font-weight: 600; color: #fbbf24; }
.stage-stat-lbl { font-size: 7px; margin-top: 2px; color: rgba(255,255,255,0.2); }
.stage-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(251,191,36,0.2); }

@media (prefers-reduced-motion: reduce) {
  .stage-card { transition: none; }
  .stage-curtain-left, .stage-curtain-right, .stage-valance { transition: none; }
  .stage-spotlight { transition: none; }
  .stage-actor { animation: none; }
}
Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-amber-400/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(220,38,38,0.08),0_15px_40px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#120808] to-[#0a0404] cursor-pointer">
  <div class="absolute bottom-[25%] left-[5%] right-[5%] h-2 rounded-full pointer-events-none z-2 bg-gradient-to-r from-transparent via-amber-400/20 to-transparent blur-sm"></div>
  <div class="absolute top-0 left-0 w-[40%] h-full z-10 pointer-events-none bg-gradient-to-b from-red-900 to-red-950 transition-all duration-500 origin-left group-hover:-translate-x-[20%] group-hover:rotate-y-[-90deg]">
    <div class="absolute inset-0" style="background: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px);"></div>
  </div>
  <div class="absolute top-0 right-0 w-[40%] h-full z-10 pointer-events-none bg-gradient-to-b from-red-900 to-red-950 transition-all duration-500 origin-right group-hover:translate-x-[20%] group-hover:rotate-y-[90deg]">
    <div class="absolute inset-0" style="background: repeating-linear-gradient(270deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px);"></div>
  </div>
  <div class="absolute top-0 left-0 right-0 h-8 z-10 pointer-events-none bg-gradient-to-b from-red-900 to-red-950 transition-all duration-500 origin-top group-hover:scale-y-0 group-hover:-translate-y-full"></div>
  <div class="absolute inset-x-0 bottom-0 z-20 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">The Great Illusion</p><p class="text-[9px] text-amber-400/50">Magician</p></div>
      <div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-amber-400 bg-amber-500/10 border border-amber-500/20">CLOSED</div>
    </div>
    <div class="h-px bg-gradient-to-r from-transparent via-amber-400/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-400">Illusion</p><p class="text-[7px] mt-0.5 text-white/20">Type</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-400">🎭</p><p class="text-[7px] mt-0.5 text-white/20">Theater</p></div>
    </div>
    <div class="text-center"><span class="text-[7px] font-mono text-amber-400/30">[▼ curtain open]</span></div>
  </div>
</div>
React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function MagicStageCard() {
  const [isHovered, setIsHovered] = useState(false);
  const [isOpen, setIsOpen] = useState(false);
  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);
  };
  return (
    <div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
      <motion.div ref={ref} onMouseMove={handleMouseMove} onClick={() => setIsOpen(!isOpen)} style={{ rotateX, rotateY, transformStyle: 'preserve-3d', cursor: 'pointer' }}>
        <motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #120808, #0a0404)', border: '1.5px solid rgba(251,191,36,0.08)' }}
          animate={{ boxShadow: isHovered ? '0 0 30px rgba(220,38,38,0.08), 0 15px 40px rgba(0,0,0,0.5)' : '0 10px 30px rgba(0,0,0,0.3)' }} transition={{ type: 'spring', stiffness: 280, damping: 20 }}>
          <div className="absolute bottom-[25%] left-[5%] right-[5%] h-2 rounded-full pointer-events-none z-2" style={{ background: 'linear-gradient(90deg, transparent, rgba(251,191,36,0.08), transparent)', filter: 'blur(2px)' }} />
          <motion.div className="absolute top-0 left-1/2 -translate-x-1/2 w-20 h-32 pointer-events-none z-2" style={{ background: 'linear-gradient(180deg, rgba(251,191,36,0.12), transparent)', clipPath: 'polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%)', opacity: isOpen ? 0.6 : 0 }} />
          <motion.div className="absolute top-0 left-0 w-[40%] h-full z-10 pointer-events-none" style={{ background: 'linear-gradient(180deg, #7f1d1d, #450a0a)', transformOrigin: 'left center' }}
            animate={isOpen ? { rotateY: -90, x: '-20%' } : { rotateY: 0, x: 0 }} transition={{ type: 'spring', stiffness: 120, damping: 12 }}>
            <div className="absolute inset-0" style={{ background: 'repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px)' }} />
          </motion.div>
          <motion.div className="absolute top-0 right-0 w-[40%] h-full z-10 pointer-events-none" style={{ background: 'linear-gradient(180deg, #7f1d1d, #450a0a)', transformOrigin: 'right center' }}
            animate={isOpen ? { rotateY: 90, x: '20%' } : { rotateY: 0, x: 0 }} transition={{ type: 'spring', stiffness: 120, damping: 12, delay: 0.05 }}>
            <div className="absolute inset-0" style={{ background: 'repeating-linear-gradient(270deg, transparent, transparent 6px, rgba(0,0,0,0.15) 6px, rgba(0,0,0,0.15) 8px)' }} />
          </motion.div>
          <motion.div className="absolute top-0 left-0 right-0 h-8 z-10 pointer-events-none" style={{ background: 'linear-gradient(180deg, #7f1d1d, #450a0a)', transformOrigin: 'top center' }}
            animate={isOpen ? { scaleY: 0, y: '-100%' } : { scaleY: 1, y: 0 }} transition={{ type: 'spring', stiffness: 150, damping: 14 }} />
          <div className="absolute inset-x-0 bottom-0 z-20 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 text-white/90">The Great Illusion</p><p className="text-[9px]" style={{ color: 'rgba(251,191,36,0.44)' }}>Magician</p></div>
              <motion.div className="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest" style={{ background: 'rgba(251,191,36,0.1)', border: '1px solid rgba(251,191,36,0.12)', color: '#fbbf24' }}>{isOpen ? 'ON STAGE' : 'CLOSED'}</motion.div>
            </div>
            <div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(251,191,36,0.08), transparent)' }} />
            <div className="grid grid-cols-2 gap-2">
              <div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(251,191,36,0.02)', border: '1px solid rgba(251,191,36,0.06)' }}>
                <p className="text-[10px] font-semibold" style={{ color: '#fbbf24' }}>Illusion</p><p className="text-[7px] mt-0.5 text-white/20">Type</p>
              </div>
              <div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(251,191,36,0.02)', border: '1px solid rgba(251,191,36,0.06)' }}>
                <p className="text-[10px] font-semibold" style={{ color: '#fbbf24' }}>🎭</p><p className="text-[7px] mt-0.5 text-white/20">Theater</p>
              </div>
            </div>
            <motion.div className="text-center" animate={isHovered ? { y: [0, -1, 0] } : {}} transition={{ duration: 1.5, repeat: isHovered ? Infinity : 0 }}>
              <span className="text-[7px] font-mono" style={{ color: 'rgba(251,191,36,0.2)' }}>{isOpen ? '[▼ curtain close]' : '[▼ curtain open]'}</span>
            </motion.div>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Interaction states & animations

  • Hover