Skip to content

Compass Rose Card

A card built around a rotating compass rose. The cardinal and intercardinal directions pulse with magnetic energy. Hovering aligns the compass needle toward a 'hidden north' — the cursor position. Clicking locks the bearing and displays directional data.

Compass Rose Card

by FreeCsStyles Dev's

CardsSpin / Rotation / Flip
🌐🎨⚛️💚🅰️🔥☁️
#compass#navigation#rose#direction#north#needle#map#travel#orientation#bearing

Embed this component

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

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

Implementation code

Copy the HTML and CSS for Compass Rose 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="compass-rose-card">
  <div class="compass-ring">
    <div class="compass-rose">
      <div class="compass-n">N</div><div class="compass-s">S</div><div class="compass-e">E</div><div class="compass-w">W</div>
      <div class="compass-ne">NE</div><div class="compass-nw">NW</div><div class="compass-se">SE</div><div class="compass-sw">SW</div>
    </div>
    <div class="compass-needle"></div>
  </div>
  <div class="compass-content">
    <div class="compass-title">Compass Rose</div>
    <div class="compass-bearing">Bearing: 0°</div>
  </div>
</div>
CSS
.compass-rose-card { position: relative; width: 220px; min-height: 290px; border-radius: 50%; background: linear-gradient(160deg, #0a0e14, #04080c); border: 2px solid rgba(100,180,255,0.15); overflow: hidden; cursor: pointer; }
.compass-rose-card:hover { box-shadow: 0 0 30px rgba(100,180,255,0.08); }
.compass-ring { position: absolute; left: 50%; top: 38%; transform: translate(-50%,-50%); width: 130px; height: 130px; border-radius: 50%; border: 1.5px solid rgba(100,180,255,0.12); }
.compass-rose { position: relative; width: 100%; height: 100%; }
.compass-rose div { position: absolute; font-size: 9px; font-weight: 700; color: rgba(100,180,255,0.5); }
.compass-n { left: 50%; top: 8px; transform: translateX(-50%); color: rgba(255,100,100,0.8) !important; }
.compass-s { left: 50%; bottom: 8px; transform: translateX(-50%); }
.compass-e { right: 8px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 8px; top: 50%; transform: translateY(-50%); }
.compass-ne { right: 20px; top: 20px; } .compass-nw { left: 20px; top: 20px; }
.compass-se { right: 20px; bottom: 20px; } .compass-sw { left: 20px; bottom: 20px; }
.compass-needle { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 4px; height: 40px; background: linear-gradient(180deg, #ff4444 50%, #444 50%); border-radius: 2px; transition: transform 0.3s; }
.compass-rose-card:hover .compass-needle { transform: translate(-50%,-50%) rotate(45deg); }
.compass-content { position: absolute; inset-x: 0; bottom: 0; padding: 16px; text-align: center; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); border-radius: 0 0 50% 50%; }
.compass-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.compass-bearing { font-size: 9px; color: rgba(100,180,255,0.5); }
Tailwind CSS
<div class="group relative w-[220px] min-h-[290px] rounded-full bg-gradient-to-b from-[#0a0e14] to-[#04080c] border-2 border-blue-500/20 overflow-hidden cursor-pointer group-hover:shadow-[0_0_30px_rgba(100,180,255,0.08)]">
  <div class="absolute left-1/2 top-[38%] -translate-x-1/2 -translate-y-1/2 w-[130px] h-[130px] rounded-full border border-blue-500/20">
    <span class="absolute left-1/2 top-2 -translate-x-1/2 text-[9px] font-bold text-red-400/80">N</span>
    <span class="absolute left-1/2 bottom-2 -translate-x-1/2 text-[9px] font-bold text-blue-400/50">S</span>
    <span class="absolute right-2 top-1/2 -translate-y-1/2 text-[9px] font-bold text-blue-400/50">E</span>
    <span class="absolute left-2 top-1/2 -translate-y-1/2 text-[9px] font-bold text-blue-400/50">W</span>
    <span class="absolute right-5 top-5 text-[7px] text-blue-400/40">NE</span>
    <span class="absolute left-5 top-5 text-[7px] text-blue-400/40">NW</span>
    <span class="absolute right-5 bottom-5 text-[7px] text-blue-400/40">SE</span>
    <span class="absolute left-5 bottom-5 text-[7px] text-blue-400/40">SW</span>
    <div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-1 h-10 bg-gradient-to-b from-red-500 to-gray-500 rounded transition-transform group-hover:rotate-[45deg]"></div>
  </div>
  <div class="absolute inset-x-0 bottom-0 p-4 text-center bg-gradient-to-t from-black/70 to-transparent" style="border-radius:0 0 999px 999px">
    <p class="text-sm font-bold text-white/90">Compass Rose</p>
    <p class="text-[9px] text-blue-500/50">Bearing: 0°</p>
  </div>
</div>
React
import React, { useRef, useState } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function CompassRoseCard({ width = 220 }) {
  const ref = useRef(null);
  const [bearing, setBearing] = useState(0);
  const [isHovered, setIsHovered] = useState(false);
  const x = useMotionValue(0);
  const y = useMotionValue(0);
  const rotateX = useSpring(y, { damping: 25, stiffness: 250 });
  const rotateY = useSpring(x, { damping: 25, stiffness: 250 });
  const handleMouseMove = (e) => {
    if (!ref.current) return;
    const rect = ref.current.getBoundingClientRect();
    const dx = e.clientX - rect.left - rect.width / 2;
    const dy = e.clientY - rect.top - rect.height / 2;
    const angle = Math.atan2(dy, dx) * (180 / Math.PI) + 90;
    setBearing(Math.round(((angle % 360) + 360) % 360));
    x.set(-((e.clientX - rect.left - rect.width / 2) / (rect.width / 2)) * 6);
    y.set(((e.clientY - rect.top - rect.height / 2) / (rect.height / 2)) * 6);
  };
  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' }} className="relative cursor-pointer" style={{ width }}>
        <motion.div className="relative rounded-full overflow-hidden" style={{ minHeight: 290, background: 'linear-gradient(160deg, #0a0e14, #04080c)', border: '2px solid rgba(100,180,255,0.15)' }}>
          <div className="absolute left-1/2 top-[38%] -translate-x-1/2 -translate-y-1/2" style={{ width: 130, height: 130 }}>
            <motion.div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-1 h-10 rounded" style={{ background: 'linear-gradient(180deg, #ff4444 50%, #444 50%)' }}
              animate={{ rotate: bearing }} transition={{ type: 'spring', stiffness: 100, damping: 15 }} />
          </div>
          <div className="absolute inset-x-0 bottom-0 p-4 text-center" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.7), transparent)', borderRadius: '0 0 999px 999px' }}>
            <p className="text-sm font-bold" style={{ color: 'rgba(255,255,255,0.9)' }}>Compass Rose</p>
            <p className="text-[9px]" style={{ color: 'rgba(100,180,255,0.5)' }}>Bearing: {bearing}°</p>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Where Compass Rose Card fits

  • Navigation Cards
  • Map UI
  • Travel Dashboards
  • Adventure Apps
  • Orienteering Tools

Interaction states & animations

  • Compass rose rotation
  • Needle tracking
  • Directional pulse
  • Bearing lock animation
  • Cardinal glow

Topics

  • #compass
  • #navigation
  • #rose
  • #direction
  • #north
  • #needle
  • #map
  • #travel
  • #orientation
  • #bearing

Accessibility notes

Rotating compass may be disorienting. prefers-reduced-motion keeps compass static with click-to-read bearing as alternative.

Browser support

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