Keyframe
Make the logo rotate continuously. AI says to use keyframes?
Make the logo rotate continuously. AI says to use keyframes?
@keyframes spin {
0% { rotate: 0deg }
50% { rotate: 180deg }
100% { rotate: 360deg }
}
.spin { animation: spin 2s; animation-iteration-count: infinite }You specify the keyframes; the browser interpolates eligible properties, while other properties may switch discretely.
A transition has only two states: From initial to target state, triggered by hover or click; it plays once and stops.
Keyframes can specify many states: Specify points at 0%, 50%, and 100%; set animation-iteration-count separately if it should loop.
Read the code for state points: Percentages inside @keyframes are the specified points; the browser interpolates between them for animatable properties, while other properties may switch discretely.
Make the loading icon rotate in a loop: use @keyframes for its states and set animation-iteration-count: infinite. Also respect the system's reduced-motion preference; confirm the icon's movement changes when that setting is on.