Skip to content

Tesseract Hypercube Card

A mind-bending card featuring a rotating 4D tesseract (hypercube) projected into 3D space. The inner cube rotates within the outer cube, connected by shimmering edges. Hovering accelerates the rotation and shifts the projection angle. Clicking changes the projection method, revealing different 3D slices of the 4D shape.

Tesseract Hypercube Card

by FreeCsStyles Dev's

CardsSpin / Rotation / Flip
🌐🎨⚛️💚🅰️🔥☁️
#tesseract#hypercube#4d#geometry#math#cube#dimension#projection#wireframe#rotation

Embed this component

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

<iframe src="/embed/tesseract-hypercube-card" sandbox="allow-scripts" loading="lazy" title="Tesseract Hypercube Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Tesseract Hypercube 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="tesseract-card">
  <div class="hypercube-container">
    <div class="hypercube">
      <div class="cube outer">
        <div class="cube-face front"></div><div class="cube-face back"></div>
        <div class="cube-face left"></div><div class="cube-face right"></div>
        <div class="cube-face top"></div><div class="cube-face bottom"></div>
      </div>
      <div class="cube inner">
        <div class="cube-face front"></div><div class="cube-face back"></div>
        <div class="cube-face left"></div><div class="cube-face right"></div>
        <div class="cube-face top"></div><div class="cube-face bottom"></div>
      </div>
      <div class="hypercube-edges"></div>
    </div>
  </div>
  <div class="tesseract-content">
    <div class="tesseract-title">Tesseract</div>
    <div class="tesseract-sub">4D Hypercube</div>
  </div>
</div>
CSS
.tesseract-card { position: relative; width: 220px; min-height: 290px; border-radius: 16px; background: linear-gradient(160deg, #04040e, #020208); border: 1.5px solid rgba(50,100,255,0.12); overflow: hidden; cursor: pointer; }
.tesseract-card:hover { box-shadow: 0 0 30px rgba(50,100,255,0.08); }
.hypercube-container { position: absolute; left: 50%; top: 35%; transform: translate(-50%,-50%); width: 90px; height: 90px; perspective: 300px; }
.hypercube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: hyperRotate 8s linear infinite; }
.tesseract-card:hover .hypercube { animation-duration: 2s; }
@keyframes hyperRotate { 0% { transform: rotateX(20deg) rotateY(0deg); } 100% { transform: rotateX(20deg) rotateY(360deg); } }
.cube { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
.cube.outer { width: 70px; height: 70px; margin-left: -35px; margin-top: -35px; }
.cube.inner { width: 40px; height: 40px; margin-left: -20px; margin-top: -20px; animation: innerSpin 4s linear infinite reverse; }
@keyframes innerSpin { 0% { transform: rotateX(0deg) rotateY(0deg); } 100% { transform: rotateX(360deg) rotateY(360deg); } }
.cube-face { position: absolute; border: 1px solid rgba(50,100,255,0.2); background: rgba(50,100,255,0.03); }
.cube.outer .cube-face { width: 70px; height: 70px; }
.cube.inner .cube-face { width: 40px; height: 40px; }
.cube-face.front { transform: translateZ(35px); } .cube-face.back { transform: translateZ(-35px); }
.cube-face.left { transform: rotateY(90deg) translateZ(35px); } .cube-face.right { transform: rotateY(-90deg) translateZ(35px); }
.cube-face.top { transform: rotateX(90deg) translateZ(35px); } .cube-face.bottom { transform: rotateX(-90deg) translateZ(35px); }
.cube.inner .cube-face.front { transform: translateZ(20px); } .cube.inner .cube-face.back { transform: translateZ(-20px); }
.cube.inner .cube-face.left { transform: rotateY(90deg) translateZ(20px); } .cube.inner .cube-face.right { transform: rotateY(-90deg) translateZ(20px); }
.cube.inner .cube-face.top { transform: rotateX(90deg) translateZ(20px); } .cube.inner .cube-face.bottom { transform: rotateX(-90deg) translateZ(20px); }
.tesseract-content { position: absolute; inset-x: 0; bottom: 0; padding: 16px; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); }
.tesseract-title { font-size: 14px; font-weight: 700; color: rgba(150,180,255,0.9); }
.tesseract-sub { font-size: 9px; color: rgba(50,100,255,0.5); }
Tailwind CSS
<div class="group relative w-[220px] min-h-[290px] rounded-2xl bg-gradient-to-b from-[#04040e] to-[#020208] border border-blue-500/20 overflow-hidden cursor-pointer group-hover:shadow-[0_0_30px_rgba(50,100,255,0.08)]">
  <div class="absolute left-1/2 top-[35%] -translate-x-1/2 -translate-y-1/2 w-[90px] h-[90px] [perspective:300px]">
    <div class="w-full h-full [transform-style:preserve-3d] animate-[hyperRotate_8s_linear_infinite] group-hover:animate-[hyperRotate_2s_linear_infinite]">
      <div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[70px] h-[70px] [transform-style:preserve-3d]">
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:translateZ(35px)]"></div>
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:translateZ(-35px)]"></div>
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:rotateY(90deg)_translateZ(35px)]"></div>
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:rotateY(-90deg)_translateZ(35px)]"></div>
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:rotateX(90deg)_translateZ(35px)]"></div>
        <div class="absolute inset-0 border border-blue-500/20 bg-blue-500/5 [transform:rotateX(-90deg)_translateZ(35px)]"></div>
      </div>
      <div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-10 h-10 [transform-style:preserve-3d] animate-[innerSpin_4s_linear_infinite_reverse]">
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:translateZ(20px)]"></div>
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:translateZ(-20px)]"></div>
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:rotateY(90deg)_translateZ(20px)]"></div>
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:rotateY(-90deg)_translateZ(20px)]"></div>
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:rotateX(90deg)_translateZ(20px)]"></div>
        <div class="absolute inset-0 border border-blue-400/30 bg-blue-500/5 [transform:rotateX(-90deg)_translateZ(20px)]"></div>
      </div>
    </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-blue-300/90">Tesseract</p>
    <p class="text-[9px] text-blue-500/50">4D Hypercube</p>
  </div>
