Spinners Animation — Reference

Zonal

The Zonal is a CSS animation component that a pure CSS zonal spinner featuring two coloured orbs that flash in and out at randomised positions using CSS custom properties, offset by half a cycle. It ships as self-contained HTML and CSS with no external dependencies, making it drop-in ready for any modern web project regardless of framework or build system.

spinnerzonalloaderorbteleportcss-variables

When to use the Zonal

Performance characteristics

How it compares

Unlike equivalent JavaScript implementations, the Zonal does not require any runtime library — there is nothing to install, bundle, or load asynchronously.

Compared to animated GIFs or video embeds, this CSS component is resolution-independent, theme-able via CSS custom properties, and weighs a fraction of the equivalent media file.

Source code

CSS

css
body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f0f0f; }
    :root { --primary: #6366f1; --secondary: #ec4899; }

    .zonal {
      --size: 20;
      height: calc(var(--size) * 1px);
      width: calc(var(--size) * 1px);
      position: relative;
    }

    .zonal:after,
    .zonal:before {
      animation: zonal-flash 4s infinite ease;
      border-radius: 100%;
      content: '';
      position: absolute;
      height: 100%;
      width: 100%;
    }

    .zonal:after {
      background-color: var(--primary);
      --x1: 55;  --x2: -196; --x3: -122; --x4: 2;   --x5: 198;
      --y1: 113; --y2: 221;  --y3: -141; --y4: -164; --y5: -44;
    }

    .zonal:before {
      animation-delay: calc(4s * -0.5);
      background-color: var(--secondary);
      --x1: -151; --x2: -192; --x3: -112; --x4: -109; --x5: 155;
      --y1: 222;  --y2: -121; --y3: -227; --y4: -115; --y5: 129;
    }

    @keyframes zonal-flash {
      0%   { transform: scale(0) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
      10%  { transform: scale(1) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
      20%  { transform: scale(0) translate(calc(var(--x2) * 1%), calc(var(--y2) * 1%)); }
      30%  { transform: scale(1) translate(calc(var(--x2) * 1%), calc(var(--y2) * 1%)); }
      40%  { transform: scale(0) translate(calc(var(--x3) * 1%), calc(var(--y3) * 1%)); }
      50%  { transform: scale(1) translate(calc(var(--x3) * 1%), calc(var(--y3) * 1%)); }
      60%  { transform: scale(0) translate(calc(var(--x4) * 1%), calc(var(--y4) * 1%)); }
      70%  { transform: scale(1) translate(calc(var(--x4) * 1%), calc(var(--y4) * 1%)); }
      80%  { transform: scale(0) translate(calc(var(--x5) * 1%), calc(var(--y5) * 1%)); }
      90%  { transform: scale(1) translate(calc(var(--x5) * 1%), calc(var(--y5) * 1%)); }
      100% { transform: scale(0) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
    }

HTML

html
<div class="zonal"></div>

Full source

html
<!DOCTYPE html>
<html>
<head>
  <style>
    body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f0f0f; }
    :root { --primary: #6366f1; --secondary: #ec4899; }

    .zonal {
      --size: 20;
      height: calc(var(--size) * 1px);
      width: calc(var(--size) * 1px);
      position: relative;
    }

    .zonal:after,
    .zonal:before {
      animation: zonal-flash 4s infinite ease;
      border-radius: 100%;
      content: '';
      position: absolute;
      height: 100%;
      width: 100%;
    }

    .zonal:after {
      background-color: var(--primary);
      --x1: 55;  --x2: -196; --x3: -122; --x4: 2;   --x5: 198;
      --y1: 113; --y2: 221;  --y3: -141; --y4: -164; --y5: -44;
    }

    .zonal:before {
      animation-delay: calc(4s * -0.5);
      background-color: var(--secondary);
      --x1: -151; --x2: -192; --x3: -112; --x4: -109; --x5: 155;
      --y1: 222;  --y2: -121; --y3: -227; --y4: -115; --y5: 129;
    }

    @keyframes zonal-flash {
      0%   { transform: scale(0) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
      10%  { transform: scale(1) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
      20%  { transform: scale(0) translate(calc(var(--x2) * 1%), calc(var(--y2) * 1%)); }
      30%  { transform: scale(1) translate(calc(var(--x2) * 1%), calc(var(--y2) * 1%)); }
      40%  { transform: scale(0) translate(calc(var(--x3) * 1%), calc(var(--y3) * 1%)); }
      50%  { transform: scale(1) translate(calc(var(--x3) * 1%), calc(var(--y3) * 1%)); }
      60%  { transform: scale(0) translate(calc(var(--x4) * 1%), calc(var(--y4) * 1%)); }
      70%  { transform: scale(1) translate(calc(var(--x4) * 1%), calc(var(--y4) * 1%)); }
      80%  { transform: scale(0) translate(calc(var(--x5) * 1%), calc(var(--y5) * 1%)); }
      90%  { transform: scale(1) translate(calc(var(--x5) * 1%), calc(var(--y5) * 1%)); }
      100% { transform: scale(0) translate(calc(var(--x1) * 1%), calc(var(--y1) * 1%)); }
    }
  </style>
</head>
<body>
  <div class="zonal"></div>
</body>
</html>

Frequently asked questions

How do I add the Zonal to my project?

Copy the full source code from the code block on this page. Paste the <style> block into your stylesheet (or a <style> tag in your HTML head) and the HTML markup into your template. No npm install or build step is required — the animation is self-contained. To customize colors, speed, or size, use Grepped's workspace at grepped.dev/animations/spinners/zonal-spinner.

Is the Zonal free to use?

Yes. All Grepped preset animations are free to use in personal and commercial projects. You may copy, modify, and redistribute the code without attribution. The only limitation is that you may not resell the presets themselves as part of a competing animation library.

Does the Zonal work on mobile browsers?

Yes. The Zonal uses standard CSS animations and transforms that are supported in all modern mobile browsers — Chrome for Android, Safari on iOS 9+, Samsung Internet, and Firefox for Android. Where JavaScript is used for interactivity (e.g. cursor effects), it falls back gracefully on touch devices.

Can I customize the Zonal's colors, speed, or size?

Yes. Open the live customization workspace at grepped.dev/animations/spinners/zonal-spinner to adjust the animation with real-time sliders, color pickers, and toggles — no code required. For deeper changes, the source code uses CSS custom properties (variables) so you can edit them directly in your stylesheet.

Want to customize this animation or generate a new one from a text prompt?

Open in Workspace — it's free