Skip to content

Digital Clock

A copy-paste watch faces & clocks component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Watch Faces & ClocksHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-digital" role="img" aria-label="Digital clock 10:42">
  <span class="nuda-digital__d">1</span>
  <span class="nuda-digital__d">0</span>
  <span class="nuda-digital__sep">:</span>
  <span class="nuda-digital__d">4</span>
  <span class="nuda-digital__d">2</span>
  <span class="nuda-digital__ampm">PM</span>
</div>
CSS
/* Digital Clock
   Glowing monospace digits with a blinking colon.
   Customize: --bg, --accent, --dim */

.nuda-digital {
  --bg: #09090b;
  --accent: #e4ff54;
  --dim: rgba(228, 255, 84, 0.15);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 18px 22px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 48px;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 12px var(--dim), 0 0 24px var(--dim);
  letter-spacing: -2px;
}

.nuda-digital__d {
  display: inline-block;
  min-width: 0.6em;
  text-align: center;
}

.nuda-digital__sep {
  animation: nuda-digital-blink 1s steps(2) infinite;
}

.nuda-digital__ampm {
  margin-left: 10px;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.7;
  align-self: center;
}

@keyframes nuda-digital-blink {
  50% { opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-digital__sep { animation: none; }
}

How to use Digital Clock

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More watch faces & clocks components

← Browse all NudaUI components