# Spinning top loader

> A striped wooden top spins on its point and wobbles from side to side while its shadow follows along.

- Category: [Loaders](https://library.aimran.es/components/loaders)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-ld-spinning-top
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A wooden toy top whose body is a CSS polygon of a dome and a cone, painted with stripes that slide sideways to suggest the spin, plus shading that stays still for volume. The whole top precesses on its metal tip, its shadow drifts with it and two motion arcs flicker beside it. It suits toy shops, kids apps and game lobbies.

The two colors paint the stripes together with a cream band, so you can match a brand or go for classic red and teal. Keep it on a plain surface; the soft shadow sells the idea that it stands on the floor.

## Code

### HTML

```html
<div class="uvq10-top" role="status"><span class="sr">Loading</span><i class="sd" aria-hidden="true"></i><div class="wb" aria-hidden="true"><i class="stm"></i><i class="bd"></i><i class="tip"></i></div><i class="ln a" aria-hidden="true"></i><i class="ln b" aria-hidden="true"></i></div>
```

### CSS

```css
.uvq10-top {
  --c1: #e76f51;
  --c2: #2a9d8f;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq10-top {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 8em;
  height: 7em;
}

.uvq10-top .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-top .sd {
  position: absolute;
  left: 50%;
  bottom: .15em;
  width: 3.6em;
  height: .7em;
  margin-left: -1.8em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(0,0,0,.28),transparent);
  animation: uvq10-top-sh calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb {
  position: absolute;
  left: 50%;
  bottom: .45em;
  width: 4.4em;
  height: 5.6em;
  margin-left: -2.2em;
  transform-origin: 50% 100%;
  animation: uvq10-top-p calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb i {
  position: absolute;
  display: block;
}

.uvq10-top .stm {
  left: 50%;
  top: 0;
  width: .5em;
  height: 1.3em;
  margin-left: -.25em;
  border-radius: .25em .25em .1em .1em;
  background: linear-gradient(90deg,#7c4a1e,#e0a96d,#7c4a1e);
}

.uvq10-top .bd {
  left: 0;
  right: 0;
  top: 1em;
  height: 3.8em;
  clip-path: polygon(0.0% 42.0%,1.7% 31.1%,6.7% 21.0%,14.6% 12.3%,25.0% 5.6%,37.1% 1.4%,50.0% 0.0%,62.9% 1.4%,75.0% 5.6%,85.4% 12.3%,93.3% 21.0%,98.3% 31.1%,100.0% 42.0%,50% 100%);
  background: radial-gradient(ellipse at 36% 26%,rgba(255,255,255,.5),transparent 42%),linear-gradient(90deg,rgba(0,0,0,.38),transparent 32%,transparent 62%,rgba(0,0,0,.42)),linear-gradient(transparent 40%,rgba(0,0,0,.12) 42%,transparent 44%),repeating-linear-gradient(90deg,var(--c1) 0 .55em,var(--c2) .55em 1.1em,#f8f1e4 1.1em 1.4em);
  background-size: auto,auto,auto,1.4em 100%;
  animation: uvq10-top-s calc(0.24s / var(--k)) linear infinite;
}

.uvq10-top .tip {
  left: 50%;
  top: 4.55em;
  width: .18em;
  height: 1.05em;
  margin-left: -.09em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#6b7280);
  clip-path: polygon(0 0,100% 0,50% 100%);
}

.uvq10-top .ln {
  position: absolute;
  top: 2.6em;
  width: 1.3em;
  height: 2em;
  border: 2px solid transparent;
  border-radius: 50%;
  opacity: .5;
  animation: uvq10-top-l calc(0.5s / var(--k)) steps(2) infinite;
}

.uvq10-top .ln.a {
  left: .4em;
  border-left-color: color-mix(in srgb,var(--fg) 35%,transparent);
}

.uvq10-top .ln.b {
  right: .4em;
  border-right-color: color-mix(in srgb,var(--fg) 35%,transparent);
  animation-delay: calc(-0.25s / var(--k));
}

@keyframes uvq10-top-s {
  to {
    background-position: 0 0,0 0,0 0,1.4em 0;
  }
}

@keyframes uvq10-top-p {
  0%,100% {
    transform: translateX(-.35em) rotate(-9deg);
  }
  50% {
    transform: translateX(.35em) rotate(9deg);
  }
}

@keyframes uvq10-top-sh {
  0%,100% {
    transform: translateX(-.5em) scaleX(.9);
  }
  50% {
    transform: translateX(.5em) scaleX(.9);
  }
}

@keyframes uvq10-top-l {
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-top,.uvq10-top *,.uvq10-top *::before,.uvq10-top *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq10-top {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 8em;
  height: 7em;
}

.uvq10-top .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-top .sd {
  position: absolute;
  left: 50%;
  bottom: .15em;
  width: 3.6em;
  height: .7em;
  margin-left: -1.8em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(0,0,0,.28),transparent);
  animation: uvq10-top-sh calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb {
  position: absolute;
  left: 50%;
  bottom: .45em;
  width: 4.4em;
  height: 5.6em;
  margin-left: -2.2em;
  transform-origin: 50% 100%;
  animation: uvq10-top-p calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb i {
  position: absolute;
  display: block;
}

.uvq10-top .stm {
  left: 50%;
  top: 0;
  width: .5em;
  height: 1.3em;
  margin-left: -.25em;
  border-radius: .25em .25em .1em .1em;
  background: linear-gradient(90deg,#7c4a1e,#e0a96d,#7c4a1e);
}

.uvq10-top .bd {
  left: 0;
  right: 0;
  top: 1em;
  height: 3.8em;
  clip-path: polygon(0.0% 42.0%,1.7% 31.1%,6.7% 21.0%,14.6% 12.3%,25.0% 5.6%,37.1% 1.4%,50.0% 0.0%,62.9% 1.4%,75.0% 5.6%,85.4% 12.3%,93.3% 21.0%,98.3% 31.1%,100.0% 42.0%,50% 100%);
  background: radial-gradient(ellipse at 36% 26%,rgba(255,255,255,.5),transparent 42%),linear-gradient(90deg,rgba(0,0,0,.38),transparent 32%,transparent 62%,rgba(0,0,0,.42)),linear-gradient(transparent 40%,rgba(0,0,0,.12) 42%,transparent 44%),repeating-linear-gradient(90deg,var(--c1) 0 .55em,var(--c2) .55em 1.1em,#f8f1e4 1.1em 1.4em);
  background-size: auto,auto,auto,1.4em 100%;
  animation: uvq10-top-s calc(0.24s / var(--k)) linear infinite;
}

.uvq10-top .tip {
  left: 50%;
  top: 4.55em;
  width: .18em;
  height: 1.05em;
  margin-left: -.09em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#6b7280);
  clip-path: polygon(0 0,100% 0,50% 100%);
}

.uvq10-top .ln {
  position: absolute;
  top: 2.6em;
  width: 1.3em;
  height: 2em;
  border: 2px solid transparent;
  border-radius: 50%;
  opacity: .5;
  animation: uvq10-top-l calc(0.5s / var(--k)) steps(2) infinite;
}

.uvq10-top .ln.a {
  left: .4em;
  border-left-color: color-mix(in srgb,var(--fg) 35%,transparent);
}

.uvq10-top .ln.b {
  right: .4em;
  border-right-color: color-mix(in srgb,var(--fg) 35%,transparent);
  animation-delay: calc(-0.25s / var(--k));
}

@keyframes uvq10-top-s {
  to {
    background-position: 0 0,0 0,0 0,1.4em 0;
  }
}

@keyframes uvq10-top-p {
  0%,100% {
    transform: translateX(-.35em) rotate(-9deg);
  }
  50% {
    transform: translateX(.35em) rotate(9deg);
  }
}

@keyframes uvq10-top-sh {
  0%,100% {
    transform: translateX(-.5em) scaleX(.9);
  }
  50% {
    transform: translateX(.5em) scaleX(.9);
  }
}

@keyframes uvq10-top-l {
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-top,.uvq10-top *,.uvq10-top *::before,.uvq10-top *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function LdSpinningTop() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e76f51",
          "--c2": "#2a9d8f",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-top" role="status"><span className="sr">Loading</span><i className="sd" aria-hidden="true"></i><div className="wb" aria-hidden="true"><i className="stm"></i><i className="bd"></i><i className="tip"></i></div><i className="ln a" aria-hidden="true"></i><i className="ln b" aria-hidden="true"></i></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Spinning top loader” block (Loaders) from AIMRAN Library to my project.

## What it is
A striped wooden top spins on its point and wobbles from side to side while its shadow follows along.

## Chosen settings
- Main color: #e76f51
- Secondary color: #2a9d8f
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uvq10-top {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 8em;
  height: 7em;
}

.uvq10-top .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-top .sd {
  position: absolute;
  left: 50%;
  bottom: .15em;
  width: 3.6em;
  height: .7em;
  margin-left: -1.8em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(0,0,0,.28),transparent);
  animation: uvq10-top-sh calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb {
  position: absolute;
  left: 50%;
  bottom: .45em;
  width: 4.4em;
  height: 5.6em;
  margin-left: -2.2em;
  transform-origin: 50% 100%;
  animation: uvq10-top-p calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq10-top .wb i {
  position: absolute;
  display: block;
}

.uvq10-top .stm {
  left: 50%;
  top: 0;
  width: .5em;
  height: 1.3em;
  margin-left: -.25em;
  border-radius: .25em .25em .1em .1em;
  background: linear-gradient(90deg,#7c4a1e,#e0a96d,#7c4a1e);
}

.uvq10-top .bd {
  left: 0;
  right: 0;
  top: 1em;
  height: 3.8em;
  clip-path: polygon(0.0% 42.0%,1.7% 31.1%,6.7% 21.0%,14.6% 12.3%,25.0% 5.6%,37.1% 1.4%,50.0% 0.0%,62.9% 1.4%,75.0% 5.6%,85.4% 12.3%,93.3% 21.0%,98.3% 31.1%,100.0% 42.0%,50% 100%);
  background: radial-gradient(ellipse at 36% 26%,rgba(255,255,255,.5),transparent 42%),linear-gradient(90deg,rgba(0,0,0,.38),transparent 32%,transparent 62%,rgba(0,0,0,.42)),linear-gradient(transparent 40%,rgba(0,0,0,.12) 42%,transparent 44%),repeating-linear-gradient(90deg,var(--c1) 0 .55em,var(--c2) .55em 1.1em,#f8f1e4 1.1em 1.4em);
  background-size: auto,auto,auto,1.4em 100%;
  animation: uvq10-top-s calc(0.24s / var(--k)) linear infinite;
}

.uvq10-top .tip {
  left: 50%;
  top: 4.55em;
  width: .18em;
  height: 1.05em;
  margin-left: -.09em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#6b7280);
  clip-path: polygon(0 0,100% 0,50% 100%);
}

.uvq10-top .ln {
  position: absolute;
  top: 2.6em;
  width: 1.3em;
  height: 2em;
  border: 2px solid transparent;
  border-radius: 50%;
  opacity: .5;
  animation: uvq10-top-l calc(0.5s / var(--k)) steps(2) infinite;
}

.uvq10-top .ln.a {
  left: .4em;
  border-left-color: color-mix(in srgb,var(--fg) 35%,transparent);
}

.uvq10-top .ln.b {
  right: .4em;
  border-right-color: color-mix(in srgb,var(--fg) 35%,transparent);
  animation-delay: calc(-0.25s / var(--k));
}

@keyframes uvq10-top-s {
  to {
    background-position: 0 0,0 0,0 0,1.4em 0;
  }
}

@keyframes uvq10-top-p {
  0%,100% {
    transform: translateX(-.35em) rotate(-9deg);
  }
  50% {
    transform: translateX(.35em) rotate(9deg);
  }
}

@keyframes uvq10-top-sh {
  0%,100% {
    transform: translateX(-.5em) scaleX(.9);
  }
  50% {
    transform: translateX(.5em) scaleX(.9);
  }
}

@keyframes uvq10-top-l {
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq10-top,.uvq10-top *,.uvq10-top *::before,.uvq10-top *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function LdSpinningTop() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e76f51",
          "--c2": "#2a9d8f",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-top" role="status"><span className="sr">Loading</span><i className="sd" aria-hidden="true"></i><div className="wb" aria-hidden="true"><i className="stm"></i><i className="bd"></i><i className="tip"></i></div><i className="ln a" aria-hidden="true"></i><i className="ln b" aria-hidden="true"></i></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
