Skip to content

Mini Planet Card

Every card is an entire living planet. Tiny spherical planet with mountains, ocean, clouds, houses, trees, and animated animals.

Mini Planet Card

by FreeCsStyles Dev's

CardsMini Planet
🌐🎨⚛️

Embed this component

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

<iframe src="/embed/mini-planet-card" sandbox="allow-scripts" loading="lazy" title="Mini Planet Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Mini Planet 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="planet-card" onclick="this.classList.toggle('zoomed')">
  <div class="planet-stars"></div>
  <div class="planet-sphere">
    <div class="planet-land" style="top: 20%; left: 25%; width: 20px; height: 12px;"></div>
    <div class="planet-land" style="top: 50%; left: 15%; width: 32px; height: 16px;"></div>
    <div class="planet-land" style="top: 30%; left: 55%; width: 24px; height: 20px;"></div>
    <div class="planet-land" style="top: 60%; left: 50%; width: 16px; height: 12px;"></div>
    <div class="planet-cloud"></div>
    <div class="planet-cloud" style="top: 40%; left: 30%;"></div>
    <div class="planet-cloud" style="top: 55%; left: 45%;"></div>
  </div>
  <div class="planet-orbit"></div>
  <div class="planet-houses"></div>
  <div class="planet-content">
    <div class="planet-header">
      <div>
        <div class="planet-title">Terra Nova</div>
        <div class="planet-sub">Class M Planet</div>
      </div>
      <div class="planet-population">
        <div class="planet-pop-val">12.4M</div>
        <div class="planet-pop-lbl">POPULATION</div>
      </div>
    </div>
    <div class="planet-divider"></div>
    <div class="planet-grid">
      <div class="planet-stat"><div class="planet-stat-val">Temperate</div><div class="planet-stat-lbl">Climate</div></div>
      <div class="planet-stat"><div class="planet-stat-val">Mixed</div><div class="planet-stat-lbl">Terrain</div></div>
    </div>
    <div class="planet-hint">[✦ EXPLORE PLANET ✦]</div>
  </div>
</div>
CSS
.planet-card {
  position: relative;
  width: 220px;
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0a1a, #060612);
  border: 1.5px solid rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.4s ease;
}

.planet-card:hover {
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.planet-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.planet-stars::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.3), transparent);
  animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.planet-sphere {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #4a8a50, #2a6fa0);
  box-shadow: 0 0 30px rgba(42,111,160,0.25), inset 0 -10px 30px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
}

.planet-card:hover .planet-sphere {
  scale: 1.15;
}

.planet-land {
  position: absolute;
  border-radius: 50%;
  background: #4a8a50;
  opacity: 0.5;
}

.planet-cloud {
  position: absolute;
  width: 32px;
  height: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  top: 25%;
  left: 10%;
  animation: drift 4s ease-in-out infinite;
}

.planet-card:hover .planet-cloud {
  animation-duration: 4s;
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}

.planet-orbit {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(42,111,160,0.12);
  animation: orbit 12s linear infinite;
}

.planet-card:hover .planet-orbit {
  animation-duration: 12s;
}

@keyframes orbit {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg); }
}

.planet-houses {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  gap: 2px;
  align-items: flex-end;
}

.planet-houses::before {
  content: '▄▅▃▆▄';
  font-size: 8px;
  color: rgba(74,138,80,0.6);
  letter-spacing: 2px;
}

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

.planet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.planet-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.planet-sub {
  font-size: 9px;
  color: rgba(42,111,160,0.56);
}

.planet-population { text-align: right; }
.planet-pop-val {
  font-size: 18px;
  font-weight: 200;
  color: rgba(255,255,255,0.7);
}
.planet-pop-lbl {
  font-size: 7px;
  color: rgba(255,255,255,0.2);
}
.planet-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(42,111,160,0.19), transparent);
}
.planet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.planet-stat {
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(42,111,160,0.06);
  border: 1px solid rgba(42,111,160,0.08);
}
.planet-stat-val {
  font-size: 10px;
  font-weight: 600;
  color: #4a8a50;
}
.planet-stat-lbl {
  font-size: 7px;
  margin-top: 2px;
  color: rgba(255,255,255,0.2);
}
.planet-hint {
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(42,111,160,0.25);
}

