Skip to content

Sundial Shadow Card

A card themed around a sunlit stone surface with a central gnomon (sundial fin). Content is displayed as shadows cast by the gnomon changing angle and length based on the time of day. Hover acts as a cloud diffusing the light and making shadow text softer and easier to read. Clicking advances through different times of day revealing different mood and information sets like day and night modes with stars moon and shifting temperatures.

Sundial Shadow Card

by FreeCsStyles Dev's

CardsSundial / Celestial
🌐🎨⚛️💚🅰️🔥☁️
#sundial#shadow#sun#time#day#night#celestial#astronomy#gnomon#clock

Embed this component

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

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

Implementation code

Copy the HTML and CSS for Sundial Shadow 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="sundial-card" onclick="advanceTime(this)">
  <div class="sundial-sun"></div>
  <div class="sundial-gnomon"></div>
  <div class="sundial-content">
    <div class="sundial-header">
      <p class="sundial-title">Sundial</p>
      <span class="sundial-label" id="sundial-label">Morning</span>
    </div>
    <div class="sundial-divider"></div>
    <div class="sundial-mood">
      <p class="sundial-mood-text" id="sundial-mood">Golden</p>
      <p class="sundial-location">Stone Garden</p>
    </div>
    <div class="sundial-grid" id="sundial-grid">
      <div class="sundial-stat"><div class="sundial-stat-val">06:24</div><div class="sundial-stat-lbl">Sunrise</div></div>
      <div class="sundial-stat"><div class="sundial-stat-val">Mid West</div><div class="sundial-stat-lbl">Shadow</div></div>
      <div class="sundial-stat"><div class="sundial-stat-val">18°C</div><div class="sundial-stat-lbl">Temp</div></div>
    </div>
    <p class="sundial-status">[▼ click for next hour]</p>
  </div>
</div>
<script>
const times = [{label:'Dawn',mood:'First Light',data:['06:24','Long West','12°C']},{label:'Morning',mood:'Golden',data:['06:24','Mid West','18°C']},{label:'Noon',mood:'Bright',data:['12:00','Minimal','24°C']},{label:'Afternoon',mood:'Warm Haze',data:['18:42','Long East','22°C']},{label:'Dusk',mood:'Twilight',data:['18:42','Long East','15°C']},{label:'Night',mood:'Dark',data:['Waxing','None','8°C']}];
let t = 1;
function advanceTime(el) {
  t = (t + 1) % times.length;
  document.getElementById('sundial-label').textContent = times[t].label;
  document.getElementById('sundial-mood').textContent = times[t].mood;
  const cells = document.getElementById('sundial-grid').children;
  times[t].data.forEach((d, i) => cells[i].children[0].textContent = d);
}
</script>
CSS
.sundial-card {
  position: relative;
  width: 220px;
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2520, #3a3025);
  border: 1.5px solid rgba(200,180,160,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.4s ease;
}

.sundial-card:hover {
  box-shadow: 0 0 40px rgba(255,200,150,0.06), 0 15px 40px rgba(0,0,0,0.5);
}

.sundial-sun {
  position: absolute;
  top: 8%;
  left: 20%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,180,0.06), transparent);
  pointer-events: none;
  z-index: 1;
}

.sundial-gnomon {
  position: absolute;
  left: 50%;
  bottom: 35%;
  transform: translateX(-50%);
  width: 2px;
  height: 40px;
  background: linear-gradient(0deg, rgba(200,180,160,0.12), rgba(200,180,160,0.25));
  pointer-events: none;
  z-index: 3;
}

