Skip to content

Add 3D coin flip animation with front and back faces - #29

Merged
rastermanden merged 6 commits into
mainfrom
claude/rotating-coin-animation-5JaQg
Apr 21, 2026
Merged

rastermanden merged 6 commits into
mainfrom
claude/rotating-coin-animation-5JaQg

Conversation

@rastermanden

Copy link
Copy Markdown
Owner

Summary

Replaced the static coin image with an interactive 3D coin flip animation that rotates to show both the obverse and reverse sides of the One Bral coin.

Key Changes

  • New CSS animations: Added @keyframes coinflip for continuous 360° rotation around the Y-axis with a 9-second cycle
  • 3D perspective styling: Implemented .coin-flip-scene with 3D perspective and .coin-flip container with preserve-3d transform style
  • Dual coin faces: Created .coin-face elements for front and back with backface-visibility: hidden to show only the visible side during rotation
  • Visual refinement: Added .coin-rim with a conic gradient and radial mask to hide the seam where the two faces meet
  • Accessibility: Included prefers-reduced-motion media query to disable animation for users who prefer reduced motion
  • Component updates: Updated TheHero.vue to use separate coinFront and coinBack image imports instead of a single coin image
  • Updated caption: Changed figure caption from "Ten Bral, obverse" to "One Bral · Loshult 2025" to reflect the dual-sided nature

Implementation Details

  • The coin rotates continuously using a linear animation, creating a smooth flipping effect
  • Both coin faces are positioned absolutely and overlay each other, with the back face rotated 180° on the Y-axis
  • The rim element uses a conic gradient to simulate metallic edge lighting and a radial mask to create the thin border effect
  • Vendor prefixes included for webkit browsers (-webkit-backface-visibility, -webkit-mask)
  • Drop shadow filter preserved on the coin container for depth

https://claude.ai/code/session_01TM8D2VY6RXiE8qwMZeLXrE

claude and others added 6 commits April 21, 2026 13:18
Replace the flat 2D spin in TheHero with a 3D rotateY flip that
alternates between the obverse (Naturklubben emblem) and reverse
(1 BRAL · Loshult 2025) photos of the real coin. Uses
preserve-3d + backface-visibility on two stacked .coin-face
layers plus a conic-gradient rim to hide the seam. Honors
prefers-reduced-motion.

Image paths: public/img/coin-front.jpg and public/img/coin-back.jpg.

https://claude.ai/code/session_01TM8D2VY6RXiE8qwMZeLXrE
The GitHub web-UI renames had turned both files into 2-byte text
stubs while the real binaries stayed only in history. Overwrite
the stubs with the actual PNGs pulled from the upload commits:

  coin-front.png ← NATURKLUBBEN emblem (obverse)
  coin-back.png  ← 1 BRAL · LOSHULT · 2025 (reverse)

https://claude.ai/code/session_01TM8D2VY6RXiE8qwMZeLXrE
@rastermanden
rastermanden merged commit 1987fe2 into main Apr 21, 2026
1 check passed
@rastermanden
rastermanden deleted the claude/rotating-coin-animation-5JaQg branch April 21, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants