Last active
July 10, 2025 14:51
-
-
Save liquidcarbon/5d7bed9c2da30004a90ef5b7e7d8f363 to your computer and use it in GitHub Desktop.
SVG with CSS animation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <svg width="120" height="120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> | |
| <style> | |
| .circle { | |
| fill: orange; | |
| animation: pulse 1.5s infinite ease-in-out; | |
| animation-play-state: running; | |
| transform-origin: center; | |
| } | |
| svg:hover .circle { | |
| animation-play-state: paused; | |
| } | |
| @keyframes pulse { | |
| 0%, 100% { | |
| r: 20; | |
| opacity: 0.8; | |
| } | |
| 50% { | |
| r: 60; | |
| opacity: 0.2; | |
| } | |
| } | |
| </style> | |
| <circle class="circle" cx="60" cy="60" r="20" /> | |
| <text x="15" y="60">hover to pause</text> | |
| </svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment