-
Notifications
You must be signed in to change notification settings - Fork 707
[scroll-animations-1] Range for entire scroll range #9367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Big +1 in general. Regarding:
I'm not sure I'm following. |
@flackr ok I think I understand your point. I think this issue is ready for agenda+, WDYT? |
Two thoughts:
Some examples:
|
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> flackr: We decided that the default range for 'view' timelines is the 'cover' range, because this is a sensible default animation<fantasai> ... for animating as some element goes through the viewport <fantasai> ... but no way to express the total scroll range <fantasai> ... so sometimes might want start of scroll to some position in view range <fantasai> ... or view range position to end of scroll <fantasai> ... simplest think we could do is add a named range that refers to the full scroll range, so we can refer to it in the animation-range <fantasai> ... suggestion is "full" <fantasai> flackr: also raised issue specifying pixel values as offsets from cover range <fantasai> ... but might be awkward <bramus> q+ <fantasai> ... also would be a breaking change <fantasai> ... to change interpretation of values without range name <fantasai> ... because default animation range for view timelines is 'cover' <Rossen_> ack bramus <fantasai> bramus: if you specify 3 values, if you don't specify a range name it defaults to 'cover' for view timeline and 'full' for scroll timelines? <fantasai> flackr: I thought we already resolved 3-value syntax <TabAtkins> fantasai: I'm trying to think thru this <Rossen_> ack fantasai <TabAtkins> fantasai: Not sure "full" is actually better than "scroll" <TabAtkins> fantasai: view timelines are supposed to be about when the element is in view, there's different interps of what that might mean, but that's what it's about <TabAtkins> fantasai: saying "full" timeline is the entire scroll range might be a little odd <TabAtkins> fantasai: if you wanted the full scroll range you should use the scroll timeline rather than view timelien <TabAtkins> fantasai: I can see use-cases for wanting one end or another tied to the end of the scroll <TabAtkins> fantasai: But we should make it clearer you're extending outside the conceptual range of the view timeline <TabAtkins> fantasai: And it definitely shouldn't be the default <bramus> q+ <fantasai> flackr: originally why I proposed 'scroll', full range of view timeline should be considered to be 'cover' <schenney> q+ <Rossen_> ack bramus <fantasai> bramus: if we use 'scroll', then it wouldn't make sense for other timelines e.g. media playback timelines <fantasai> flackr: for media timelines, default would be the full playback range <fantasai> bramus: for scroll timelines, default is the full scroll timeline <Rossen_> ack schenney <fantasai> schenney: "full" is referring to "full page", might help to clarify <fantasai> flackr: not quite, talking about entire scroll range <fantasai> schenney: complete scrollable area? <fantasai> flackr: yes <fantasai> Rossen_: That excludes the scroll-margin areas? <fantasai> flackr: I don't think so, it represents offset zero and max offset <fantasai> Rossen_: if I have something in the negative space? <fantasai> flackr: yes, that's excluded <fantasai> Rossen_: and something beyond end of range? <fantasai> flackr: right <fantasai> fantasai: do we want to accept and bikeshed later? <schenney> content? <fantasai> Rossen_: let's pick one of the two names for now, and then go with it <fantasai> Rossen_: Let's stick to 'scroll' because then at least one person doesn't like it, and we can bikeshed to find the right name <fantasai> Rossen_: Proposed to add 'scroll' named range to view timelines, represents entire scroll range <fantasai> RESOLVED: add 'scroll' named range to view timelines, represents entire scroll range, bikeshed keyword in issue |
I think I get why scroll makes sense as a name: You are using the range of a scroll timeline for a view timeline. In which case I am fine with scroll. |
To carry out this bikeshedding, the proposals are:
I think we're pretty well aligned on #1, but happy to have emoji votes / comments or rationales for the others, or suggestions for alternatives. |
If we do name it That way, using Additionally, for |
That would also allow fixing that non spec-compliant situation in Chrome where you have to pass in anim.rangeStart: {
offset: CSS.px(100),
rangeName: 'none', // This needs to be `"none"`, but `none` is not defined in the spec as a valid `rangeName`.
}, |
According to spec range names are only defined for ViewTimeline, so why should this be any different?
That sounds unfortunate. But in CSS the name is optional. Can't it be the same in JS? |
OK, the poll in #9367 (comment) is clearly leaning towards using PROPOSED RESOLUTION: They keyword that represents the entire scroll range is |
Would love some input on my suggestion in #9367 (comment) to also enable that keyword for |
Another option to consider could be |
I’m not sure the notion of |
Fair enough, maybe it's weird to have |
@bramus having the scroll range work on scroll timeline as well seems reasonable. |
The CSS Working Group just discussed
The full IRC log of that discussion<emilio> bramus: when you are specifying a view timeline which you use for animation, and attach it to a range or sub-range<emilio> ... there's no way to specify the entire scroll range <emilio> ... we came up with a bunch of keywords <emilio> ... I think we settled on the world `scroll` <emilio> ... since then there were some more suggestions <emilio> ... like `fill` and `full-range` <emilio> ... we also want to make this do something for scroll timelines <emilio> ... to use this keywords in JS APIs <emilio> ... when specifying ranges <emilio> ... looking to adopt this keyword (personal preference being `scroll`) into the spec <flackr> +1 <emilio> ... this would allow you to do animation-range: entry 0%, scroll 1000px <dbaron> Present- <emilio> ... so you can mix and match a range relative to the tracked subject and the second relative to the scroll range <astearns> ack fantasai <emilio> fantasai: so the scroll 1000px point might be before or after <emilio> bramus: if you overshoot it flips <emilio> fantasai: no going backwards <emilio> q+ <fantasai> scribe+ <astearns> ack emilio <emilio> bramus: consistent with explicit values <fantasai> scribe+ TabAtkins <TabAtkins> emilio: it woudl be well-defined if.. <TabAtkins> emilio: %s also need to care about the scroll range changing <TabAtkins> bramus: if you use animation-range: 0% 100% on a scroll timeline, that's the same as animation-range: scroll 0% scroll 100% <TabAtkins> bramus: %s are calculated in smae manner <TabAtkins> emilio: as long as it's well-defined what happens when the scroll range changes (presuambly recompute on next frame), sounds good <emilio> scribe+ <TabAtkins> astearns: i see we have a previous resolution on "add scroll, but bikeshed" <emilio> astearns: is the bikeshed just settling on scroll? <emilio> bramus: I think we settle on `scroll` <emilio> ... looking at the replies <astearns> `RESOLVED: add 'scroll' named range to view timelines, represents entire scroll range, bikeshed keyword in issue` <emilio> flackr: did a short survey <bramus> https://github.com//issues/9367#issuecomment-1904777189 <emilio> PROPOSAL: the keyword is `scroll` <emilio> PROPOSAL: The keyword applies to scroll-timeline as well <emilio> fantasai: isn't it a no-op for scroll-timeline? <emilio> bramus: it becomes interesting in JS <flackr> q+ <emilio> ... you pass an object into the range start property of the animation <emilio> ... so you specify an object and range, and the range is `scroll` <emilio> ydaniv: scroll timeline doesn't have range names <bramus> ``` <bramus> anim.rangeStart: { <bramus> offset: CSS.px(100), <bramus> rangeName: 'none', // This needs to be `"none"`, but `none` is not defined in the spec as a valid `rangeName`. <bramus> }, <bramus> ``` <bramus> (replace none with scroll) <emilio> flackr: What this gives you is the ability to attach to a px offset <emilio> ... I suppose ranges have that anyways <emilio> ... nevermind <emilio> RESOLVED: Keyword is `scroll` <emilio> RESOLVED: It also applies to scroll timelines |
It has come up a few times (#8942 (comment), #8672 (comment), #8578 (comment)) that we don't have any way to specify the entire scroll range for view timelines.
We decided in other issues that because we want the default range for a view timeline to be the cover range we should have cover by the normal range. If we want to preserve this but still support the use cases for the entire scroll range we should add a new range name for view timelines to cover this. E.g. the
scroll
range could represent the full range. Then authors could do something likeanimation-range: entry 0% scroll 1000px
to make an animation from when an element enters to when you're scrolled 1000px down.My preference would be to have
animation-range
without a range name use this range, e.g. justanimation-range: entry 0% 1000px
oranimation-range: 200px 1000px
but I think @fantasai had concerns with having the default animation range be cover except if you specify an animation-range without a named range.The text was updated successfully, but these errors were encountered: