# Sewing machine stitch loader

> A sewing machine needle bobs up and down as denim slides past and leaves a line of stitches behind.

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

## Where to use it

A vintage sewing machine head with a gold decal, a presser foot and a needle that moves in sync with a strip of denim. The twill texture, the hem and the orange stitch line all scroll by exactly one stitch per cycle, so the loop never jumps. It suits fashion shops, craft blogs and custom order flows.

The main color sets the fabric and the second the thread, so denim with orange thread can become linen with navy. Use it while a product is customised or an order is prepared.

## Code

### HTML

```html
<div class="uvq10-sew" role="status"><span class="sr">Loading</span><div class="fab" aria-hidden="true"><i class="st"></i></div><div class="hd" aria-hidden="true"><i class="nb"></i><i class="ft"></i></div></div>
```

### CSS

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

.uvq10-sew {
  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: 13em;
  height: 6.2em;
}

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

.uvq10-sew .fab {
  position: absolute;
  left: 0;
  right: 0;
  top: 2.7em;
  height: 3.1em;
  border-radius: .3em;
  overflow: hidden;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.09) 0 .106em,rgba(0,0,0,.1) .106em .2121em),linear-gradient(color-mix(in srgb,var(--c1) 88%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 78%,#000));
  box-shadow: 0 .5em 1em -.5em rgba(0,0,0,.5);
  -webkit-mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  animation: uvq10-sew-f calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before,.uvq10-sew .fab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: .1em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c2) 70%,transparent) 0 .4em,transparent 0 .6em);
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before {
  top: .3em;
}

.uvq10-sew .fab::after {
  bottom: .3em;
}

