Mobius
const css = `
/* Each slice sits at angle --a round the loop and is twisted by half that angle:
a half twist over the whole loop is what makes it a Mobius band. Turning every
twist on by 180deg (the band looks the same each half turn) rolls it round. */
@keyframes loader-mobius-roll {
from { transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2)); }
to { transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2 + 180deg)); }
}
@keyframes loader-mobius-spin {
from { transform: rotateX(62deg) rotateZ(0deg); }
to { transform: rotateX(62deg) rotateZ(-360deg); }
}
.loader-mobius {
display: grid;
place-items: center;
width: 120px;
height: 110px;
perspective: 420px;
}
.loader-mobius__loop {
position: relative;
width: 0;
height: 0;
transform-style: preserve-3d;
animation: loader-mobius-spin 9s linear infinite;
}
.loader-mobius__slice {
position: absolute;
left: -1.5px;
top: -12px;
width: 3px;
height: 24px;
border-radius: 2px;
background: linear-gradient(light-dark(#373a40, #f1f2f3), light-dark(#6d7179, #7d8087));
animation: loader-mobius-roll 2.2s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
.loader-mobius__loop { animation-duration: 40s; }
.loader-mobius__slice { animation: none; transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2)); }
}
`;
const SLICES = 44;
export function MobiusLoader() {
return (
<>
<style>
{css}
</style>
<div className="loader-mobius" role="status" aria-label="Loading">
<div className="loader-mobius__loop" aria-hidden="true">
{Array.from({ length: SLICES }, (_, i) => (
<span
key={i}
className="loader-mobius__slice"
style={{ '--a': `${((i * 360) / SLICES).toFixed(2)}deg` } as React.CSSProperties}
/>
))}
</div>
</div>
</>
);
}Markup where the component goes, CSS in your stylesheet. No JavaScript.
<div class="loader-mobius" role="status" aria-label="Loading">
<div class="loader-mobius__loop" aria-hidden="true">
<span class="loader-mobius__slice" style="--a:0.00deg"></span>
<span class="loader-mobius__slice" style="--a:8.18deg"></span>
<span class="loader-mobius__slice" style="--a:16.36deg"></span>
<span class="loader-mobius__slice" style="--a:24.55deg"></span>
<span class="loader-mobius__slice" style="--a:32.73deg"></span>
<span class="loader-mobius__slice" style="--a:40.91deg"></span>
<span class="loader-mobius__slice" style="--a:49.09deg"></span>
<span class="loader-mobius__slice" style="--a:57.27deg"></span>
<span class="loader-mobius__slice" style="--a:65.45deg"></span>
<span class="loader-mobius__slice" style="--a:73.64deg"></span>
<span class="loader-mobius__slice" style="--a:81.82deg"></span>
<span class="loader-mobius__slice" style="--a:90.00deg"></span>
<span class="loader-mobius__slice" style="--a:98.18deg"></span>
<span class="loader-mobius__slice" style="--a:106.36deg"></span>
<span class="loader-mobius__slice" style="--a:114.55deg"></span>
<span class="loader-mobius__slice" style="--a:122.73deg"></span>
<span class="loader-mobius__slice" style="--a:130.91deg"></span>
<span class="loader-mobius__slice" style="--a:139.09deg"></span>
<span class="loader-mobius__slice" style="--a:147.27deg"></span>
<span class="loader-mobius__slice" style="--a:155.45deg"></span>
<span class="loader-mobius__slice" style="--a:163.64deg"></span>
<span class="loader-mobius__slice" style="--a:171.82deg"></span>
<span class="loader-mobius__slice" style="--a:180.00deg"></span>
<span class="loader-mobius__slice" style="--a:188.18deg"></span>
<span class="loader-mobius__slice" style="--a:196.36deg"></span>
<span class="loader-mobius__slice" style="--a:204.55deg"></span>
<span class="loader-mobius__slice" style="--a:212.73deg"></span>
<span class="loader-mobius__slice" style="--a:220.91deg"></span>
<span class="loader-mobius__slice" style="--a:229.09deg"></span>
<span class="loader-mobius__slice" style="--a:237.27deg"></span>
<span class="loader-mobius__slice" style="--a:245.45deg"></span>
<span class="loader-mobius__slice" style="--a:253.64deg"></span>
<span class="loader-mobius__slice" style="--a:261.82deg"></span>
<span class="loader-mobius__slice" style="--a:270.00deg"></span>
<span class="loader-mobius__slice" style="--a:278.18deg"></span>
<span class="loader-mobius__slice" style="--a:286.36deg"></span>
<span class="loader-mobius__slice" style="--a:294.55deg"></span>
<span class="loader-mobius__slice" style="--a:302.73deg"></span>
<span class="loader-mobius__slice" style="--a:310.91deg"></span>
<span class="loader-mobius__slice" style="--a:319.09deg"></span>
<span class="loader-mobius__slice" style="--a:327.27deg"></span>
<span class="loader-mobius__slice" style="--a:335.45deg"></span>
<span class="loader-mobius__slice" style="--a:343.64deg"></span>
<span class="loader-mobius__slice" style="--a:351.82deg"></span>
</div>
</div>/* Each slice sits at angle --a round the loop and is twisted by half that angle:
a half twist over the whole loop is what makes it a Mobius band. Turning every
twist on by 180deg (the band looks the same each half turn) rolls it round. */
@keyframes loader-mobius-roll {
from { transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2)); }
to { transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2 + 180deg)); }
}
@keyframes loader-mobius-spin {
from { transform: rotateX(62deg) rotateZ(0deg); }
to { transform: rotateX(62deg) rotateZ(-360deg); }
}
.loader-mobius {
display: grid;
place-items: center;
width: 120px;
height: 110px;
perspective: 420px;
}
.loader-mobius__loop {
position: relative;
width: 0;
height: 0;
transform-style: preserve-3d;
animation: loader-mobius-spin 9s linear infinite;
}
.loader-mobius__slice {
position: absolute;
left: -1.5px;
top: -12px;
width: 3px;
height: 24px;
border-radius: 2px;
background: linear-gradient(light-dark(#373a40, #f1f2f3), light-dark(#6d7179, #7d8087));
animation: loader-mobius-roll 2.2s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
.loader-mobius__loop { animation-duration: 40s; }
.loader-mobius__slice { animation: none; transform: rotateZ(var(--a)) translateX(38px) rotateX(calc(var(--a) / 2)); }
}Goal: Create a "Mobius" loader.
Visual behavior: A Mobius band built from slices: each one is twisted by half its angle round the loop, so the band carries a single half twist. The slices roll round their own loop endlessly while the whole band turns slowly in 3D.
Technique:
- Forty-four thin gradient slices share a zero-size parent with transform-style: preserve-3d; each gets --a, its angle round the loop.
- A slice's transform is rotateZ(--a) translateX(38px) rotateX(--a / 2): half a turn of twist over the whole loop is what makes it a Mobius band.
- Each slice animates its twist by a further 180deg; the band looks the same every half turn, so the loop rolls forever without a seam.
- The parent is tilted rotateX(62deg) and spins slowly on Z, inside a perspective of 420px.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the slices stop rolling and the band turns very slowly.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: neutral only. Black, white and grays, no hues. Use the color values above as written, or my project's closest neutral tokens.
Return a single self-contained component. No dependencies.Goal: Create a "Mobius" loader.
Visual behavior: A Mobius band built from slices: each one is twisted by half its angle round the loop, so the band carries a single half twist. The slices roll round their own loop endlessly while the whole band turns slowly in 3D.
Technique:
- Forty-four thin gradient slices share a zero-size parent with transform-style: preserve-3d; each gets --a, its angle round the loop.
- A slice's transform is rotateZ(--a) translateX(38px) rotateX(--a / 2): half a turn of twist over the whole loop is what makes it a Mobius band.
- Each slice animates its twist by a further 180deg; the band looks the same every half turn, so the loop rolls forever without a seam.
- The parent is tilted rotateX(62deg) and spins slowly on Z, inside a perspective of 420px.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the slices stop rolling and the band turns very slowly.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: use my project's existing color tokens. The color values above are grayscale placeholders. Map each one by its role (surface, text, border, accent, glow) to my theme, and keep their relative lightness so contrast and the effect still read.
Return a single self-contained component. No dependencies.Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Free to use in any project, commercial included. MIT-0, no attribution required. Licence
About this component
A Mobius band built from slices: each one is twisted by half its angle round the loop, so the band carries a single half twist. The slices roll round their own loop endlessly while the whole band turns slowly in 3D.
- Dependencies
- None
- Difficulty
- Advanced
- Triggers
- continuous, loop, 3d
- Techniques
- preserve 3d, 3d transform, keyframes, css variables
- Reduced motion
- Respected
- Theme
- Light and dark (follows your page's color-scheme)
The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the slices stop rolling and the band turns very slowly.