Skip to content

Evolution Card

The card evolves as users interact through 4 stages: Seed → Sprout → Tree → Forest. The more the user engages, the richer the visuals become.

Evolution Card

by FreeCsStyles Dev's

CardsEvolution
🌐🎨⚛️

Embed this component

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

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

Implementation code

Copy the HTML and CSS for Evolution 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="evo-card" onclick="evolve(this)">
  <div class="evo-ground"></div>
  <div class="evo-creatures" id="evo-creatures"></div>
  <div class="evo-icons">
    <span class="evo-stage active">🌱</span>
    <div class="evo-arrow"></div>
    <span class="evo-stage">🌿</span>
    <div class="evo-arrow"></div>
    <span class="evo-stage">🌳</span>
    <div class="evo-arrow"></div>
    <span class="evo-stage">🌲</span>
  </div>
  <div class="evo-content">
    <div class="evo-header">
      <div><div class="evo-title">Oak</div><div class="evo-sci">Quercus</div></div>
      <div class="evo-status" id="evo-status">SEED</div>
    </div>
    <div class="evo-divider"></div>
    <p class="evo-desc" id="evo-desc">A tiny seed rests in the soil...</p>
    <div class="evo-hint" id="evo-hint">[▼ click to grow]</div>
  </div>
</div>
<script>
const stages = [
  { label: 'SEED', desc: 'A tiny seed rests in the soil...' },
  { label: 'SPROUT', desc: 'A green shoot reaches for light' },
  { label: 'TREE', desc: 'Strong branches spread wide' },
  { label: 'FOREST', desc: 'A thriving ecosystem blooms' },
];
let evoStage = 0;
function evolve(el) {
  evoStage = (evoStage + 1) % 4;
  el.className = 'evo-card';
  el.classList.add(`stage-${evoStage}`);
  document.getElementById('evo-status').textContent = stages[evoStage].label;
  document.getElementById('evo-desc').textContent = stages[evoStage].desc;
  document.getElementById('evo-hint').textContent = evoStage >= 3 ? '[▼ start new life]' : '[▼ click to grow]';
  const icons = el.querySelectorAll('.evo-stage');
  icons.forEach((ic, i) => ic.classList.toggle('active', i <= evoStage));
}
</script>
CSS
.evo-card {
  position: relative;
  width: 220px;
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #0a1208, #060e06);
  border: 1.5px solid rgba(34,197,94,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.4s ease;
}

.evo-card:hover {
  box-shadow: 0 0 30px rgba(34,197,94,0.08), 0 15px 40px rgba(0,0,0,0.4);
}

.evo-ground {
  position: absolute;
  bottom: 32%;
  left: 0;
  right: 0;
  height: 48px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(0deg, rgba(34,197,94,0.08), transparent);
}

.evo-icons {
  position: absolute;
  top: 28%;
  left: 10%;
  right: 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.evo-stage {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1.5px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  transition: all 0.4s;
}

.evo-stage.active {
  background: rgba(34,197,94,0.19);
  border-color: #22c55e;
}

.evo-arrow {
  height: 1px;
  width: 16px;
  background: linear-gradient(90deg, rgba(34,197,94,0.3), transparent);
}

.evo-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.5), transparent);
}

.evo-header { display: flex; justify-content: space-between; align-items: center; }
.evo-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.evo-sci { font-size: 9px; font-style: italic; color: rgba(34,197,94,0.44); }
.evo-status {
  padding: 2px 8px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: 0.1em;
  color: #22c55e; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.12);
}
.evo-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(34,197,94,0.08), transparent); }
.evo-desc { font-size: 8px; text-align: center; line-height: 1.5; color: rgba(255,255,255,0.4); }
.evo-hint { text-align: center; font-size: 7px; font-family: monospace; color: rgba(34,197,94,0.2); }

.stage-1 .evo-ground { background: linear-gradient(0deg, rgba(74,222,128,0.1), transparent); }
.stage-2 .evo-ground { background: linear-gradient(0deg, rgba(34,197,94,0.12), transparent); }
.stage-3 .evo-ground { background: linear-gradient(0deg, rgba(22,163,74,0.15), transparent); }

