Re: transitions vs. animations

On Wed, Apr 7, 2010 at 2:04 PM, Lars Gunther <gunther@keryx.se> wrote:
> 2010-04-07 16:52, Tab Atkins Jr. skrev:
>>
>> The "play-in" and "play-during" I suggested are exactly the same as
>> the current Animations draft - play-in animations are just finite
>> iterations, while play-during are infinite.  There is no concept of
>> "events" or "states" invented to handle them; they trigger purely
>> through CSS values changing, exactly like the current Animations
>> draft.  "play-out" is nothing more than the inverse of the "play-in"
>> conditions.
>
> The current wave of discussion started because there was a desire to
> simplify syntax. But now a whole new concept ("conditions") is invented
> because designers find scripting to hard? How is this simplifying anything?

There is no new notion of conditions.  My suggested changes work on
exactly the same principles as the current Animations draft.  I just
separate out two things that are lumped together in the current
Animations draft, and I think are more understandable separate
(play-in and play-during animations), and define the logical converse
of current Animations

> Additionally I would like to know how that will work in this use case:
>
> .foo {
>    // some animation for "play-out"
> }
>
> .bar {
>    // some animation for "play-in"
> }
>
>
> document.getElementsByClassName("foo")[0].className = "bar";
>
> Which animation will play and why?

Assuming that .foo and .bar are the only things adding animations to
the given element, it will work exactly as you'd expect.  Both
animations will run, as you're losing the play-out animation (since it
no longer matches .foo) and gaining the play-in animation (as it
didn't match .bar before, but now does).

(If animations are coming from other sources, then things may be more
complicated, in exactly the way the current Animations draft sometimes
is.  If the element has the same play-in animation as the .bar rule
from some other source, then it isn't *gaining* the animation (it
already had it), and so nothing happens.  Again, this is exactly the
behavior the current Animations draft has.)

~TJ

Received on Wednesday, 7 April 2010 21:35:18 UTC