本文整理匯總了TypeScript中TweenLite.to函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript to函數的具體用法?TypeScript to怎麽用?TypeScript to使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了to函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
const startTween = ()=> {
const initialDelay = 1;
TweenLite.to($robust, 1, {
x: 200,
y: 225,
//rotation: 90,
//rotationX: 180,
rotationY: 180,
alpha: 0.2,
//height: 200
scale: 4,
delay: initialDelay,
onComplete: returnToNormal,
onCompleteParams: [$robust]
});
TweenLite.to($header, 1, {
color: '#ff0000',
fontSize: '+=10',
delay: initialDelay + 0.5,
onComplete: textReturnToNormal,
onCompleteParams: [$header]
});
}
示例2:
/// <reference path="../../typings/main/ambient/TweenLite/TweenLite.d.ts" />
/// <reference path="../../typings/main/ambient/TimelineLite/TimelineLite.d.ts" />
import * as TweenLite from 'TweenLite';
import * as TimelineLite from 'TimelineLite';
import 'CSSPlugin';
// logo1 animation
TweenLite.to('#logo1', 10, {
left: 600,
backgroundColor: 'red',
padding: 20,
borderColor: 'white',
borderRadius: 26
});
// logo2 animation
TweenLite.to('#logo2', 10, {x: 300});
示例3:
/// <reference path="../../typings/main/ambient/TweenLite/TweenLite.d.ts" />
/// <reference path="../../typings/main/ambient/TimelineLite/TimelineLite.d.ts" />
import * as TweenLite from 'TweenLite';
import * as TimelineLite from 'TimelineLite';
import 'CSSPlugin';
import 'EasePack';
// logo1 animation
TweenLite.to('#logo1', 6, {
x: 600,
rotation: 360,
scale: 0.5,
ease: Back.easeOut
});
// logo2 animation
TweenLite.to('#logo2', 2, {
x: 300,
ease: Back.easeOut
});
// logo3 animation
TweenLite.to('#logo3', 2, {
x: 300,
ease: Elastic.easeOut
});
// logo4 animation
TweenLite.to('#logo4', 2, {
x: 300,
ease: Bounce.easeOut
示例4:
/// <reference path="../../typings/main/ambient/TweenMax/TweenMax.d.ts" />
/// <reference path="../../typings/main/ambient/TweenLite/TweenLite.d.ts" />
/// <reference path="../../typings/main/ambient/TimelineLite/TimelineLite.d.ts" />
import 'TweenLite';
import 'CSSPlugin';
import 'AttrPlugin';
import * as TweenLite from 'TweenLite';
CSSPlugin.defaultSmoothOrigin = false;
TweenLite.to('#cards', 1, {rotation: 180});
//TweenLite.to('#cards', 1, {scale: 2});
//TweenLite.to('#cards', 1, {rotation: 360, transformOrigin: "center center", delay: 2});