.sundial-content {
  position: relative;
  z-index: 10;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sundial-header { display: flex; justify-content: space-between; align-items: center; }
.sundial-title { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; color: rgba(200,180,160,0.6); }
.sundial-label { font-size: 8px; font-family: monospace; letter-spacing: 0.1em; color: rgba(200,180,160,0.3); }
.sundial-divider { height: 1px; background: linear-gradient(90deg, rgba(200,180,160,0.1), transparent); }

.sundial-mood { text-align: center; }
.sundial-mood-text { font-size: 13px; font-weight: 300; letter-spacing: 0.1em; color: rgba(200,180,160,0.35); text-shadow: 2px 2px 4px rgba(0,0,0,0.2); }
.sundial-location { font-size: 9px; margin-top: 4px; color: rgba(200,180,160,0.25); }

.sundial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sundial-stat {
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(200,180,160,0.03);
  border: 1px solid rgba(200,180,160,0.05);
}

.sundial-stat-val { font-size: 8px; font-weight: 600; color: rgba(200,180,160,0.6); }
.sundial-stat-lbl { font-size: 6px; margin-top: 2px; color: rgba(255,255,255,0.15); }

.sundial-status {
  text-align: center;
  font-size: 7px;
  font-family: monospace;
  color: rgba(200,180,160,0.2);
}

@media (prefers-reduced-motion: reduce) {
  .sundial-card { transition: none; }
}
Tailwind CSS
<div class="group relative w-[220px] min-h-[300px] rounded-2xl overflow-hidden border border-amber-800/20 shadow-lg group-hover:shadow-[0_0_40px_rgba(255,200,150,0.06),0_15px_40px_rgba(0,0,0,0.5)] bg-gradient-to-br from-[#2a2520] to-[#3a3025] cursor-pointer">
  <div class="absolute top-[8%] left-[20%] w-6 h-6 rounded-full bg-gradient-radial from-amber-200/10 to-transparent pointer-events-none z-1"></div>
  <div class="absolute left-1/2 bottom-[35%] -translate-x-1/2 w-[2px] h-10 bg-gradient-to-t from-amber-800/20 to-amber-800/30 pointer-events-none z-3"></div>
  <div class="relative z-10 p-5 space-y-4">
    <div class="flex items-center justify-between">
      <p class="text-xs font-semibold tracking-wider text-amber-800/60">Sundial</p>
      <span class="text-[8px] font-mono tracking-wider text-amber-800/30">Morning</span>
    </div>
    <div class="h-px bg-gradient-to-r from-amber-800/15 to-transparent"></div>
    <div class="text-center">
      <p class="text-[13px] font-light tracking-widest text-amber-800/40">Golden</p>
      <p class="text-[9px] mt-1 text-amber-800/30">Stone Garden</p>
    </div>
    <div class="grid grid-cols-3 gap-1.5">
      <div class="text-center py-1.5 rounded-lg bg-amber-800/5 border border-amber-800/10"><p class="text-[8px] font-semibold text-amber-800/60">06:24</p><p class="text-[6px] mt-0.5 text-white/20">Sunrise</p></div>
      <div class="text-center py-1.5 rounded-lg bg-amber-800/5 border border-amber-800/10"><p class="text-[8px] font-semibold text-amber-800/60">Mid West</p><p class="text-[6px] mt-0.5 text-white/20">Shadow</p></div>
      <div class="text-center py-1.5 rounded-lg bg-amber-800/5 border border-amber-800/10"><p class="text-[8px] font-semibold text-amber-800/60">18°C</p><p class="text-[6px] mt-0.5 text-white/20">Temp</p></div>
    </div>
    <div class="text-center"><span class="text-[7px] font-mono text-amber-800/30">[▼ click for next hour]</span></div>
  </div>
</div>
React
import React, { useState, useRef, useCallback } from 'react';
import { motion, useMotionValue, useSpring } from 'framer-motion';

export function SundialShadowCard() {
  const [isHovered, setIsHovered] = useState(false);
  const [timeIndex, setTimeIndex] = useState(1);
  const ref = useRef(null);
  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 timeSlots = [
    { label: 'Dawn', mood: 'First Light', data: [{ label: 'Sunrise', value: '06:24' }, { label: 'Shadow', value: 'Long West' }, { label: 'Temp', value: '12°C' }] },
    { label: 'Morning', mood: 'Golden', data: [{ label: 'Sunrise', value: '06:24' }, { label: 'Shadow', value: 'Mid West' }, { label: 'Temp', value: '18°C' }] },
    { label: 'Noon', mood: 'Bright', data: [{ label: 'Zenith', value: '12:00' }, { label: 'Shadow', value: 'Minimal' }, { label: 'Temp', value: '24°C' }] },
    { label: 'Afternoon', mood: 'Warm Haze', data: [{ label: 'Sunset', value: '18:42' }, { label: 'Shadow', value: 'Long East' }, { label: 'Temp', value: '22°C' }] },
    { label: 'Dusk', mood: 'Twilight', data: [{ label: 'Sunset', value: '18:42' }, { label: 'Shadow', value: 'Long East' }, { label: 'Temp', value: '15°C' }] },
    { label: 'Night', mood: 'Dark', data: [{ label: 'Moon', value: 'Waxing' }, { label: 'Shadow', value: 'None' }, { label: 'Temp', value: '8°C' }] },
  ];
  const slot = timeSlots[timeIndex];
  const isNight = slot.label === 'Night';

  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} onClick={() => setTimeIndex((prev) => (prev + 1) % 6)} style={{ rotateX, rotateY, transformStyle: 'preserve-3d' }} className="relative cursor-pointer">
        <motion.div className="relative overflow-hidden rounded-2xl" style={{ width: 220, minHeight: 300, background: isNight ? 'linear-gradient(160deg, #03030a, #060618)' : 'linear-gradient(160deg, #2a2520, #3a3025)', border: isNight ? '1.5px solid rgba(100,150,255,0.06)' : '1.5px solid rgba(200,180,160,0.08)' }}
          animate={{ boxShadow: isHovered ? '0 0 40px rgba(255,200,150,0.06), 0 15px 40px rgba(0,0,0,0.5)' : '0 10px 30px rgba(0,0,0,0.4)' }}>
          {!isNight && <motion.div className="absolute pointer-events-none z-[1]" style={{ left: slot.label === 'Afternoon' || slot.label === 'Dusk' ? '80%' : '20%', top: '8%' }} animate={isHovered ? { scale: [1,1.1,1], opacity: [0.4,0.6,0.4] } : { opacity: 0.5 }} transition={{ duration: 3, repeat: isHovered ? Infinity : 0 }}><div className="w-6 h-6 rounded-full" style={{ background: 'radial-gradient(circle, rgba(255,220,180,0.08), transparent)' }} /></div>}
          {isNight && <motion.div className="absolute pointer-events-none z-[1]" style={{ left: '70%', top: '8%' }} animate={{ opacity: [0.3,0.5,0.3] }} transition={{ duration: 4, repeat: Infinity }}><div className="w-[18px] h-[18px] rounded-full" style={{ background: 'radial-gradient(circle at 60% 40%, rgba(200,200,255,0.08), transparent)' }} /></div>}
          <div className="absolute left-1/2 bottom-[35%] -translate-x-1/2 z-[3] pointer-events-none" style={{ width: 2, height: 40, background: 'linear-gradient(0deg, rgba(200,180,160,0.12), rgba(200,180,160,0.25))' }} />
          <div className="relative z-10 p-5 space-y-4">
            <div className="flex items-center justify-between">
              <motion.p className="text-xs font-semibold tracking-wider" style={{ color: isNight ? 'rgba(100,150,255,0.5)' : 'rgba(200,180,160,0.6)' }} animate={isHovered ? { opacity: [0.5,0.8,0.5] } : {}} transition={{ duration: 3, repeat: isHovered ? Infinity : 0 }}>Sundial</motion.p>
              <span className="text-[8px] font-mono" style={{ color: isNight ? 'rgba(100,150,255,0.2)' : 'rgba(200,180,160,0.3)' }}>{slot.label}</span>
            </div>
            <div className="h-px" style={{ background: isNight ? 'linear-gradient(90deg, rgba(100,150,255,0.08), transparent)' : 'linear-gradient(90deg, rgba(200,180,160,0.1), transparent)' }} />
            <div className="text-center">
              <motion.p className="text-[13px] font-light tracking-widest" style={{ color: isNight ? 'rgba(100,150,255,0.3)' : isHovered ? 'rgba(200,180,160,0.6)' : 'rgba(200,180,160,0.35)', filter: isHovered && !isNight ? 'blur(0.3px)' : 'blur(0.5px)', textShadow: isHovered && !isNight ? '0 0 8px rgba(200,180,160,0.15)' : '2px 2px 4px rgba(0,0,0,0.2)' }}>
                {slot.mood}</motion.p>
              <p className="text-[9px] mt-1" style={{ color: isNight ? 'rgba(100,150,255,0.2)' : 'rgba(200,180,160,0.25)' }}>Stone Garden</p>
            </div>
            <div className="grid grid-cols-3 gap-1.5">
              {slot.data.map((item) => (
                <div key={item.label} className="text-center py-1.5 rounded-lg" style={{ background: isNight ? 'rgba(100,150,255,0.03)' : 'rgba(200,180,160,0.03)', border: '1px solid ' + (isNight ? 'rgba(100,150,255,0.04)' : 'rgba(200,180,160,0.05)') }}>
                  <motion.p className="text-[8px] font-semibold" style={{ color: isNight ? 'rgba(100,150,255,0.5)' : 'rgba(200,180,160,0.6)' }} animate={isHovered ? { opacity: [0.5,0.9,0.5] } : {}} transition={{ duration: 2, repeat: isHovered ? Infinity : 0 }}>{item.value}</motion.p>
                  <p className="text-[6px] mt-0.5 text-white/20">{item.label}</p>
                </div>
              ))}
            </div>
            <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: isNight ? 'rgba(100,150,255,0.15)' : 'rgba(200,180,160,0.2)' }}>{isHovered ? '[▼ cloud passing...]' : '[▼ click for next hour]'}</span></motion.div>
          </div>
        </motion.div>
      </motion.div>
    </div>
  );
}

Where Sundial Shadow Card fits

  • Clock Apps
  • Weather Widgets
  • Astronomy
  • Meditation
  • Time Management
  • Calendar

Interaction states & animations

  • Shadow rotation
  • Cloud diffusion
  • Day/Night cycle
  • Sun ray pulsing
  • Star twinkle

Topics

  • #sundial
  • #shadow
  • #sun
  • #time
  • #day
  • #night
  • #celestial
  • #astronomy
  • #gnomon
  • #clock

Accessibility notes

Shadow text readability should meet WCAG contrast requirements at all times of day. Animations should respect prefers-reduced-motion. Cloud diffusion provides enhanced readability mode.

Browser support

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