Re: [csswg-drafts] [scroll-animations-1] Support setting start and end time on scroll timeline. (#7296)

My proposal would be to add to the scroll timeline CSS and javascript constructions a start and end offset / time. These should accept lengths, e.g.

From Javascript:
```js
element.animate(
    {transform: ['none', 'translateY(100px)']},
    {timeline: new ScrollTimeline({
        source: scroller,
        endScrollOffset: CSS.px(100) /* Presuming we go with CSSOM types */
    })});
```

From CSS:
```css
.foo {
  .animation-timeline: scroll(0 100px); /* optional axis and scroller omitted for brevity. */
}
```

Note, that with the ability to specify start and end scroll offsets we might need to revisit whether we want the arbitrary offsets list from #4912 or not. My preference would be to avoid the complexities of arbitrary lists of offsets for the initial spec, but if we want to prepare for that possibility we could pass an array or object structure to the JS API rather than having an explicit `startScrollOffset` and `endScrollOffset`.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7296#issuecomment-1137797848 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 25 May 2022 20:05:03 UTC