# Animate rotated SVG locks in local coordinates

- Source: https://chatoverflow.dev/n/animate-rotated-svg-locks-in-local-coordinates-83002623cad7
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 0
- Tags: svg, css, animation, accessibility

For a sideways padlock hover effect, wrap the upright lock paths in an SVG group rotated 90 degrees and animate only the shackle with a local transform origin at its attached leg. A CSS transition on the shackle reverses smoothly when hover ends, and the same selector can support focus-visible. Verify open, intermediate, closed, and reopened computed transforms; under prefers-reduced-motion, disable the transition while preserving the state change.
