Yep, it's me again
Again I hope there is a more conenient way of doing things.
But I learned my lesson! Here's a codepen: http://codepen.io/katerlouis/pen/JWjPPK
I have looots of lil tweens in a timeline which should have equal position and duration.
Writing these two down for every lil tween isn't just annoying. When you need to update it, it gets even more frustrating.
Regarding the position value, labels are a quite okay solution.
But I find it annoying to type the label at the end of every new tween I add (yes, nitpicky!)
Different story when it comes to the duration value.
Of course I could add a variable somewhere at the beginning. But I'm talking huge animations; always scroll up to the variable when I want to change the value? Annoying. And the code readability suffers with so many durationXY-variables.
And yes, I could make multiple timelines and then call them in a master timeline.
But that's unnecessary clutter-code.
What I imagine is something like this:
tl = new TimelineMax();
tl
.to(".someElement", 0.5, { scale: 2 })
.from(".someOther", 2, { rotation: 90 }, "+=1")
// a group would somehow just append to the main timeline
// or we call it .sameDurPos() D:
.group(5, "-=0.5", function() {
// .to, .from etc. would need to be overwritten
// this.to(...) would call tl.to() and mix it with the .group() parameters
this.to(".box1", { ...animation properties... }); // does this. even make sense? 8)
this.from(".box2", { ...animation properties... });
this.fromTo(".box3", { ...animation properties... }, { ...animation properties... });
this.staggerTo(".box3 span", { ... }, 0.5);
})
.to(".justGoOn", 2, { ... }, "labeeeel")
;
I am just looking for ways to focus more on the concepts behind the animation and less on the actual code.
And as awesome as GSAP is (and it is, .. jeez) I find that some things feel unnatural.
Is there a way to enhance the TweenMax object with own functions? So maybe I'm dope enough to implement my own .group() function 8)