Skip to content

Commit 8c8e3d8

Browse files
committed
[css-animationworklet] Minor editorial changes in README
1 parent ec95c92 commit 8c8e3d8

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

css-animationworklet/README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,33 @@ address this problem.
3636
# Motivating Use Cases
3737

3838
* Scroll driven effects:
39-
* [Hidey-bar](https://googlechromelabs.github.io/houdini-samples/animation-worklet/twitter-header/): animation depends on both time and scroll input.
40-
* [Parallax](https://googlechromelabs.github.io/houdini-samples/animation-worklet/parallax-scrolling/): Simplest scroll-drive effect.
41-
* [Custom paginated slider](http://aw-playground.glitch.me/amp-scroller.html).
39+
* Hidey-bar ([demo](https://googlechromelabs.github.io/houdini-samples/animation-worklet/twitter-header/)): animation depends on both scroll and time input.
40+
* Parallax ([demo](https://googlechromelabs.github.io/houdini-samples/animation-worklet/parallax-scrolling/)): simplest scroll-driven effect.
41+
* Custom paginated slider ([demo](http://aw-playground.glitch.me/amp-scroller.html)).
4242
* Pull-to-refresh: animation depends on both touch and time inputs.
4343
* Custom scrollbars.
4444
* High-fidelity location tracking and positioning
4545
* [More examples](https://github.com/w3c/css-houdini-drafts/blob/master/scroll-customization-api/UseCases.md) of scroll-driven effects.
4646
* Gesture driven effects:
4747
* [Image manipulator](https://github.com/w3c/csswg-drafts/issues/2493#issuecomment-422153926) that scales, rotates etc.
48-
* Swipe to dismiss.
48+
* Swipe to Action.
4949
* Drag-N-Drop.
5050
* Tiled panning e.g., Google maps.
5151
* Stateful script driven effects:
52-
* [Spring timing emulations](https://googlechromelabs.github.io/houdini-samples/animation-worklet/spring-timing/).
53-
* [Spring-Sticky effect](http://googlechromelabs.github.io/houdini-samples/animation-worklet/spring-sticky/).
52+
* Spring-Sticky effect ([demo](http://googlechromelabs.github.io/houdini-samples/animation-worklet/spring-sticky/)).
5453
* Touch-driven physical environments.
55-
* [Expando](http://googlechromelabs.github.io/houdini-samples/animation-worklet/expando/): Procedural animations with multiple elements.
54+
* Expando ([demo](http://googlechromelabs.github.io/houdini-samples/animation-worklet/expando/)): Procedural animations with multiple elements.
5655
* Animated scroll offsets:
5756
* Having multiple scrollers scroll in sync e.g. diff viewer keeping old/new in sync when you
5857
scroll either ([demo](https://googlechromelabs.github.io/houdini-samples/animation-worklet/sync-scroller/))
5958
* Custom smooth scroll animations (e.g., physic based fling curves)
6059
* Animation Extensibility:
61-
* Custom timing functions (particularly those that are not calculable a priori)
60+
* Custom animation timings (particularly those that are not calculable a priori e.g., [spring demo](https://googlechromelabs.github.io/houdini-samples/animation-worklet/spring-timing/))
6261
* Custom animation sequencing which involves complex coordination across multiple effects.
6362

6463

6564
Not all of these usecases are immediately enabled by the current proposed API. However Animation
66-
Worklet provides a powerfull primitive (off main-thread scriped animation) which when combined with
65+
Worklet provides a powerfull primitive (off main-thread scripted animation) which when combined with
6766
other upcoming features (e.g.,
6867
[Event in Worklets](https://github.com/w3c/css-houdini-drafts/issues/834),
6968
[ScrollTimeline](https://wicg.github.io/scroll-animations/),
@@ -74,7 +73,6 @@ See [Animation Worklet design principles and goals](principles.md) for a more ex
7473
of this.
7574

7675

77-
7876
***Note***: Demos work best in the latest Chrome Canary with the experimental
7977
web platform features enabled (`--enable-experimental-web-platform-features`
8078
flag) otherwise they fallback to using main thread rAF to emulate the behaviour.
@@ -83,14 +81,15 @@ flag) otherwise they fallback to using main thread rAF to emulate the behaviour.
8381
# Animation Worklet
8482

8583
Animation Worklet attempts to address the above usecases by introducing a new primitive that enables
86-
extensibility in the web's core animation model [WebAnimations][WA]): custom animate function!
84+
extensibility in the web's core animation model [WebAnimations][WA]): custom frame-by-frame animate
85+
function!
8786

8887

8988
## How It Works
9089

91-
Normally, an active animation takes its timeline time and according to its running state (e.g., playing,
92-
finished) and playback rate, computes its own **current time** which it then uses to set its
93-
keyframe effect **local time**. Here is a simple example of a simple animation:
90+
Normally, an active animation takes its timeline time and according to its running state (e.g.,
91+
playing, finished) and playback rate, computes its own **current time** which it then uses to set
92+
its keyframe effect **local time**. Here is a simple example of a simple animation:
9493

9594
```js
9695
const effect = new KeyframeEffect(targetEl,
@@ -289,7 +288,7 @@ registerAnimator('twitter-header', class TwitterHeader extends StatelessAnimator
289288
});
290289
```
291290

292-
## Swipe-to-Dissmiss
291+
## Swipe-to-Action
293292

294293
Another usecase for Animation Worklet is to enable interactive input-driven animation effects that
295294
are driven both by input events and time.
@@ -301,7 +300,7 @@ also allow [playback controls](https://github.com/w3c/css-houdini-drafts/issues/
301300
worklets. Both of these are natural planned additions to Animation Worklet.
302301

303302

304-
Consider a simple swipe-to-dismiss effect which follows the user swipe gesture and when finger lifts
303+
Consider a simple swipe-to-action effect which follows the user swipe gesture and when finger lifts
305304
then continues to completion (either dismissed or returned to origin) with a curve that matches the
306305
swipe gesture's velocity. (See this [example](https://twitter.com/kzzzf/status/917444054887124992))
307306

@@ -324,10 +323,10 @@ Note that while in (3), if the user touches down we go back to (2) which ensures
324323
user touch input.
325324

326325
To make this more concrete, here is how this may be implemented (assuming strawman proposed APIs for
327-
playback controls and also receiving pointer events). Note that all the state machine transitions and
328-
various state data (velocity, phase) and internal to the animator. Main thread only needs to provide
329-
appropriate keyframes that can used to translate the element on the viewport as appropriate (e.g.,
330-
`Keyframes(target, {transform: ['translateX(-100vw)', 'translateX(100vw)']})`).
326+
playback controls and also receiving pointer events). Note that all the state machine transitions
327+
and various state data (velocity, phase) and internal to the animator. Main thread only needs to
328+
provide appropriate keyframes that can used to translate the element on the viewport as appropriate
329+
(e.g., `Keyframes(target, {transform: ['translateX(-100vw)', 'translateX(100vw)']})`).
331330

332331

333332
```javascript
@@ -596,8 +595,8 @@ scroll-linked animation proposal. It defines an animation timeline whose time va
596595
scroll position of a scroll container. `ScrollTimeline` can be used an an input timeline for
597596
worklet animations and it is the intended mechanisms to give read access to scroll position.
598597

599-
We can later add additional properties to this timeline (e.g., scroll phase (active, inertial, overscroll),
600-
velocity, direction) that can further be used by Animation Worklet.
598+
We can later add additional properties to this timeline (e.g., scroll phase (active, inertial,
599+
overscroll), velocity, direction) that can further be used by Animation Worklet.
601600

602601
## GroupEffect
603602

@@ -615,6 +614,7 @@ benefitial to Animation Worklet as it provides an ergonomic and low latency way
615614
Worklet to receive pointer events thus enabling it to implement input driven animations more
616615
effectively.
617616

617+
618618
# WEBIDL
619619

620620
`WorkletAnimation` extends `Animation` and adds a getter for its timelines.

0 commit comments

Comments
 (0)