VibeFX
Live preview · fully interactive

The prompt

Build a tumbling square loader.

## Look
28px square, radius 6px, background #f2f2f7, on #08080d.

## Behavior
At 50% of the loop, rotate 180deg and scale to 0.7. At 100%, rotate 360deg and scale back to 1.

## Design tokens
- Square #f2f2f7; page #08080d.

## Motion
- Duration 0.8s, linear, infinite.

## Constraints
- Single self-contained HTML file. No libraries. CSS only.
- Honor prefers-reduced-motion: reduce by skipping the loop and leaving a readable static frame
- Readable at 390px width with no horizontal page scroll

The code

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { min-height: 100%; }
  body {
    background: #08080d; color: #f2f2f7; font-family: Inter, system-ui, sans-serif;
    min-height: 100vh; overflow: hidden;
  }
  .hint { position: absolute; left: 16px; top: 16px; z-index: 5; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a99; }
  main { min-height: 100vh; display: grid; place-items: center; } .sq { width: 28px; height: 28px; border-radius: 6px; background: #f2f2f7; animation: tumble 0.8s linear infinite; } @keyframes tumble { 50% { transform: rotate(180deg) scale(0.7); } 100% { transform: rotate(360deg) scale(1); } }
  @media (max-width: 420px) {
    .hint { font-size: 10px; letter-spacing: 0.08em; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  }
</style>
</head>
<body>
<main><div class="sq" aria-label="Loading"></div></main>

<script>

</script>
</body>
</html>

About this effect

A 28px rounded square rotates 180 degrees and scales through 0.7 over 0.8s, linear, infinite. A compact loader for buttons and cards.

Similar effects