@media (prefers-reduced-motion: reduce) {
  .planet-card { transition: none; }
  .planet-sphere { transition: none; }
  .planet-cloud { animation: none; }
  .planet-orbit { animation: none; }
  .planet-stars::before { animation: none; }
}
Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-white/10 shadow-lg group-hover:shadow-[0_25px_50px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#0a0a1a] to-[#060612] cursor-pointer">
  <div class="absolute inset-0 pointer-events-none" style="background-image: radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.3), transparent), radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.2), transparent), radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.3), transparent), radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.2), transparent), radial-gradient(1.5px 1.5px at 90% 60%, rgba(255,255,255,0.3), transparent);"></div>
  <div class="absolute top-[25%] left-1/2 -translate-x-1/2 w-[100px] h-[100px] rounded-full pointer-events-none bg-[radial-gradient(circle_at_35%_35%,#4a8a50,#2a6fa0)] shadow-[0_0_30px_rgba(42,111,160,0.25),inset_0_-10px_30px_rgba(0,0,0,0.3)] group-hover:scale-110 transition-all duration-300">
    <div class="absolute top-[20%] left-[25%] w-5 h-3 rounded-full bg-green-600/50"></div>
    <div class="absolute top-[50%] left-[15%] w-8 h-4 rounded-full bg-green-600/40"></div>
    <div class="absolute top-[30%] left-[55%] w-6 h-5 rounded-full bg-green-600/50"></div>
    <div class="absolute w-8 h-1.5 rounded-full bg-white/10 top-[25%] left-[10%] animate-[drift_4s_ease-in-out_infinite]"></div>
    <div class="absolute w-8 h-1.5 rounded-full bg-white/10 top-[40%] left-[30%] animate-[drift_5s_ease-in-out_infinite]"></div>
  </div>
  <div class="absolute top-[25%] left-1/2 -translate-x-1/2 w-[130px] h-[130px] rounded-full border border-blue-500/20 pointer-events-none animate-[spin_12s_linear_infinite]"></div>
  <div class="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2 bg-gradient-to-t from-black/40 to-transparent">
    <div class="flex items-center justify-between">
      <div><p class="text-sm font-bold text-white/90">Terra Nova</p><p class="text-[9px] text-blue-400/60">Class M Planet</p></div>
      <div class="text-right"><p class="text-lg font-extralight text-white/70">12.4M</p><p class="text-[7px] text-white/20">POPULATION</p></div>
    </div>
    <div class="h-px bg-gradient-to-r from-transparent via-blue-500/20 to-transparent"></div>
    <div class="grid grid-cols-2 gap-2">
      <div class="text-center py-1.5 rounded-lg bg-blue-500/10 border border-blue-500/20"><p class="text-[10px] font-semibold text-green-500">Temperate</p><p class="text-[7px] mt-0.5 text-white/20">Climate</p></div>
      <div class="text-center py-1.5 rounded-lg bg-blue-500/10 border border-blue-500/20"><p class="text-[10px] font-semibold text-green-500">Mixed</p><p class="text-[7px] mt-0.5 text-white/20">Terrain</p></div>
    </div>
    <div class="text-center"><span class="text-[7px] tracking-widest text-blue-400/30">[✦ EXPLORE PLANET ✦]</span></div>
  </div>
</div>
React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function MiniPlanetCard() {
  const [isHovered, setIsHovered] = useState(false);
  const ref = useRef(null);
  const x = useMotionValue(0);
  const y = useMotionValue(0);
  const rotateX = useSpring(y, { damping: 20, stiffness: 180 });
  const rotateY = useSpring(x, { damping: 20, stiffness: 180 });
  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)) * 8);
    y.set(((e.clientY - cy) / (rect.height / 2)) * 8);
  };
  return (
    <div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
      <motion.div ref={ref} onMouseMove={handleMouseMove} style={{ rotateX, rotateY, transformStyle: 'preserve-3d' }}>
        <motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: 'linear-gradient(160deg, #0a0a1a, #060612)', border: '1.5px solid rgba(255,255,255,0.04)' }}
          animate={{ boxShadow: isHovered ? '0 25px 50px rgba(0,0,0,0.5)' : '0 10px 30px rgba(0,0,0,0.3)' }} transition={{ type: 'spring', stiffness: 280, damping: 20 }}>
          {[...Array(20)].map((_, i) => (
            <motion.div key={i} className="absolute rounded-full pointer-events-none" style={{ left: `${Math.random() * 100}%`, top: `${Math.random() * 100}%`, width: 0.5 + Math.random(), height: 0.5 + Math.random(), background: 'rgba(255,255,255,0.3)' }}
              animate={{ opacity: [0.1, 0.6, 0.1] }} transition={{ duration: 1.5 + Math.random() * 2, repeat: Infinity, delay: Math.random() * 2 }} />
          ))}
          <motion.div className="absolute top-[25%] left-1/2 -translate-x-1/2 rounded-full pointer-events-none" style={{ width: 100, height: 100, background: 'radial-gradient(circle at 35% 35%, #4a8a50, #2a6fa0)', boxShadow: '0 0 30px rgba(42,111,160,0.25), inset 0 -10px 30px rgba(0,0,0,0.3)' }}
            animate={{ scale: isHovered ? 1.15 : 1, rotate: isHovered ? [0, 5, -5, 0] : 0 }} transition={{ duration: 4, repeat: isHovered ? Infinity : 0, ease: 'easeInOut' }}>
            <div className="absolute top-[20%] left-[25%] w-5 h-3 rounded-full" style={{ background: '#4a8a50', opacity: 0.5 }} />
            <div className="absolute top-[50%] left-[15%] w-8 h-4 rounded-full" style={{ background: '#4a8a50', opacity: 0.4 }} />
            <div className="absolute top-[30%] left-[55%] w-6 h-5 rounded-full" style={{ background: '#4a8a50', opacity: 0.5 }} />
            <div className="absolute top-[60%] left-[50%] w-4 h-3 rounded-full" style={{ background: '#4a8a50', opacity: 0.4 }} />
            {isHovered && [...Array(3)].map((_, i) => (
              <motion.div key={i} className="absolute w-8 h-1.5 rounded-full" style={{ background: 'rgba(255,255,255,0.15)', top: `${25 + i * 15}%`, left: `${10 + i * 20}%` }}
                animate={{ x: [0, 20, 0] }} transition={{ duration: 4 + i, repeat: Infinity, ease: 'easeInOut', delay: i * 1.5 }} />
            ))}
          </motion.div>
          <motion.div className="absolute top-[25%] left-1/2 -translate-x-1/2 rounded-full pointer-events-none" style={{ width: 130, height: 130, border: '1px solid rgba(42,111,160,0.12)', borderRadius: '50%' }}
            animate={{ rotate: isHovered ? 360 : 0 }} transition={{ duration: 12, repeat: isHovered ? Infinity : 0, ease: 'linear' }} />
          {isHovered && [...Array(3)].map((_, i) => (
            <motion.div key={i} className="absolute pointer-events-none" style={{ top: `${15 + i * 8}%` }}
              initial={{ left: '-5%' }} animate={{ left: '105%' }} transition={{ duration: 3 + i, repeat: Infinity, delay: i * 1.5, ease: 'linear' }}>
              <svg width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="rgba(255,255,255,0.15)" strokeWidth="1"><path d="M1 3Q3 1 5 3Q7 1 9 3" /></svg>
            </motion.div>
          ))}
          <motion.div className="absolute pointer-events-none" style={{ top: '35%', left: '62%' }}
            animate={isHovered ? { rotate: 360 } : { rotate: 0 }} transition={{ duration: 3, repeat: isHovered ? Infinity : 0, ease: 'linear' }}>
            <svg width="8" height="8" viewBox="0 0 8 8" fill="#4a8a50" opacity="0.4"><rect x="3.5" y="0" width="1" height="4" /><rect x="0" y="3" width="8" height="1" /></svg>
          </motion.div>
          <div className="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.4), transparent)' }}>
            <div className="flex items-center justify-between">
              <div><p className="text-sm font-bold text-white/90">Terra Nova</p><p className="text-[9px]" style={{ color: 'rgba(42,111,160,0.56)' }}>Class M Planet</p></div>
              <div className="text-right"><p className="text-lg font-extralight text-white/70">12.4M</p><p className="text-[7px] text-white/20">POPULATION</p></div>
            </div>
            <div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(42,111,160,0.19), transparent)' }} />
            <div className="grid grid-cols-2 gap-2">
              <div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(42,111,160,0.06)', border: '1px solid rgba(42,111,160,0.08)' }}>
                <p className="text-[10px] font-semibold" style={{ color: '#4a8a50' }}>Temperate</p><p className="text-[7px] mt-0.5 text-white/20">Climate</p>
              </div>
              <div className="text-center py-1.5 rounded-lg" style={{ background: 'rgba(42,111,160,0.06)', border: '1px solid rgba(42,111,160,0.08)' }}>
                <p className="text-[10px] font-semibold" style={{ color: '#4a8a50' }}>Mixed</p><p className="text-[7px] mt-0.5 text-white/20">Terrain</p>
              </div>
            </div>
            <motion.div className="text-center" animate={isHovered ? { opacity: [0.3, 0.6, 0.3] } : {}} transition={{ duration: 2, repeat: isHovered ? Infinity : 0 }}>
              <span className="text-[7px] tracking-widest" style={{ color: 'rgba(42,111,160,0.25)' }}>{isHovered ? '✦ ZOOMING IN ✦' : '✦ EXPLORE PLANET ✦'}</span>
            </motion.div>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Interaction states & animations

  • Hover