Skip to content

Interactive 3D Perspective Card

A realistic 3D card that reacts naturally to cursor movement with full 3D tracking, dynamic lighting, and layered depth. Content elements float at different depths creating an immersive parallax experience.

Interactive 3D Perspective Card

by FreeCsStyles Dev's

Cards3D Perspective
🌐🎨⚛️💚🅰️🔥☁️
#3d#perspective#parallax#interactive#depth#layered#dynamic#tilt#premium#realistic

Embed this component

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

<iframe src="/embed/interactive-3d-card" sandbox="allow-scripts" loading="lazy" title="Interactive 3D Perspective Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Interactive 3D Perspective 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="perspective-card-wrapper">
  <div class="perspective-card">
    <div class="card-image-section">
      <div class="card-badge">PREMIUM</div>
      <div class="card-image-glow-1"></div>
      <div class="card-image-glow-2"></div>
    </div>
    <div class="card-body">
      <div class="card-title-row"></div>
      <div class="card-subtitle-row"></div>
      <div class="card-stats">
        <div class="cstat">
          <div class="cstat-value">12K</div>
          <div class="cstat-label">views</div>
        </div>
        <div class="cstat">
          <div class="cstat-value">84%</div>
          <div class="cstat-label">rate</div>
        </div>
        <div class="cstat">
          <div class="cstat-value">4.9</div>
          <div class="cstat-label">score</div>
        </div>
      </div>
      <div class="card-progress">
        <div class="progress-header">
          <span class="progress-label">Progress</span>
          <span class="progress-value">72%</span>
        </div>
        <div class="progress-bar">
          <div class="progress-fill"></div>
        </div>
      </div>
      <div class="card-actions">
        <div class="action-btn primary">VIEW</div>
        <div class="action-btn icon">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
            <path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v12"/>
          </svg>
        </div>
      </div>
    </div>
  </div>
  <div class="card-shadow"></div>
</div>
CSS
.perspective-card-wrapper {
  perspective: 1000px;
  width: 220px;
  position: relative;
}

.perspective-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(30,30,60,0.95), rgba(15,15,35,0.95));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.perspective-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(99,102,241,0.05);
}

.card-shadow {
  position: absolute;
  inset: -16px;
  border-radius: 16px;
  z-index: -1;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent);
  filter: blur(15px);
  transition: all 0.4s ease;
  opacity: 0.6;
}

.perspective-card:hover + .card-shadow,
.perspective-card-wrapper:hover .card-shadow {
  transform: scale(1.1);
  opacity: 1;
}

.card-image-section {
  height: 96px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.1));
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  height: 20px;
  padding: 0 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
}

.card-image-glow-1 {
  position: absolute;
  top: -24px;
  right: -24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(168,85,247,0.2));
  filter: blur(4px);
  transition: all 0.4s ease;
}

.perspective-card:hover .card-image-glow-1 {
  transform: scale(1.2) translate(-5px, 5px);
}

.card-image-glow-2 {
  position: absolute;
  bottom: -16px;
  left: -16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(99,102,241,0.15));
  filter: blur(3px);
  transition: all 0.4s ease;
}

.perspective-card:hover .card-image-glow-2 {
  transform: scale(1.3) translate(5px, -5px);
}

.card-body {
  padding: 16px;
}

.card-title-row {
  height: 12px;
  width: 75%;
  border-radius: 4px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
}

.card-subtitle-row {
  height: 10px;
  width: 50%;
  border-radius: 4px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.06);
}

.card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.cstat {
  flex: 1;
  text-align: center;
}

.cstat-value {
  font-size: 13px;
  font-weight: 700;
  color: #a78bfa;
}

.cstat-label {
  font-size: 8px;
  color: rgba(255,255,255,0.3);
}

