Animations
Three ways to animate on Lynx: a CSS transition, a CSS @keyframes animation and the element.animate() API.
What it shows
- A CSS transition — toggling
[class.transition-active]animates the box's background color throughtransition: background-color 0.5s. See Animations. - CSS
@keyframes— adding thespinningclass starts an endlessrotateanimation. element.animate()—viewChild()finds the element, andanimate()plays a scale-and-fade pulse. The returnedLynxAnimationis canceled before each replay. See Animate from code andLynxAnimation.- The
setTimeoutrule —animate()is called insidesetTimeout, because starting it inside a tap handler can crash the app. The class toggles are wrapped too, though signal changes don't need it. See ThesetTimeoutrule.
