Swing Animation Effect
Run
HTML
Swing
CSS
.circle { width: 100px; height: 100px; background: #ad132a; border-radius: 50%; } .swing { transform-origin: top center; animation-name: swing; animation-duration: 1s; animation-iteration-count: infinite; animation-delay: 1s; animation-fill-mode: both; } @keyframes swing { 20% { transform: rotate3d(0, 0, 1, 15deg); } 40% { transform: rotate3d(0, 0, 1, -10deg); } 60% { transform: rotate3d(0, 0, 1, 5deg); } 80% { transform: rotate3d(0, 0, 1, -5deg); } 100% { transform: rotate3d(0, 0, 1, 0deg); } }
Follow Us