var tomato = $('#tomato'),bracketRight = $('.bracketRight'),bracketLeft = $('.bracketLeft'),tomatoLeft = $('.tomatoLeft'),tomatoRight = $('.tomatoRight') 、 tomatoLeaves = $('.tomatoLeaves')、字母= $('#ihtText 路徑')、$btnPlay = $('#btnPlay')、$btnSlowMo = $('#btnSlowMo')、$btnReverse = $(' #btnReverse'), tl;
tl = new TimelineMax();
tl.set([tomatoLeft], { xPercent: 23.6 });
tl.set([tomatoLeaves], { xPercent: 41 });
tl.set([番茄], {
x百分比:2,
旋轉:13,
變換原點:'中心中心'
});
tl.set(番茄, { yPercent: -200 });
tl.set(bracketRight, { xPercent: 200 });
tl.set(bracketLeft, { xPercent: -200 });
tl.to([
括號右,
括號左
], 0.3, {
x百分比:0,
緩和:Power4.easeOut
}, 0.5).to(番茄, 0.5, {
y百分比:0,
緩和:Bounce.easeOut
}).to(番茄, 0.2, {
旋轉:0,
x百分比:-4
}).to([
番茄左,
番茄葉
], 0.2, { xPercent: 0 }, '分割').to(番茄, 0.2, {
旋轉:0,
x百分比:0
}, 'split').to(tomatoRight, 0.2, { xPercent: 2 }, 'split').staggerFrom(letters, 0.01, { autoAlpha: 0 }, 0.03).add('end');
$btnPlay.click(function () {
tl.timeScale(1).seek(0);
});
$btnSlowMo.click(function () {
tl.timeScale(0.2).seek(0.5);
});
$btnReverse.click(function () {
tl.timeScale(1).seek('end').reverse();
});
//@sourceURL=pen.js
腳本>