當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript TweenLite.to函數代碼示例

本文整理匯總了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]
    });
}
開發者ID:martin-fabbri,項目名稱:greensock-playground,代碼行數:26,代碼來源:main.ts

示例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});




開發者ID:martin-fabbri,項目名稱:greensock-playground,代碼行數:17,代碼來源:basic-tween.ts

示例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
開發者ID:martin-fabbri,項目名稱:greensock-playground,代碼行數:31,代碼來源:css-transforms.ts

示例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});


開發者ID:martin-fabbri,項目名稱:greensock-playground,代碼行數:14,代碼來源:main.ts


注:本文中的TweenLite.to函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。