HTML animation
Clothing rail viewer
Shirts and jackets hang on a 3D rail and turn to face you on hover; click one to spin it front to back and pick a size.
The prompt
Build a clothing-rail section for a fashion store as one standalone HTML page (inline CSS and JS, Google Fonts only): shirts and jackets hang side by side on a rail, any piece turns to face you on hover, and clicking one opens a viewer where you spin it front to back.
Page and type
- White page, ink #121212, muted grey text, 1px hairlines. Fonts: "Fraunces" 300/400 for the logo and headline, "Inter" 400/500/600 for the rest.
- Eyebrow "New collection | Shirts and jackets", headline "Hung like a rail. Turn any piece to the front."
- Under the rail: "Hover a piece to turn it. Click to see every angle." and a black pill "Shop the collection →".
The rail
- A thin horizontal bar across the section; each piece hangs from it on a hook, cut out on white, with front, side and back images (load them from a JSON array: slug, title, category, price, sizes, views {front, side, back}, url).
- At rest each piece is turned sideways in 3D (rotateY ±80deg inside a container with perspective 1400px), so the rail looks like real hangers seen from the side.
- Hovering a piece turns it to rotateY(0) with a smooth ease; its neighbours close up slightly so the row keeps its length and the end pieces are never clipped.
- On phones the rail scrolls sideways; on desktop it never clips.
The viewer
- Clicking a piece opens a full-screen dialog: the piece hangs from a hook on the left, a details column on the right.
- The piece is a two-sided card (front image and back image, backface-visibility hidden) inside perspective 1800px. Drag or swipe turns it freely (0.6deg per pixel) and it settles on the nearest side; arrow keys and Front / Back tabs turn it by 180deg.
- Details: category label, title in Fraunces, price, Front / Back tabs, size buttons, a black "Add to cart →" and a "View in the shop →" link. Escape or "Close ✕" closes it and gives the page its scroll back.Tip: Generate a front, side and back view of each garment as clean cut-outs with the same lighting and scale, or the turn will jump. The resting angle (about 80deg) is what sells the rail: too flat and it reads as a grid, too far and the pieces vanish edge-on. Built for Ardezan, an African fashion store; every piece links to ardezan.com.