@media (prefers-reduced-motion: reduce) {
  .evo-card { transition: none; }
  .evo-stage { transition: none; }
}
Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-green-400/20 shadow-lg group-hover:shadow-[0_0_30px_rgba(34,197,94,0.08),0_15px_40px_rgba(0,0,0,0.4)] bg-gradient-to-br from-[#0a1208] to-[#060e06] cursor-pointer">
  <div class="absolute bottom-[32%] left-0 right-0 h-12 pointer-events-none z-2 bg-gradient-to-t from-green-400/20 to-transparent"></div>
  <div class="absolute top-[28%] left-[10%] right-[10%] flex items-center justify-between pointer-events-none z-4">
    <div class="w-5 h-5 rounded-full flex items-center justify-center text-[10px] bg-green-500/30 border-green-500 border">🌱</div>
    <div class="h-px w-4 bg-gradient-to-r from-green-500/30 to-transparent"></div>
    <div class="w-5 h-5 rounded-full flex items-center justify-center text-[10px] bg-white/10 border border-white/10">🌿</div>
    <div class="h-px w-4 bg-gradient-to-r from-green-500/30 to-transparent"></div>
    <div class="w-5 h-5 rounded-full flex items-center justify-center text-[10px] bg-white/10 border border-white/10">🌳</div>
    <div class="h-px w-4 bg-gradient-to-r from-green-500/30 to-transparent"></div>
    <div class="w-5 h-5 rounded-full flex items-center justify-center text-[10px] bg-white/10 border border-white/10">🌲</div>
  </div>
  <div class="absolute inset-x-0 bottom-0 z-10 p-5 space-y-2 bg-gradient-to-t from-black/50 to-transparent">
    <div class="flex items-center justify-between">
      <div><p class="text-sm font-bold text-white/90">Oak</p><p class="text-[9px] italic text-green-400/50">Quercus</p></div>
      <div class="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest text-green-400 bg-green-500/10 border border-green-500/20">SEED</div>
    </div>
    <div class="h-px bg-gradient-to-r from-transparent via-green-400/20 to-transparent"></div>
    <p class="text-[8px] text-center text-white/40">A tiny seed rests in the soil...</p>
    <div class="text-center"><span class="text-[7px] font-mono text-green-400/30">[▼ click to grow]</span></div>
  </div>
</div>
React
import React, { useState, useRef } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function EvolutionCard() {
  const [isHovered, setIsHovered] = useState(false);
  const [stageIdx, setStageIdx] = useState(0);
  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 stageLabels = ['SEED', 'SPROUT', 'TREE', 'FOREST'];
  const stageDesc = ['A tiny seed rests in the soil...', 'A green shoot reaches for light', 'Strong branches spread wide', 'A thriving ecosystem blooms'];
  const stageIcons = ['🌱', '🌿', '🌳', '🌲'];
  const forestCount = stageIdx === 3 ? 8 : stageIdx === 2 ? 4 : stageIdx === 1 ? 2 : 1;
  return (
    <div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => { setIsHovered(false); x.set(0); y.set(0); }}>
      <motion.div ref={ref} onMouseMove={handleMouseMove} onClick={() => setStageIdx((prev) => prev >= 3 ? 0 : prev + 1)} 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, #0a1208, #060e06)', border: '1.5px solid rgba(34,197,94,0.08)' }}
          animate={{ boxShadow: isHovered ? '0 0 30px rgba(34,197,94,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 }}>
          {Array.from({ length: forestCount }).map((_, i) => {
            const xPos = 15 + (i / forestCount) * 70 + (Math.random() - 0.5) * 10;
            const height = [8, 20 + i * 3, 45 + i * 5, 35 + i * 8][stageIdx];
            return (
              <motion.div key={i} className="absolute bottom-[32%] pointer-events-none z-3" style={{ left: `${xPos}%`, width: [8, 10, 20, 16][stageIdx] }}
                initial={{ scaleY: 0, scaleX: 0 }} animate={{ scaleY: 1, scaleX: 1, height, y: isHovered ? [0, -2, 0] : 0 }}
                transition={{ duration: 0.8, delay: i * 0.15, ease: 'easeOut', y: { duration: 2 + i * 0.3, repeat: isHovered ? Infinity : 0, ease: 'easeInOut' } }}>
                <div className="w-full" style={{ height: '40%', background: '#8B4513', borderRadius: '2px', opacity: 0.6 }} />
                {stageIdx > 0 && <motion.div className="absolute -top-[30%] left-1/2 -translate-x-1/2 rounded-full" style={{ width: [8, 10, 20, 16][stageIdx] * 1.5, height: [8, 10, 20, 16][stageIdx] * 1.2, background: `radial-gradient(ellipse, ${['#4ade80', '#22c55e', '#16a34a'][Math.min(stageIdx - 1, 2)]}50, transparent)`, filter: 'blur(2px)' }} animate={{ scale: [1, 1.1, 1] }} transition={{ duration: 2 + i, repeat: Infinity, ease: 'easeInOut' }} />}
              </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.5), transparent)' }}>
            <div className="flex items-center justify-between">
              <div><p className="text-sm font-bold text-white/90">Oak</p><p className="text-[9px] italic" style={{ color: 'rgba(34,197,94,0.44)' }}>Quercus</p></div>
              <motion.div className="px-2 py-0.5 rounded-sm text-[7px] font-bold tracking-widest" style={{ background: 'rgba(34,197,94,0.1)', border: '1px solid rgba(34,197,94,0.12)', color: '#22c55e' }}>{stageLabels[stageIdx]}</motion.div>
            </div>
            <div className="h-px" style={{ background: 'linear-gradient(90deg, transparent, rgba(34,197,94,0.08), transparent)' }} />
            <p className="text-[8px] text-center" style={{ color: 'rgba(255,255,255,0.4)' }}>{stageDesc[stageIdx]}</p>
            <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(34,197,94,0.2)' }}>{stageIdx >= 3 ? '[▼ start new life]' : '[▼ click to grow]'}</span>
            </motion.div>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Interaction states & animations

  • Hover