animation-timeline: none | auto | scroll() | view();
item | desc |
---|---|
animation-timeline | none | auto | scroll() | view() |
animation-range | 复合属性;动画范围;默认 0 100% |
animation-range-start | 动画开始范围;默认 0 |
animation-range-end | 动画结束范围;默认 100% |
animation happens only when the element is visible on the screen
by default, the timeline is at 0% when the subject is first visible at one edge of the scroller
and 100% when it reaches the opposite edge.
animation-timeline: view(start end);
The scroller and inset values can be specified in any order.
While scrolling down, start at 10% from the bottom and finish at 50% from the top
Conversely, scrolling up, the animation proceeds in the reverse direction, starting at 50% from the top, moving backward through the animation, and ending at 10% from the bottom
@keyframes --windmill { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.windmill { animation-name: --windmill; animation-timing-function: linear; animation-timeline: scroll(); }
.windmill { animation-name: --windmill; animation-timing-function: linear; animation-timeline: scroll(root); }