[dojo-contributors] dojo.fx.lite

Scott J. Miles sjmiles at turbophp.com
Mon Apr 24 01:35:12 EDT 2006


I don't know, seems like what was originally proposed made a lot of sense to
me. It's at once simple and powerful. You can create an animation, you can
create a chain of animations, you can create a combination of animations.
Any one of those operations results in an object that can itself be
chained/combined/played, or saved for later.
 
Looked to me like Bryan kicked butt, and I was perfectly happy with that
concept. I'm not sure how we ended up all going different directions (and
doubtless triggering Dylan's noise-o-meter =P).
 
>> 2.  I don't see any reason for new object constructors in order to make
this work; its just additional overhead when what we'd really want is to
keep it light and simple.
 
There are many ways of skinning this syntactical cat. I really don't care if
the workers in question are static functions, constructors, or methods of
animation objects. I just want a unified syntax. 
 
>> anim1.play(); anim2.play(); anim3.play(); ...and let it rest.  In which
case Combine is unnecessary (and I'd be in favor of dropping). 
 
Unless you want to chain that combination with another. Seems like you are
tossing out the baby with the bathwater.
 
>> [Sandro] Also, the meaning of "combine" is not obvious
 
Agreed, but IMO the proposed alternatives are not improvements. If we can
find a better simple verb that's great, otherwise, I think people will be
able to figure out "combine".
 
Regards,
Scott J. Miles
TurboAjax Group
HYPERLINK "http://www.turboajax.com"http://www.turboajax.com


   _____  

From: dojo-contributors-bounces at dojotoolkit.org
[mailto:dojo-contributors-bounces at dojotoolkit.org] On Behalf Of Tom Trenka
Sent: Sunday, April 23, 2006 9:04 PM
To: dojo dev.
Subject: Re: [dojo-contributors] dojo.fx.lite


After helping Bryan with the code, I would definitely say 2 things here:

1. Chain and combine really are two separate things. Take this example:

anim1.chain(anim2, anim3.chain(anim5), anim4).play()

which would play the following, in order: 

anim1 --> anim2
          anim3 --> anim5
          anim4

(note that none of these animations need to be the same duration, the key is
chaining them effectively)

Effectively, this gives you both chain and combine.  The reason for the
combine (Bryan, correct me if I'm wrong) was if you wanted to start several
animations at once. 

2.  I don't see any reason for new object constructors in order to make this
work; its just additional overhead when what we'd really want is to keep it
light and simple.

---
...so then the real question here is how does one set up a set of animations
to begin at once?  Or do we even bother, since you can always do: 

anim1.play();
anim2.play();
anim3.play();

...and let it rest.  In which case Combine is unnecessary (and I'd be in
favor of dropping).

trt


On 4/23/06, Sandro Magi <HYPERLINK
"mailto:smagi at naasking.homeip.net"smagi at naasking.homeip.net> wrote: 

Scott J. Miles wrote:
>>> var comb = new dojo.fx.lite.Combine(anim1, anim2, anim3); comb.play();
>>> anim1.chain(anim2.chain(anim3)).play();
>
> I suggest we just have one syntax for combining/chaining. i.e.:
>
> new dojo.fx.Combine(anim1, anim2, anim3).play();
> new dojo.fx.Chain(anim1, anim2, anim3).play();

Just jumping in the middle here, but a chain/sequence of animations is
fundamentally a new animation. So why not just: 

new dojo.fx.Animation(anim1, anim2, anim3).play();

Also, the meaning of "combine" is not obvious, so why not use a familiar
word which makes the intent more apparent:

new dojo.fx.Parallel (anim1, anim2, anim3).play();
OR
new dojo.fx.Concurrent(anim1, anim2, anim3).play();

Or perhaps:

new dojo.fx.Player(anim1, anim2, anim3).play();

Although this last might be confused with the "playlist" concept, which 
is equivalent to a "chain" of animations.

Combining the two removes the ambiguity at the cost of additional
characters:

new dojo.fx.ConcurrentPlayer(anim1, anim2, anim3).play();
new dojo.fx.ParallelPlayer (anim1, anim2, anim3).play();

Sandro

> a complex example might look like this:
>
> new dojo.fx.Combine(anim1, new dojo.fx.Chain(new dojo.fx.Combine(anim2,
> anim2b), anim3), anim4).play(); 
>
> Parallelism helps memory-challenged individuals like myself.
>
> Regards,
> Scott J. Miles
> TurboAjax Group
> HYPERLINK "http://www.turboajax.com"http://www.turboajax.com 
>
> -----Original Message-----
> From: HYPERLINK
"mailto:dojo-contributors-bounces at dojotoolkit.org"dojo-contributors-bounces@
dojotoolkit.org
> [mailto:HYPERLINK "mailto:dojo-contributors-bounces at dojotoolkit.org"
dojo-contributors-bounces at dojotoolkit.org] On Behalf Of Bryan Forbes
> Sent: Friday, April 21, 2006 8:26 AM
> To: dojo dev.
> Subject: [dojo-contributors] dojo.fx.lite
>
> Dear fellow developers, 
>      About 2 or 3 weeks ago, I was charged with the task (ok, I took the
> task on voluntarily) of coming up with a lite version of our animation
> library.  Attached is what I have come up with after consulting both Alex 
> and Tom.  I have tried to make this as powerful as possible, while keeping
> the syntax simple.  With the help of Dan Pupius (through Alex), I have
also
> added some simple easing functions to this animation library and I've
tried 
> to make it easy to use your own easing functions.  The real workhorse of
> this animation library is dojo.fx.lite.propertyAnimation.  The syntax is
as
> follows:
>
> dojo.fx.lite.propertyAnimation ([
>       { property: /*String naming the property to change*/ prop,
>         node: /*DOMNode*/ node,
>         handlers: /*Object of event functions*/ handlers,
>         start: /*starting value*/ start, 
>         end: /*ending value*/ end,
>         units: /*String (defaults to "px")*/ units,
>         curve: /*an optional curve object*/,
>         repeatCount: /*int*/,
>         rate: /*int*/ }, ...], 
>       duration, easing);
>
>      For an example of how this is used, check out dojo.fx.lite.fadeIn or
> any of the other animations defined in lite.js.
>
>      One other thing I have included is the ability to easily combine and 
> chain animations together.  Basically, it is as follows:
>
> To combine two or more animations together:
> var comb = new dojo.fx.lite.Combine(anim1, anim2, anim3); comb.play();
>
> To chain (play one after another) animations together: 
> anim1.chain(anim2.chain(anim3)).play();
>
> To combine with a chain:
> anim1.chain(anim2, anim3.chain(anim4)).play();
>
> The last one will play the animations in this order:
> anim1 -> anim2 + (anim3 -> anim4) 
>
>      Both combine and chain can take either a Combine or an Animation so
> there is no need to convert from one to another.  Please take a look at
this
> and let me know what you think.  There is a working demo at 
> HYPERLINK
"http://www.reigndropsfall.net/fx.lite/test.html"http://www.reigndropsfall.n
et/fx.lite/test.html.  As you can see, this only
> pulls in 8 files (excluding fx/lite.js and fx/lite/Animation.js).
>      Another thing that need to be discussed is a new namespace for
> dojo.fx.lite (since that's not a very lite namespace).  Alex suggested to
me
> dojo.ngfx (for Next Generation FX) or dojo.lfx.  I was thinking dojo.lx,
but
> I'd like to hear some more ideas.  Anyway, take a look at the code I have
> attached (the .zip should be extracted into src/fx) give me some feedback.
> Thanks!
>
> -Bryan Forbes 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.5/322 - Release Date: 4/22/2006
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20060423/6083391f/attachment.htm 


More information about the dojo-contributors mailing list