本文整理汇总了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});