-
Notifications
You must be signed in to change notification settings - Fork 759
Description
This issue presents a new named animation ranges defined in the Pointer-driven animations spec, and builds on top of the concept of Timeline Ranges defined in scroll-animations-1, plus the concept of Animation Range Centering.
Pointer-driven animations introduce new timeline ranges to allow control over the size of the active range, and the interpolation behavior of the timeline, when used together with animation range centering, i.e. the animation-range-center property. These ranges replace the named ranges introduced in Scroll-Driven Animations, with ranges that are more fitting and appropriate for Pointer-Driven Animations.
The spec currently defines the following range names:
fill
- 0% - start padding edge of the element’s principal box.
- 100% - end padding edge of the element’s principal box.
- If center is shifted, then interpolations between 0%-50% and 50%-100% are scaled up/down to fit these ranges.
Example
fit
- Same size as
fill - The 0% and 100% points are offset according to the value of the
animation-range-centerproperty, so that the point of 50% remains at the center of the range.
Example
cover
- Largest possible range that fully covers the element’s principal box according to the value of
animation-range-center. - The farthest side from any padding edge to the 50% point is used, and then that side is mirrored to the other side.
Example
contain
- Largest possible range that is fully contained within the element’s principal box according to the value of
animation-range-center. - The closest side from any padding edge to the 50% point is used, and then that side is mirrored to the other side.
Example
Note: It's imperative that ranges are first centered according to animation-range-center, and only then -start and -end ranges are applied to expand/contract the active range, as well as adjust interpolation (where necessary) between edges and the 50% progress point.
Proposal:
I think we have 3 options here:
- Accept the above ranges as specced.
- It seems to me that mixing different ranges together doesn't really make any sense, so we could improve this in 2 ways:
- Allow a single range name for PDAs, so that we only have:
<range-name> || <range-start-offset> <range-end-offset>?, and we figure out the longhands for that. - Split the above ranges into more basic start/end edges as:
farthest-side,closest-side, andfixed. Then the above becomes:cover -> farthest / farthest.contain -> closest / closest.fillis sort of magical here since it allows automatic flipping betweenfarthest / closestandclosest / farthest, the idea is that the offsets are relative to the edges.fitdoesn't conform to these names - in this range the edges of the range aren't fixed to the edges of the timeline, instead the distances are fixed and offsets are relative to them.
- Allow a single range name for PDAs, so that we only have:
I think I'm leaning towards 2i. - Allowing a single range name for PDAs. IMO these effects usually have a notion of spatial symmetry to them, so splitting the range to start and end doesn't make much sense in the context of PDAs. On top of that, I think the suggested ranges cover well beyond all the use-cases I could find/imagine.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status