Performance: Duration and timing curves
This affects how long animations take and how smoothly they run, impacting user experience and interaction responsiveness.
button:hover { transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }button:hover { transition-duration: 5s; transition-timing-function: linear; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Long duration + linear timing | Minimal | Minimal | High due to long animation frames | [X] Bad |
| Short duration + smooth cubic-bezier | Minimal | Minimal | Low due to fewer frames and smooth easing | [OK] Good |
duration-700 control in an animation?duration-700 set how long an animation runs in milliseconds.duration-700 meansease-in, ease-out, and ease-in-out to set timing curves.ease-in-out. Other options are invalid or do not exist.duration-300 ease-linear?duration-300 sets the animation length to 300 milliseconds (0.3 seconds).ease-linear means the animation speed is constant from start to end, no acceleration or slowing.class="duration-500 ease-inout" but the animation speed is not smooth. What is the error?ease-in-out with dashes between words.ease-inout failsease-in-out with dashes -> Option Aduration-1000 (1000 milliseconds) is correct.ease-in-out timing curve starts slow, speeds up in the middle, then slows down at the end, matching the requirement.Pass the test and this pattern moves unknown