You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#interaction-between-animation-play-state-and-web-animations-API"><spanclass="secno">3.1.1</span><spanclass="content">Interaction between <spanclass="property">animation-play-state</span> and the Web Animations API</span></a>
running states, the user agent must run the <adata-link-type="dfn" href="https://w3c.github.io/web-animations/#play-an-animation">play an animation</a> procedure
330
333
on the animation. If the change is due to a change in the computed value of <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> (i.e. the transition E → A) the <var>auto-rewind</var> flag for that procedure must be set to false; otherwise
<p>The <aclass="property" data-link-type="propdesc" href="#propdef-animation-composition">animation-composition</a> property defines the <adata-link-type="dfn" href="https://w3c.github.io/web-animations/#composite-operation">composite operation</a> used when multiple animations affect the same property simultaneously.</p>
<p>The values of <aclass="property" data-link-type="propdesc" href="#propdef-animation-composition">animation-composition</a> have the meaning defined for the
372
+
corresponding values of the <adata-link-type="dfn" href="https://w3c.github.io/web-animations/#composite-operation">composite operation</a> defined in Web
<p>When specified in a keyframe, <aclass="property" data-link-type="propdesc" href="#propdef-animation-composition">animation-composition</a> defines the operation
375
+
used for each property specified in that keyframe until the next keyframe
376
+
specifying each property.</p>
377
+
<divclass="example" id="example-e146d515">
378
+
<aclass="self-link" href="#example-e146d515"></a> For example, the following stylesheet defines two different animations
379
+
targetting the <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-2/#propdef-scale">scale</a> property.
380
+
<pre>@keyframes heartbeat {
381
+
from {
382
+
scale: 1;
383
+
animation-timing-function: ease-out;
384
+
}
385
+
30% {
386
+
scale: 1.3;
387
+
}
388
+
}
389
+
.heartbeat {
390
+
animation: heartbeat 0.3s 2s infinite;
391
+
}
392
+
393
+
@keyframes throb {
394
+
50% {
395
+
scale: 1.8;
396
+
}
397
+
}
398
+
.icon:mouseover {
399
+
animation: throb 0.4s add;
400
+
}
401
+
</pre>
402
+
<p>If these two animations are applied to the same element, normally only
403
+
one animation would apply, but by specifying <aclass="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valuedef-add">add</a> as the <aclass="property" data-link-type="propdesc" href="#propdef-animation-composition">animation-composition</a> on the second animation, the result of the two
404
+
animations will be combined.</p>
405
+
<p>Since CSS Transitions <adata-link-type="biblio" href="#biblio-css3-transitions">[CSS3-TRANSITIONS]</a> have a lower composite
406
+
order, it is possible to use <aclass="property" data-link-type="propdesc" href="#propdef-animation-composition">animation-composition</a> to combine CSS
407
+
Animations with underlying transitions as in the following example.</p>
408
+
<pre>.icon {
409
+
filter: blur(20px);
410
+
transition: filter 0.5s;
411
+
}
412
+
.icon:hover {
413
+
filter: blur(0px);
414
+
animation: brightness-pulse 3s infinite add;
415
+
}
416
+
417
+
@keyframes pulse {
418
+
0% {
419
+
scale: 1.1;
420
+
filter: brightness(130%);
421
+
}
422
+
10% {
423
+
scale: 1;
424
+
filter: brightness(100%);
425
+
}
426
+
}
427
+
</pre>
428
+
<pclass="issue" id="issue-69776a9f"><aclass="self-link" href="#issue-69776a9f"></a> Create pictures of these examples and verify they make sense.</p>
<li><ahref="#left-active">left-active</a><span>, in §4.2</span>
572
671
<li><ahref="#owning-element">owning element</a><span>, in §2.1</span>
573
672
<li><ahref="#right-active">right-active</a><span>, in §4.2</span>
673
+
<li><ahref="#typedef-single-animation-composition"><single-animation-composition></a><span>, in §3.2</span>
574
674
</ul>
575
675
<h3class="no-num heading settled" id="index-defined-elsewhere"><spanclass="content">Terms defined by reference</span><aclass="self-link" href="#index-defined-elsewhere"></a></h3>
0 commit comments