Build a Gallery of 12 Pure-CSS Loading Spinners with Copyable Code

You get a single HTML page showing 12 live CSS-only loaders, each with its own isolated CSS, a copy button, and a reduced-motion fallback that pulses gently instead of spinning.

The prompt

Prompt
Act as a senior front-end developer who builds clean, accessible UI component libraries.

Build Spinwell, a single-page gallery of 12 pure-CSS loading spinners. The loaders are ring, dual ring, bouncing dots, equalizer bars, ripple, orbit, flipping square, conic gradient arc, clock, fading grid, indeterminate progress bar and hourglass. Each card shows the loader running live in a preview area, its name with a one-line description, a Copy button, and a scrollable dark code panel with that loader's HTML and CSS.

Rules:
1. Each loader uses one class prefix such as ld-ring, has its own uniquely named keyframes, uses no JavaScript, and includes role status with an aria-label of Loading in its markup.
2. Every snippet ends with its own prefers-reduced-motion media query that replaces the movement with a slow opacity pulse. Add a header toggle button with aria-pressed that previews this fallback, plus a line saying whether the visitor's system currently requests reduced motion.
3. Copy uses the Clipboard API, falls back to execCommand, and finally selects the code text. The button says Copied for two seconds and an aria-live region announces it.
4. Use a responsive auto-fill card grid that fits 360 to 1280px wide, a light page, indigo, teal and orange accents, a clear type scale and visible focus outlines.
5. Use no external fonts, libraries, images or storage.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Spinwell, a gallery of 12 copy-ready CSS loaders.

The page opens with all twelve spinners running live, including the ring, ripple, orbit, clock and hourglass. Click Copy on any card to grab its HTML and CSS together. Press Preview reduced motion to watch every loader switch to a soft pulse. A hint line tells you whether your system already requests reduced motion. Tab through the page to reach the buttons and scroll the code panels with the keyboard.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • One class prefix and unique keyframes per loader keep every snippet isolated, so the copied code works on its own.
  • The reduced-motion pulse is built into each snippet, which makes the loaders accessible by default instead of as an afterthought.
  • A three-step copy fallback (Clipboard API, then execCommand, then selecting the text) still works inside sandboxed previews.

Paste into ChatGPT, Claude or Gemini. Save the returned code as spinwell.html and open it in any browser, or run it in the chat's preview or canvas. Copy any loader straight into your own project.

Common edits

  • Swap the indigo, teal and orange hex values in the prompt for your brand colors, or ask for a dark-mode page.
  • Add a speed slider that sets a CSS custom property for animation duration across all twelve loaders.

Prompt details

By
Prompts-GPT editors
Published

Keep exploring

More in Animations & Effects