.uvq10-sew .st {
  position: absolute;
  left: 0;
  width: 6.5em;
  top: 50%;
  height: .17em;
  margin-top: -.085em;
  border-radius: .1em;
  background: repeating-linear-gradient(90deg,var(--c2) 0 .8em,transparent 0 1.2em);
  filter: drop-shadow(0 .05em 0 rgba(0,0,0,.4));
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .hd {
  position: absolute;
  z-index: 2;
  left: 4.4em;
  top: 0;
  width: 4.2em;
  height: 1.9em;
  border-radius: .6em .6em .3em .3em;
  background: linear-gradient(180deg,#f8f4ea,#ddd5c3);
  box-shadow: 0 0 0 1px rgba(0,0,0,.14),0 .4em .7em -.3em rgba(0,0,0,.4),inset 0 -.25em 0 #c9bfa9;
}

.uvq10-sew .hd::before {
  content: "";
  position: absolute;
  left: .5em;
  right: .5em;
  top: .55em;
  height: .14em;
  border-radius: .1em;
  background: linear-gradient(90deg,#b8862b,#f2d27a,#b8862b);
}

.uvq10-sew .nb {
  position: absolute;
  left: calc(50% - .06em);
  top: 1.6em;
  width: .12em;
  height: 1.75em;
  border-radius: 0 0 .1em .1em;
  background: linear-gradient(90deg,#8b929b,#f3f4f6,#6b7280);
  animation: uvq10-sew-n calc(0.5s / var(--k)) ease-in-out infinite;
}

.uvq10-sew .nb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.3em;
  width: 1px;
  height: 1.6em;
  background: var(--c2);
}

.uvq10-sew .ft {
  position: absolute;
  left: calc(50% - .75em);
  top: 2.45em;
  width: 1.5em;
  height: .32em;
  border-radius: .1em .5em .15em .15em;
  background: linear-gradient(#e5e7eb,#9ca3af);
  box-shadow: 0 .1em .2em rgba(0,0,0,.4);
}

@keyframes uvq10-sew-f {
  to {
    background-position: -1.2em 0,0 0;
  }
}

@keyframes uvq10-sew-m {
  to {
    background-position: -1.2em 0;
  }
}

@keyframes uvq10-sew-n {
  0%,100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(.95em);
  }
}

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

### React

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

const css = `
.uvq10-sew {
  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: 13em;
  height: 6.2em;
}

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

.uvq10-sew .fab {
  position: absolute;
  left: 0;
  right: 0;
  top: 2.7em;
  height: 3.1em;
  border-radius: .3em;
  overflow: hidden;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.09) 0 .106em,rgba(0,0,0,.1) .106em .2121em),linear-gradient(color-mix(in srgb,var(--c1) 88%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 78%,#000));
  box-shadow: 0 .5em 1em -.5em rgba(0,0,0,.5);
  -webkit-mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  animation: uvq10-sew-f calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before,.uvq10-sew .fab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: .1em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c2) 70%,transparent) 0 .4em,transparent 0 .6em);
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before {
  top: .3em;
}

.uvq10-sew .fab::after {
  bottom: .3em;
}

.uvq10-sew .st {
  position: absolute;
  left: 0;
  width: 6.5em;
  top: 50%;
  height: .17em;
  margin-top: -.085em;
  border-radius: .1em;
  background: repeating-linear-gradient(90deg,var(--c2) 0 .8em,transparent 0 1.2em);
  filter: drop-shadow(0 .05em 0 rgba(0,0,0,.4));
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .hd {
  position: absolute;
  z-index: 2;
  left: 4.4em;
  top: 0;
  width: 4.2em;
  height: 1.9em;
  border-radius: .6em .6em .3em .3em;
  background: linear-gradient(180deg,#f8f4ea,#ddd5c3);
  box-shadow: 0 0 0 1px rgba(0,0,0,.14),0 .4em .7em -.3em rgba(0,0,0,.4),inset 0 -.25em 0 #c9bfa9;
}

.uvq10-sew .hd::before {
  content: "";
  position: absolute;
  left: .5em;
  right: .5em;
  top: .55em;
  height: .14em;
  border-radius: .1em;
  background: linear-gradient(90deg,#b8862b,#f2d27a,#b8862b);
}

.uvq10-sew .nb {
  position: absolute;
  left: calc(50% - .06em);
  top: 1.6em;
  width: .12em;
  height: 1.75em;
  border-radius: 0 0 .1em .1em;
  background: linear-gradient(90deg,#8b929b,#f3f4f6,#6b7280);
  animation: uvq10-sew-n calc(0.5s / var(--k)) ease-in-out infinite;
}

.uvq10-sew .nb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.3em;
  width: 1px;
  height: 1.6em;
  background: var(--c2);
}

.uvq10-sew .ft {
  position: absolute;
  left: calc(50% - .75em);
  top: 2.45em;
  width: 1.5em;
  height: .32em;
  border-radius: .1em .5em .15em .15em;
  background: linear-gradient(#e5e7eb,#9ca3af);
  box-shadow: 0 .1em .2em rgba(0,0,0,.4);
}

@keyframes uvq10-sew-f {
  to {
    background-position: -1.2em 0,0 0;
  }
}

@keyframes uvq10-sew-m {
  to {
    background-position: -1.2em 0;
  }
}

@keyframes uvq10-sew-n {
  0%,100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(.95em);
  }
}

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

export default function LdSewingStitch() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#2c4a7a",
          "--c2": "#f0a43a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-sew" role="status"><span className="sr">Loading</span><div className="fab" aria-hidden="true"><i className="st"></i></div><div className="hd" aria-hidden="true"><i className="nb"></i><i className="ft"></i></div></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 “Sewing machine stitch loader” block (Loaders) from AIMRAN Library to my project.

## What it is
A sewing machine needle bobs up and down as denim slides past and leaves a line of stitches behind.

## Chosen settings
- Main color: #2c4a7a
- Secondary color: #f0a43a
- 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-sew {
  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: 13em;
  height: 6.2em;
}

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

.uvq10-sew .fab {
  position: absolute;
  left: 0;
  right: 0;
  top: 2.7em;
  height: 3.1em;
  border-radius: .3em;
  overflow: hidden;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.09) 0 .106em,rgba(0,0,0,.1) .106em .2121em),linear-gradient(color-mix(in srgb,var(--c1) 88%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 78%,#000));
  box-shadow: 0 .5em 1em -.5em rgba(0,0,0,.5);
  -webkit-mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  mask: linear-gradient(90deg,transparent,#000 1.2em calc(100% - 1.2em),transparent);
  animation: uvq10-sew-f calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before,.uvq10-sew .fab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: .1em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c2) 70%,transparent) 0 .4em,transparent 0 .6em);
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .fab::before {
  top: .3em;
}

.uvq10-sew .fab::after {
  bottom: .3em;
}

.uvq10-sew .st {
  position: absolute;
  left: 0;
  width: 6.5em;
  top: 50%;
  height: .17em;
  margin-top: -.085em;
  border-radius: .1em;
  background: repeating-linear-gradient(90deg,var(--c2) 0 .8em,transparent 0 1.2em);
  filter: drop-shadow(0 .05em 0 rgba(0,0,0,.4));
  animation: uvq10-sew-m calc(0.5s / var(--k)) linear infinite;
}

.uvq10-sew .hd {
  position: absolute;
  z-index: 2;
  left: 4.4em;
  top: 0;
  width: 4.2em;
  height: 1.9em;
  border-radius: .6em .6em .3em .3em;
  background: linear-gradient(180deg,#f8f4ea,#ddd5c3);
  box-shadow: 0 0 0 1px rgba(0,0,0,.14),0 .4em .7em -.3em rgba(0,0,0,.4),inset 0 -.25em 0 #c9bfa9;
}

.uvq10-sew .hd::before {
  content: "";
  position: absolute;
  left: .5em;
  right: .5em;
  top: .55em;
  height: .14em;
  border-radius: .1em;
  background: linear-gradient(90deg,#b8862b,#f2d27a,#b8862b);
}

.uvq10-sew .nb {
  position: absolute;
  left: calc(50% - .06em);
  top: 1.6em;
  width: .12em;
  height: 1.75em;
  border-radius: 0 0 .1em .1em;
  background: linear-gradient(90deg,#8b929b,#f3f4f6,#6b7280);
  animation: uvq10-sew-n calc(0.5s / var(--k)) ease-in-out infinite;
}

.uvq10-sew .nb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.3em;
  width: 1px;
  height: 1.6em;
  background: var(--c2);
}

.uvq10-sew .ft {
  position: absolute;
  left: calc(50% - .75em);
  top: 2.45em;
  width: 1.5em;
  height: .32em;
  border-radius: .1em .5em .15em .15em;
  background: linear-gradient(#e5e7eb,#9ca3af);
  box-shadow: 0 .1em .2em rgba(0,0,0,.4);
}

@keyframes uvq10-sew-f {
  to {
    background-position: -1.2em 0,0 0;
  }
}

@keyframes uvq10-sew-m {
  to {
    background-position: -1.2em 0;
  }
}

@keyframes uvq10-sew-n {
  0%,100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(.95em);
  }
}

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

export default function LdSewingStitch() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#2c4a7a",
          "--c2": "#f0a43a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-sew" role="status"><span className="sr">Loading</span><div className="fab" aria-hidden="true"><i className="st"></i></div><div className="hd" aria-hidden="true"><i className="nb"></i><i className="ft"></i></div></div>
      </div>
    </>
  );
}
```

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