Re: [csswg-drafts] [scroll-animations-1] Entry/Exit Transitions for View Timeline effects (#7044)

I think the main challenge is that the current definition of `cover` and `contain` implicitly correlate start / end offset to opposite edges of the viewport. If we could specify which edge of the viewport we were referring to, enter and exit animations are equivalent to the ranges `[end 0%, end 100%]` and `[start 100%, start 0%]` (note end is first because the item first comes in to the "end" side of the viewport). What if we allowed specifying both offsets in terms of the start and end edges of the viewport, e.g.

```
view-timeline-range: [start|end]? <percentage> [start|end]? <percentage>?
```
If you omit either [start|end] value it would imply the end edge followed by the start edge. If you omit <percentage> we use the same value.

In this syntax, cover would map to `end 0% start 0%`, contain would map to `end 100% start 100%`, enter would be equivalent to `end 0% end 100%` and exit would be equivalent to `start 100% start 0%`. If we assume the existing mapping of cover to 0% and contain to 100% then the existing view-timeline-fit values would work as expected.

Note that specifying the `start` edge followed by the `end` edge would almost always produce a backwards range. This is a pre-existing problem with `contain` when the object is larger than the viewport.

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


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

Received on Monday, 2 May 2022 19:52:23 UTC