</div>
React
import React, { useState } from 'react';
import { motion } from 'framer-motion';

export function TesseractHypercubeCard({ width = 220 }) {
  const [projection, setProjection] = useState(0);
  const [isHovered, setIsHovered] = useState(false);
  const faces = ['front', 'back', 'left', 'right', 'top', 'bottom'];
  const faceTransforms = ['translateZ(35px)', 'translateZ(-35px)', 'rotateY(90deg) translateZ(35px)', 'rotateY(-90deg) translateZ(35px)', 'rotateX(90deg) translateZ(35px)', 'rotateX(-90deg) translateZ(35px)'];
  const innerTransforms = ['translateZ(20px)', 'translateZ(-20px)', 'rotateY(90deg) translateZ(20px)', 'rotateY(-90deg) translateZ(20px)', 'rotateX(90deg) translateZ(20px)', 'rotateX(-90deg) translateZ(20px)'];
  return (
    <div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
      <motion.div onClick={() => setProjection((p) => (p + 1) % 3)} 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, #04040e, #020208)', border: '1.5px solid rgba(50,100,255,0.12)' }}>
          <motion.div className="absolute left-1/2 top-[35%] -translate-x-1/2 -translate-y-1/2" style={{ width: 90, height: 90, perspective: 300 }}>
            <motion.div style={{ transformStyle: 'preserve-3d', width: '100%', height: '100%' }}
              animate={{ rotateX: [20, 30, 10][projection], rotateY: 360 }}
              transition={{ rotateY: { duration: isHovered ? 2 : 8, repeat: Infinity, ease: 'linear' }, rotateX: { duration: 0.5 } }}>
              <motion.div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" style={{ width: 70, height: 70, transformStyle: 'preserve-3d' }}>
                {faceTransforms.map((t, i) => (
                  <div key={i} className="absolute inset-0" style={{ border: '1px solid rgba(50,100,255,0.2)', background: 'rgba(50,100,255,0.03)', transform: t }} />
                ))}
              </motion.div>
              <motion.div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" style={{ width: 40, height: 40, transformStyle: 'preserve-3d' }}
                animate={{ rotateX: 360, rotateY: 360 }} transition={{ duration: 4, repeat: Infinity, ease: 'linear', direction: 'reverse' }}>
                {innerTransforms.map((t, i) => (
                  <div key={i} className="absolute inset-0" style={{ border: '1px solid rgba(50,100,255,0.3)', background: 'rgba(50,100,255,0.05)', transform: t }} />
                ))}
              </motion.div>
            </motion.div>
          </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(150,180,255,0.9)' }}>Tesseract</p>
            <p className="text-[9px]" style={{ color: 'rgba(50,100,255,0.5)' }}>{['Standard', 'Rotated', 'Sliced'][projection]} Projection</p>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Where Tesseract Hypercube Card fits

  • Math Visualization
  • Physics Cards
  • Sci-Fi UI
  • Education Tools
  • Geometry Displays

Interaction states & animations

  • Tesseract 4D rotation
  • Projection angle shift
  • Inner/outer cube connection
  • Hypercube edge shimmer
  • Projection method morphing

Topics

  • #tesseract
  • #hypercube
  • #4d
  • #geometry
  • #math
  • #cube
  • #dimension
  • #projection
  • #wireframe
  • #rotation

Accessibility notes

Complex rotation may cause significant motion sensitivity. prefers-reduced-motion shows static wireframe projection. All information accessible without animation.

Browser support

  • Chrome 76+
  • Firefox 90+
  • Safari 13+
  • Edge 79+