.card-progress {
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.progress-label {
  font-size: 7px;
  color: rgba(255,255,255,0.4);
}

.progress-value {
  font-size: 7px;
  font-weight: 600;
  color: #a78bfa;
}

.progress-bar {
  height: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 72%;
  border-radius: 8px;
  background: linear-gradient(90deg, #a78bfa, #22d3ee);
  transition: width 1s ease-out;
}

.perspective-card:hover .progress-fill {
  width: 72%;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn.primary {
  flex: 1;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: white;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.action-btn.primary:hover {
  transform: scale(1.05);
}

.action-btn.icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.action-btn.icon:hover {
  transform: scale(1.1) rotate(90deg);
}

.action-btn.icon svg {
  width: 12px;
  height: 12px;
  color: rgba(255,255,255,0.5);
}

@media (prefers-reduced-motion: reduce) {
  .perspective-card, .card-shadow, .card-image-glow-1, .card-image-glow-2 {
    transition: none;
  }
  .perspective-card:hover {
    transform: none;
  }
}
Tailwind CSS
<div class="group perspective w-[220px] relative" style="perspective: 1000px;">
  <div class="relative rounded-2xl overflow-hidden bg-gradient-to-br from-[rgba(30,30,60,0.95)] to-[rgba(15,15,35,0.95)] border border-white/10 shadow-lg transition-all duration-500 group-hover:-translate-y-2.5 group-hover:shadow-[0_30px_60px_rgba(0,0,0,0.6),0_0_40px_rgba(99,102,241,0.05)]">
    <div class="relative h-24 overflow-hidden bg-gradient-to-br from-indigo-500/20 to-purple-500/10">
      <div class="absolute -top-6 -right-6 w-16 h-16 rounded-full bg-gradient-to-br from-indigo-500/30 to-purple-500/20 blur-sm transition-all duration-500 group-hover:scale-125 group-hover:-translate-x-1 group-hover:translate-y-1"></div>
      <div class="absolute -bottom-4 -left-4 w-12 h-12 rounded-full bg-gradient-to-br from-cyan-500/20 to-indigo-500/15 blur-sm transition-all duration-500 group-hover:scale-130 group-hover:translate-x-1 group-hover:-translate-y-1"></div>
      <div class="absolute top-3 left-3 h-5 px-2.5 rounded-full flex items-center text-[8px] font-bold tracking-wider bg-white/10 backdrop-blur border border-white/10 text-white/60">PREMIUM</div>
    </div>
    <div class="p-4 space-y-3">
      <div>
        <div class="h-3 w-3/4 rounded bg-gradient-to-r from-white/15 to-white/5 mb-1.5"></div>
        <div class="h-2.5 w-1/2 rounded bg-white/8"></div>
      </div>
      <div class="flex gap-4">
        <div class="flex-1 text-center group-hover:-translate-y-0.5 transition-transform" style="transition-delay: 0ms">
          <div class="text-xs font-bold text-purple-400">12K</div>
          <div class="text-[8px] text-white/30">views</div>
        </div>
        <div class="flex-1 text-center group-hover:-translate-y-1 transition-transform" style="transition-delay: 50ms">
          <div class="text-xs font-bold text-purple-400">84%</div>
          <div class="text-[8px] text-white/30">rate</div>
        </div>
        <div class="flex-1 text-center group-hover:-translate-y-1.5 transition-transform" style="transition-delay: 100ms">
          <div class="text-xs font-bold text-purple-400">4.9</div>
          <div class="text-[8px] text-white/30">score</div>
        </div>
      </div>
      <div>
        <div class="flex justify-between mb-1">
          <span class="text-[7px] text-white/40">Progress</span>
          <span class="text-[7px] font-medium text-purple-400">72%</span>
        </div>
        <div class="h-1.5 rounded-full bg-white/8 overflow-hidden">
          <div class="h-full w-[72%] rounded-full bg-gradient-to-r from-purple-400 to-cyan-400 transition-all duration-1000 group-hover:w-[72%]"></div>
        </div>
      </div>
      <div class="flex gap-2">
        <div class="flex-1 h-7 rounded-lg flex items-center justify-center text-[8px] font-bold cursor-pointer bg-gradient-to-r from-purple-400 to-purple-600 text-white shadow-lg hover:scale-105 active:scale-95 transition-all">VIEW</div>
        <div class="w-7 h-7 rounded-lg flex items-center justify-center cursor-pointer bg-white/5 border border-white/10 hover:scale-110 hover:rotate-90 active:scale-90 transition-all">
          <svg class="w-3 h-3 text-white/50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
            <path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v12"/>
          </svg>
        </div>
      </div>
    </div>
  </div>
  <div class="absolute -inset-4 rounded-2xl -z-10 bg-gradient-to-b from-black/50 to-transparent blur-xl transition-all duration-500 opacity-60 group-hover:scale-110 group-hover:opacity-100"></div>
</div>
React
import React, { useRef, useState } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function Interactive3DPerspectiveCard() {
  const ref = useRef<HTMLDivElement>(null);
  const [isHovered, setIsHovered] = useState(false);

  const x = useMotionValue(0);
  const y = useMotionValue(0);
  const springConfig = { damping: 30, stiffness: 200 };
  const rotateX = useSpring(y, springConfig);
  const rotateY = useSpring(x, springConfig);

  const handleMouseMove = (e: React.MouseEvent) => {
    if (!ref.current) return;
    const rect = ref.current.getBoundingClientRect();
    const centerX = rect.left + rect.width / 2;
    const centerY = rect.top + rect.height / 2;
    x.set(-((e.clientX - centerX) / (rect.width / 2)) * 18);
    y.set(((e.clientY - centerY) / (rect.height / 2)) * 18);
  };

  const stats = [
    { value: '12K', label: 'views' },
    { value: '84%', label: 'rate' },
    { value: '4.9', label: 'score' },
  ];

  return (
    <motion.div
      ref={ref}
      onMouseMove={handleMouseMove}
      onMouseEnter={() => setIsHovered(true)}
      onMouseLeave={() => { x.set(0); y.set(0); setIsHovered(false); }}
      style={{ rotateX, rotateY, transformStyle: 'preserve-3d', perspective: 1000 }}
    >
      <motion.div
        className="absolute -inset-4 rounded-2xl -z-10"
        style={{
          background: 'radial-gradient(ellipse, rgba(0,0,0,0.5), transparent)',
          filter: 'blur(15px)',
        }}
        animate={{ scale: isHovered ? 1.1 : 0.95, opacity: isHovered ? 1 : 0.6 }}
        transition={{ type: 'spring', stiffness: 300, damping: 20 }}
      />

      <motion.div
        className="relative rounded-2xl overflow-hidden border border-white/10"
        style={{
          width: 220,
          background: 'linear-gradient(145deg, rgba(30,30,60,0.95), rgba(15,15,35,0.95))',
          boxShadow: isHovered
            ? '0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(99,102,241,0.05)'
            : '0 10px 30px rgba(0,0,0,0.4)',
        }}
        animate={{ y: isHovered ? -10 : 0 }}
        transition={{ type: 'spring', stiffness: 300, damping: 25 }}
      >
        <div className="relative h-24 overflow-hidden bg-gradient-to-br from-indigo-500/20 to-purple-500/10">
          <motion.div
            className="absolute -top-6 -right-6 w-16 h-16 rounded-full bg-gradient-to-br from-indigo-500/30 to-purple-500/20 blur-sm"
            animate={{ scale: isHovered ? 1.2 : 1, x: isHovered ? -5 : 0, y: isHovered ? 5 : 0 }}
            transition={{ type: 'spring', stiffness: 200, damping: 15 }}
          />
          <motion.div
            className="absolute -bottom-4 -left-4 w-12 h-12 rounded-full bg-gradient-to-br from-cyan-500/20 to-indigo-500/15 blur-sm"
            animate={{ scale: isHovered ? 1.3 : 1, x: isHovered ? 5 : 0, y: isHovered ? -5 : 0 }}
            transition={{ type: 'spring', stiffness: 200, damping: 15 }}
          />
          <div className="absolute top-3 left-3 h-5 px-2.5 rounded-full flex items-center text-[7px] font-bold tracking-wider bg-white/10 backdrop-blur border border-white/10 text-white/60"
            style={{ transform: 'translateZ(50px)' }}>PREMIUM</div>
        </div>

        <div className="p-4 space-y-3">
          <div style={{ transform: 'translateZ(40px)' }}>
            <motion.div
              className="h-3 w-3/4 rounded bg-gradient-to-r from-white/15 to-white/5 mb-1.5"
              animate={isHovered ? { scaleX: 1.03, originX: 0 } : { scaleX: 1 }}
              transition={{ type: 'spring', stiffness: 300, damping: 20 }}
            />
            <div className="h-2.5 w-1/2 rounded bg-white/8" />
          </div>

          <div className="flex gap-4" style={{ transform: 'translateZ(30px)' }}>
            {stats.map((stat, i) => (
              <motion.div
                key={stat.label}
                className="flex-1 text-center"
                animate={isHovered ? { y: -2 * (i + 1) } : { y: 0 }}
                transition={{ type: 'spring', stiffness: 400, damping: 15, delay: i * 0.05 }}
              >
                <div className="text-xs font-bold text-purple-400">{stat.value}</div>
                <div className="text-[8px] text-white/30">{stat.label}</div>
              </motion.div>
            ))}
          </div>

          <div style={{ transform: 'translateZ(20px)' }}>
            <div className="flex justify-between mb-1">
              <span className="text-[7px] text-white/40">Progress</span>
              <span className="text-[7px] font-medium text-purple-400">72%</span>
            </div>
            <div className="h-1.5 rounded-full bg-white/8 overflow-hidden">
              <motion.div
                className="h-full rounded-full bg-gradient-to-r from-purple-400 to-cyan-400"
                animate={{ width: isHovered ? ['0%', '72%'] : '72%' }}
                transition={{ duration: 1, ease: 'easeOut', delay: 0.3 }}
              />
            </div>
          </div>

          <div className="flex gap-2 pt-1" style={{ transform: 'translateZ(45px)' }}>
            <motion.div
              className="flex-1 h-7 rounded-lg flex items-center justify-center text-[8px] font-bold cursor-pointer bg-gradient-to-r from-purple-400 to-purple-600 text-white"
              style={{
                boxShadow: isHovered
                  ? '0 4px 12px rgba(168,85,247,0.3)'
                  : 'none',
              }}
              whileHover={{ scale: 1.05 }}
              whileTap={{ scale: 0.95 }}
            >VIEW</motion.div>
            <motion.div
              className="w-7 h-7 rounded-lg flex items-center justify-center cursor-pointer bg-white/5 border border-white/10"
              style={{ transform: 'translateZ(55px)' }}
              whileHover={{ scale: 1.1, rotate: 90 }}
              whileTap={{ scale: 0.9 }}
            >
              <svg className="w-3 h-3 text-white/50" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
                <path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v12" />
              </svg>
            </motion.div>
          </div>
        </div>
      </motion.div>
    </motion.div>
  );
}

Where Interactive 3D Perspective Card fits

  • Product Showcases
  • SaaS Dashboards
  • Portfolios
  • Analytics
  • Premium Content
  • Marketing Sites

Interaction states & animations

  • Spring
  • Physics
  • Momentum
  • Parallax

Topics

  • #3d
  • #perspective
  • #parallax
  • #interactive
  • #depth
  • #layered
  • #dynamic
  • #tilt
  • #premium
  • #realistic

Accessibility notes

Ensure content remains accessible without 3D effects. Provide reduced motion alternative. All interactive elements should be keyboard navigable. Use prefers-reduced-motion to disable perspective transforms.

Browser support

  • Chrome 90+
  • Firefox 105+
  • Safari 15+
  • Edge 90+