Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 3bb6dac

Browse files
docs(animations): update copy 2nd pass
1 parent a8bd94f commit 3bb6dac

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

public/docs/ts/latest/guide/animations.jade

+23-24
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ include ../_util-fns
1616
and run natively on [browsers that support it](http://caniuse.com/#feat=web-animation).
1717

1818
For other browsers, a polyfill is required. Grab
19-
[`web-animations.min.js` from Github](https://github.com/web-animations/web-animations-js) and
19+
[`web-animations.min.js` from GitHub](https://github.com/web-animations/web-animations-js) and
2020
add it to your page.
2121

2222

2323
:marked
2424
# Contents
2525

26-
* [Quickstart example: Transitioning between two states](#example-transitioning-between-states).
26+
* [Example: Transitioning between two states](#example-transitioning-between-states).
2727
* [States and transitions](#states-and-transitions).
2828
* [Example: Entering and leaving](#example-entering-and-leaving).
2929
* [Example: Entering and leaving from different states](#example-entering-and-leaving-from-different-states).
@@ -66,16 +66,15 @@ figure
6666
animation metadata.
6767

6868
:marked
69-
Now, using the "`[@triggerName]`" syntax, attach the animation that you just defined to
69+
Now, using the `[@triggerName]` syntax, attach the animation that you just defined to
7070
one or more elements in the component's template.
7171

7272
+makeExample('animations/ts/app/hero-list-basic.component.ts', 'template')(format=".")
7373

7474
:marked
7575
Here, the animation trigger applies to every element repeated by an `ngFor`. Each of
7676
the repeated elements animates independently. The value of the
77-
attribute is bound to the expression `hero.state`. It is always either `inactive`
78-
or `active`.
77+
attribute is bound to the expression `hero.state` and is always either `active`/`inactive`.
7978

8079
With this setup, an animated transition appears whenever a hero object changes state.
8180
Here's the full component implementation:
@@ -148,10 +147,10 @@ figure.image-display
148147
:marked
149148
### The `void` state
150149

151-
The special state, called `void`, can apply to any animation. It applies
150+
The special state called `void` can apply to any animation. It applies
152151
when the element is *not* attached to a view, perhaps because it has not yet been
153-
added or because it has been removed. The `void` state is useful for defining "enter" and
154-
"leave" animations.
152+
added or because it has been removed. The `void` state is useful for defining enter and
153+
leave animations.
155154

156155
For example the `* => void` transition applies when the element leaves the view,
157156
regardless of what state it was in before it left.
@@ -189,10 +188,10 @@ figure
189188
different transitions for entering and leaving based on what the state of the hero
190189
is:
191190

192-
* Inactive hero enter: `void => inactive`.
193-
* Active hero enter: `void => active`.
194-
* Inactive hero leave: `inactive => void`.
195-
* Active hero leave: `active => void`.
191+
* Inactive hero enter: `void => inactive`
192+
* Active hero enter: `void => active`
193+
* Inactive hero leave: `inactive => void`
194+
* Active hero leave: `active => void`
196195

197196
This gives you fine-grained control over each transition:
198197

@@ -211,30 +210,30 @@ figure.image-display
211210
[a list of animatable properties](https://www.w3.org/TR/css3-transitions/#animatable-properties)
212211
on its [CSS Transitions page](https://www.w3.org/TR/css3-transitions).
213212

214-
For positional properties that have a numeric value, define a unit by providing
213+
For positional properties that have a numeric value, you can define a unit by providing
215214
the value as a string with the appropriate suffix:
216215

217216
* `'50px'`
218217
* `'3em'`
219218
* `'100%'`
220219

221-
Define most dimensional properties as a number in pixels:
220+
If you don't provide a unit when specifying dimension, Angular will assume the default of `px`:
222221

223222
* `50` is the same as saying `'50px'`
224223

225224
## Automatic property calculation
226225
figure
227226
img(src="/resources/images/devguide/animations/animation_auto.gif" alt="Animation with automated height calculation" align="right" style="width:220px;margin-left:20px" )
228227
:marked
229-
Sometimes your app doesn't know the value of a dimensional style property until runtime.
230-
For example, it is quite common for elements to have widths and heights that
228+
Sometimes you don't know the value of a dimensional style property until runtime.
229+
For example, elements often have widths and heights that
231230
depend on their content and the screen size. These properties are often tricky
232231
to animate with CSS.
233232

234233
In these cases, you can use a special `*` property value so that the value of the
235234
property is computed at runtime and then plugged into the animation.
236235

237-
In this example, the "leave" animation takes whatever height the element has before it
236+
In this example, the leave animation takes whatever height the element has before it
238237
leaves and animates from that height to zero:
239238

240239
+makeExample('animations/ts/app/hero-list-auto.component.ts', 'animationdef')(format=".")
@@ -244,7 +243,7 @@ figure
244243

245244
There are three timing properties you can tune for every animated transition:
246245
the duration, the delay, and the easing function. They are all combined into
247-
a single transition, *timing string*.
246+
a single transition *timing string*.
248247

249248
### Duration
250249

@@ -267,7 +266,7 @@ figure
267266

268267
The [easing function](http://easings.net/) controls how the animation accelerates
269268
and decelerates during its runtime. For example, an `ease-in` function causes
270-
the animation to begin relatively slowly and picks up speed as it progresses. You
269+
the animation to begin relatively slowly but pick up speed as it progresses. You
271270
can control the easing by adding it as a *third* value in the string after the duration
272271
and the delay (or as the *second* value when there is no delay):
273272

@@ -279,7 +278,7 @@ figure
279278
:marked
280279
### Example
281280

282-
Here are a couple of custom timings in action. Both "enter" and "leave" last for
281+
Here are a couple of custom timings in action. Both enter and leave last for
283282
200 milliseconds but they have different easings. The leave begins after a
284283
slight delay:
285284

@@ -294,7 +293,7 @@ figure
294293
that goes through one or more intermediate styles when transitioning between two sets of styles.
295294

296295
For each keyframe, you specify an *offset* that defines at which point
297-
in the animation keyframe applies. The offset is a number between zero,
296+
in the animation that keyframe applies. The offset is a number between zero,
298297
which marks the beginning of the animation, and one, which marks the end.
299298

300299
This example adds some "bounce" to the enter and leave animations with
@@ -316,16 +315,16 @@ figure
316315
figure
317316
img(src="/resources/images/devguide/animations/animation_groups.gif" alt="Parallel animations with different timings, implemented with groups" align="right" style="width:220px;margin-left:20px" )
318317
:marked
319-
You've seen how you to animate multiple style properties at the same time:
318+
You've seen how to animate multiple style properties at the same time:
320319
just put all of them into the same `style()` definition.
321320

322321
But you may also want to configure different *timings* for animations that happen
323322
in parallel. For example, you may want to animate two CSS properties but use a
324323
different easing function for each one.
325324

326325
For this you can use animation *groups*. In this example, using groups both on
327-
enter and leave allow for two different timing configurations. Both
328-
are applied to the same element in parallel, but run independent of each other:
326+
enter and leave allows for two different timing configurations. Both
327+
are applied to the same element in parallel, but run independently of each other:
329328

330329
+makeExample('animations/ts/app/hero-list-groups.component.ts', 'animationdef')(format=".")
331330

0 commit comments

Comments
 (0)