├── .babelrc
├── .editorconfig
├── .gitignore
├── README.md
├── gulp
├── config.js
└── tasks
│ ├── browsersync.js
│ ├── build.js
│ ├── copy.js
│ ├── default.js
│ ├── del.js
│ ├── imagemin.js
│ ├── jade.js
│ ├── javascript.js
│ ├── sass.js
│ ├── watch.js
│ └── webpack.js
├── gulpfile.babel.js
├── package.json
└── project
└── _oridinal
└── develop
├── assets
├── javascripts
│ ├── app.js
│ ├── libraries
│ │ ├── CSSPlugin.min.js
│ │ ├── TimelineLite.js
│ │ ├── TweenLite.js
│ │ ├── jquery.pjax.min.js
│ │ └── jquery.preload.min.js
│ ├── modules
│ │ ├── getQuery.js
│ │ ├── pjax.js
│ │ └── stagger.js
│ └── pages
│ │ ├── about.js
│ │ └── index.js
└── stylesheets
│ ├── application.scss
│ ├── common.scss
│ ├── index.scss
│ ├── layouts.scss
│ ├── libraries
│ ├── mixin.scss
│ └── normalize.scss
│ ├── modules.scss
│ └── smartphone
│ ├── index.scss
│ ├── layouts.scss
│ └── modules.scss
├── resources
└── data.json
└── views
├── about.jade
├── application
├── footer.jade
├── ga.jade
├── header.jade
└── meta.jade
├── index.jade
└── layouts
└── application.jade
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015"]
3 | }
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.html]
12 | indent_style = tab
13 |
14 | [*.md]
15 | trim_trailing_whitespace = false
16 |
17 | [{*.yml,*.yaml}]
18 | trim_trailing_whitespace = false
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | /node_modules/
4 |
5 | /.sass-cache/
6 |
7 | /project/**/public/
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gulp init project
2 |
3 | ## SPEC
4 |
5 | * Jade
6 | * Sass (+Autoprefixer)
7 | * JavaScript Concat & Uglify
8 | * Webpack (Babel+Options, React)
9 | * Imagefile Minify
10 | * BrowserSync
11 | * CLI Argument(--env, --dir)
12 |
13 | ## USAGE
14 |
15 | $ npm install --global gulp
16 | $ cd (project folder)
17 | $ npm install
18 | $ gulp
19 |
20 |
21 | $ gulp --env (development or staging or production) --dir (project directory name)
22 |
23 | ## AUTHOR
24 |
25 | ### Tomoya Otsuka
26 |
27 | I am a Designer.
28 |
29 | * [Portfolio](http://strangr.jp)
30 | * [twitter](https://twitter.com/tomoya_otsuka)
31 | * [Pinterest](http://jp.pinterest.com/tomoyaotsuka/)
32 |
33 | ## LICENSE
34 |
35 | Released under the MIT License: http://www.opensource.org/licenses/MIT
36 |
37 | ## LOG
38 |
39 | ### 20160411
40 |
41 | * EditorConfig
42 |
43 | ### 20160217
44 |
45 | * コマンドライン引数による開発・本番環境とプロジェクトの指定
46 |
47 | ### 20160216
48 |
49 | * JavaScriptライブラリの結合・圧縮
50 | * ビルドタスク追加
51 | * webpackにオプション追加(モジュールの重複回避、圧縮)
52 | * デフォルトテンプレートのアップデート
53 |
54 | ### 20151211
55 |
56 | * Jadeの継承などを含み、テンプレートをアップデート
57 |
58 | ### 20151210
59 |
60 | * Add del
61 | * Add gulp-watch(ファイルの新規追加も監視下)
62 | * Add gulp-postcss&css-mqpacker(メディアクエリに関する記述を一元化)
63 | * Add run-sequence(デフォルトの[gulp]タスクを直列/並列化)
64 |
65 | ### 20151209
66 |
67 | * 画像圧縮のキャッシュがディレクトリ配下の同名ファイルにまで及んでしまうため、gulp-cacheからgulp-newerに変更
68 |
69 | ### 20151110
70 |
71 | * npmをアップデート
72 | * gulpfileの書式をBabelに変更
73 | * EJSからJadeへ変更
74 | * ディレクトリ構造を見直し
75 |
76 | ### 20150518
77 |
78 | * First commit
79 |
--------------------------------------------------------------------------------
/gulp/config.js:
--------------------------------------------------------------------------------
1 | import minimist from 'minimist';
2 | import webpack from 'webpack';
3 |
4 | const minimistOption = {
5 | string: [ 'env', 'dir' ],
6 | default: {
7 | env: 'development',
8 | dir: '_oridinal'
9 | }
10 | };
11 | const options = minimist(process.argv.slice(2), minimistOption);
12 | const src = `./project/${options.dir}/develop`;
13 | const dest = `./project/${options.dir}/public`;
14 |
15 | let isProduction = false;
16 | if ( options.env == 'production' ) {
17 | isProduction = true;
18 | }
19 |
20 | module.exports = {
21 |
22 | src: src,
23 | dest: dest,
24 |
25 | isProduction: isProduction,
26 |
27 | jade: {
28 | src: [ `${src}/views/**/*.jade`, `!${src}/views/application/*.jade`, `!${src}/views/layouts/*.jade` ],
29 | watch: [ `${src}/views/**/*.jade`, `${src}/resources/*.json` ],
30 | json: `${src}/resources/data.json`,
31 | dest: dest
32 | },
33 |
34 | css: {
35 | src: `${src}/assets/stylesheets/application.scss`,
36 | watch: `${src}/assets/stylesheets/**/*.scss`,
37 | dest: `${dest}/assets/stylesheets`
38 | },
39 |
40 | js: {
41 | src: [
42 | `${src}/assets/javascripts/libraries/jquery.pjax.min.js`,
43 | `${src}/assets/javascripts/libraries/jquery.preload.min.js`,
44 | `${src}/assets/javascripts/libraries/jquery.mousewheel.min.js`,
45 | `${src}/assets/javascripts/libraries/pixi.min.js`,
46 | `${src}/assets/javascripts/libraries/three.min.js`,
47 | `${src}/assets/javascripts/libraries/TweenLite.js`,
48 | `${src}/assets/javascripts/libraries/TimelineLite.js`,
49 | `${src}/assets/javascripts/libraries/CSSPlugin.min.js`
50 | ],
51 | dest: `${dest}/assets/javascripts`,
52 | watch: `${src}/assets/javascripts/**/*.js`,
53 | name: 'libraries',
54 | uglify: true
55 | },
56 |
57 | webpack: {
58 | entry: `${src}/assets/javascripts/app.js`,
59 | output: {
60 | filename: 'bundle.js'
61 | },
62 | resolve: {
63 | extensions: ['', '.js']
64 | },
65 | module: {
66 | loaders: [
67 | {
68 | test: /\.js$/,
69 | exclude: /node_modules/,
70 | loader: 'babel',
71 | query: {
72 | cacheDirectory: true
73 | }
74 | }
75 | ]
76 | },
77 | devtool: 'source-map',
78 | plugins: [
79 | new webpack.optimize.DedupePlugin(),
80 | new webpack.optimize.OccurenceOrderPlugin(),
81 | new webpack.optimize.AggressiveMergingPlugin(),
82 | new webpack.optimize.UglifyJsPlugin({minimize: true})
83 | ]
84 | },
85 |
86 | imagemin: {
87 | src: `${src}/assets/images/**/*`,
88 | dest: `${dest}/assets/images/`
89 | },
90 |
91 | copy: {
92 | src: `${src}/assets/javascripts/libraries/**/*.js`,
93 | dest: dest
94 | }
95 | };
96 |
--------------------------------------------------------------------------------
/gulp/tasks/browsersync.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import browserSync from 'browser-sync';
3 | import ordinaryConfig from '../config';
4 |
5 | const config = ordinaryConfig;
6 |
7 |
8 |
9 | gulp.task('bs', () => {
10 | browserSync.init(null, {
11 | server: {
12 | baseDir: config.dest
13 | // proxy: ''
14 | }
15 | });
16 | });
17 |
18 | gulp.task('bsReload', () => {
19 | browserSync.reload();
20 | });
21 |
--------------------------------------------------------------------------------
/gulp/tasks/build.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import runSequence from 'run-sequence';
3 | import ordinaryConfig from '../config';
4 |
5 | const config = ordinaryConfig;
6 |
7 |
8 |
9 | gulp.task('build', (callback) => {
10 | runSequence(
11 | 'del',
12 | ['jade', 'sass', 'webpack', 'javascript', 'imagemin', 'copy'],
13 | callback
14 | );
15 | });
16 |
--------------------------------------------------------------------------------
/gulp/tasks/copy.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import browserSync from 'browser-sync';
4 | import ordinaryConfig from '../config';
5 |
6 | const $ = gulpLoadPlugins();
7 | const config = ordinaryConfig.copy;
8 |
9 |
10 |
11 | gulp.task('copy', () => {
12 | return gulp.src(config.src, { base: ordinaryConfig.src })
13 | .pipe(gulp.dest(config.dest))
14 | .pipe(browserSync.reload({
15 | stream: true,
16 | once: true
17 | }));
18 | });
19 |
--------------------------------------------------------------------------------
/gulp/tasks/default.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import runSequence from 'run-sequence';
3 | import ordinaryConfig from '../config';
4 |
5 | const config = ordinaryConfig;
6 |
7 |
8 |
9 | gulp.task('default', (callback) => {
10 | runSequence(
11 | 'del',
12 | ['jade', 'sass', 'webpack', 'javascript', 'imagemin', 'copy'],
13 | 'bs',
14 | 'watch',
15 | callback
16 | );
17 | });
18 |
--------------------------------------------------------------------------------
/gulp/tasks/del.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import del from 'del';
3 | import ordinaryConfig from '../config';
4 |
5 | const config = ordinaryConfig;
6 |
7 |
8 |
9 | gulp.task('del', del.bind(null, config.dest));
10 |
--------------------------------------------------------------------------------
/gulp/tasks/imagemin.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import ordinaryConfig from '../config';
4 |
5 | const $ = gulpLoadPlugins();
6 | const config = ordinaryConfig.imagemin;
7 |
8 |
9 |
10 | gulp.task('imagemin', () => {
11 | return gulp.src(config.src)
12 | .pipe($.newer(config.dest))
13 | .pipe($.image({
14 | progressive: true,
15 | interlaced: true
16 | }))
17 | .pipe(gulp.dest(config.dest));
18 | });
19 |
--------------------------------------------------------------------------------
/gulp/tasks/jade.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import browserSync from 'browser-sync';
4 | import ordinaryConfig from '../config';
5 |
6 | import fs from 'fs';
7 |
8 | const $ = gulpLoadPlugins();
9 | const config = ordinaryConfig.jade;
10 |
11 |
12 |
13 | gulp.task('jade', () => {
14 | return gulp.src(config.src)
15 | .pipe($.jade({
16 | pretty: true,
17 | data: JSON.parse(fs.readFileSync(config.json))
18 | }))
19 | .pipe(gulp.dest(config.dest))
20 | .pipe(browserSync.reload({
21 | stream: true,
22 | once: true
23 | }));
24 | });
25 |
--------------------------------------------------------------------------------
/gulp/tasks/javascript.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import runSequence from 'run-sequence';
4 | import ordinaryConfig from '../config';
5 |
6 | const $ = gulpLoadPlugins();
7 | const config = ordinaryConfig.js;
8 |
9 |
10 |
11 | gulp.task('javascript', (callback) => {
12 | runSequence(
13 | 'concat',
14 | 'uglify',
15 | callback
16 | );
17 | });
18 |
19 | gulp.task('concat', () => {
20 | return gulp.src(config.src)
21 | .pipe($.concat(config.name+'.js'))
22 | .pipe(gulp.dest(config.dest));
23 | });
24 |
25 | gulp.task('uglify', () => {
26 | return gulp.src(config.dest+'/'+config.name+'.js')
27 | .pipe($.uglify({
28 | preserveComments: 'some'
29 | }))
30 | .pipe($.rename(config.name+'.min.js'))
31 | .pipe(gulp.dest(config.dest));
32 | });
33 |
--------------------------------------------------------------------------------
/gulp/tasks/sass.js:
--------------------------------------------------------------------------------
1 | require('es6-promise').polyfill();
2 |
3 | import gulp from 'gulp';
4 | import gulpLoadPlugins from 'gulp-load-plugins';
5 | import browserSync from 'browser-sync';
6 | import ordinaryConfig from '../config';
7 |
8 | import sass from 'gulp-ruby-sass';
9 |
10 | const $ = gulpLoadPlugins();
11 | const config = ordinaryConfig.css;
12 |
13 |
14 |
15 | gulp.task('sass', () => {
16 | return sass(config.src)
17 | .on('error', sass.logError)
18 | .pipe($.pleeease({
19 | autoprefixer: {
20 | browsers: ["last 4 versions"]
21 | }
22 | }))
23 | .pipe($.postcss([
24 | require('css-mqpacker')
25 | ]))
26 | .pipe(gulp.dest(config.dest))
27 | .pipe(browserSync.reload({
28 | stream: true,
29 | once: true
30 | }));
31 | });
32 |
--------------------------------------------------------------------------------
/gulp/tasks/watch.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import ordinaryConfig from '../config';
4 |
5 | const $ = gulpLoadPlugins();
6 | const config = ordinaryConfig;
7 |
8 |
9 |
10 | gulp.task('watch', () => {
11 | $.watch(config.jade.watch, (event) => {
12 | gulp.start('jade');
13 | });
14 | $.watch(config.css.watch, (event) => {
15 | gulp.start('sass');
16 | });
17 | $.watch(config.js.watch, (event) => {
18 | gulp.start('webpack');
19 | });
20 | $.watch(config.js.src, (event) => {
21 | gulp.start('javascript');
22 | });
23 | $.watch(config.copy.src, (event) => {
24 | gulp.start('copy');
25 | });
26 | $.watch(config.imagemin.src, (event) => {
27 | gulp.start('imagemin');
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/gulp/tasks/webpack.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp';
2 | import gulpLoadPlugins from 'gulp-load-plugins';
3 | import browserSync from 'browser-sync';
4 | import ordinaryConfig from '../config';
5 |
6 | const $ = gulpLoadPlugins();
7 | const config = ordinaryConfig;
8 |
9 |
10 | gulp.task('webpack', () => {
11 | gulp.src(config.webpack.entry)
12 | .pipe($.webpack(config.webpack))
13 | .pipe(gulp.dest(config.js.dest))
14 | .on('end', () => {
15 | gulp.src(config.js.dest + '/' + config.webpack.output.filename)
16 | .pipe($.if(config.js.uglify, $.uglify()))
17 | .pipe(gulp.dest(config.js.dest))
18 | .pipe(browserSync.reload({
19 | stream: true,
20 | once: true
21 | }));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/gulpfile.babel.js:
--------------------------------------------------------------------------------
1 | import requireDir from 'require-dir';
2 |
3 | requireDir('./gulp/tasks', { recurse: true });
4 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gulp-starter",
3 | "version": "0.0.1",
4 | "description": "",
5 | "main": "assets/javascripts/app.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "Tomoya Otsuka",
10 | "license": "MIT",
11 | "devDependencies": {
12 | "babel": "^6.0.15",
13 | "babel-core": "^6.1.2",
14 | "babel-loader": "^6.0.1",
15 | "babel-preset-es2015": "^6.1.2",
16 | "browser-sync": "^2.7.1",
17 | "css-mqpacker": "^4.0.0",
18 | "del": "^2.2.0",
19 | "es6-promise": "^3.0.2",
20 | "gulp": "~3.9.0",
21 | "gulp-concat": "^2.6.0",
22 | "gulp-if": "~2.0.0",
23 | "gulp-image": "^1.1.1",
24 | "gulp-jade": "^1.1.0",
25 | "gulp-load-plugins": "^1.1.0",
26 | "gulp-newer": "^1.1.0",
27 | "gulp-notify": "^2.2.0",
28 | "gulp-pleeease": "^2.0.1",
29 | "gulp-plumber": "^1.0.0",
30 | "gulp-postcss": "^6.0.1",
31 | "gulp-rename": "^1.2.2",
32 | "gulp-ruby-sass": "^2.0.5",
33 | "gulp-uglify": "~1.4.2",
34 | "gulp-watch": "^4.3.5",
35 | "gulp-webpack": "~1.5.0",
36 | "gulp-webserver": "^0.9.0",
37 | "jade": "^1.11.0",
38 | "minimist": "^1.2.0",
39 | "require-dir": "~0.3.0",
40 | "run-sequence": "^1.1.5",
41 | "webpack": "^1.12.13"
42 | },
43 | "dependencies": {
44 | "babel-runtime": "^6.0.14",
45 | "react": "^0.14.2"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/project/_oridinal/develop/assets/javascripts/app.js:
--------------------------------------------------------------------------------
1 | import pjax from './modules/pjax';
2 | import getQuery from './modules/getQuery';
3 | import stagger from './modules/stagger';
4 | import index from './pages/index';
5 | import about from './pages/about';
6 |
7 |
8 | $(function() {
9 | var init = new Init();
10 | init.on($('.inside').attr('id'));
11 |
12 | new pjax(init);
13 | });
14 |
15 |
16 | class Init {
17 |
18 | /**
19 | * 全ページ共通設定
20 | * @constructor
21 | **/
22 |
23 | constructor() {
24 | }
25 |
26 | /**
27 | * 各ページで起動する関数
28 | * @switch
29 | **/
30 |
31 | on(target) {
32 |
33 | switch (target) {
34 | case 'index':
35 | new index();
36 | return;
37 | case 'about':
38 | new about();
39 | return;
40 | default :
41 | return;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/project/_oridinal/develop/assets/javascripts/libraries/CSSPlugin.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 1.17.0
3 | * DATE: 2015-05-27
4 | * UPDATES AND DOCS AT: http://greensock.com
5 | *
6 | * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://greensock.com/standard-license or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,r,s,n,a=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=a.prototype.setRatio},o=_gsScope._gsDefine.globals,l={},h=a.prototype=new t("css");h.constructor=a,a.version="1.17.0",a.API=2,a.defaultTransformPerspective=0,a.defaultSkewType="compensated",a.defaultSmoothOrigin=!0,h="px",a.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var u,f,c,p,_,d,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,g=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,v=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,y=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,x=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,b=/alpha\(opacity *=.+?\)/i,P=/^(rgb|hsl)/,S=/([A-Z])/g,O=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,C=function(t,e){return e.toUpperCase()},R=/(?:Left|Right|Width)/i,A=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,M=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,D=/,(?=[^\)]*(?:\(|$))/gi,N=Math.PI/180,L=180/Math.PI,F={},X=document,z=function(t){return X.createElementNS?X.createElementNS("http://www.w3.org/1999/xhtml",t):X.createElement(t)},B=z("div"),E=z("img"),I=a._internals={_specialProps:l},Y=navigator.userAgent,W=function(){var t=Y.indexOf("Android"),e=z("a");return c=-1!==Y.indexOf("Safari")&&-1===Y.indexOf("Chrome")&&(-1===t||Number(Y.substr(t+8,1))>3),_=c&&6>Number(Y.substr(Y.indexOf("Version/")+8,1)),p=-1!==Y.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Y)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Y))&&(d=parseFloat(RegExp.$1)),e?(e.style.cssText="top:1px;opacity:.55;",/^0.55/.test(e.style.opacity)):!1}(),V=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},j=function(t){window.console&&console.log(t)},G="",U="",q=function(t,e){e=e||B;var i,r,s=e.style;if(void 0!==s[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],r=5;--r>-1&&void 0===s[i[r]+t];);return r>=0?(U=3===r?"ms":i[r],G="-"+U.toLowerCase()+"-",U+t):null},H=X.defaultView?X.defaultView.getComputedStyle:function(){},Q=a.getStyle=function(t,e,i,r,s){var n;return W||"opacity"!==e?(!r&&t.style[e]?n=t.style[e]:(i=i||H(t))?n=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(S,"-$1").toLowerCase()):t.currentStyle&&(n=t.currentStyle[e]),null==s||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:s):V(t)},Z=I.convertToPixels=function(t,i,r,s,n){if("px"===s||!s)return r;if("auto"===s||!r)return 0;var o,l,h,u=R.test(i),f=t,c=B.style,p=0>r;if(p&&(r=-r),"%"===s&&-1!==i.indexOf("border"))o=r/100*(u?t.clientWidth:t.clientHeight);else{if(c.cssText="border:0 solid red;position:"+Q(t,"position")+";line-height:0;","%"!==s&&f.appendChild)c[u?"borderLeftWidth":"borderTopWidth"]=r+s;else{if(f=t.parentNode||X.body,l=f._gsCache,h=e.ticker.frame,l&&u&&l.time===h)return l.width*r/100;c[u?"width":"height"]=r+s}f.appendChild(B),o=parseFloat(B[u?"offsetWidth":"offsetHeight"]),f.removeChild(B),u&&"%"===s&&a.cacheWidths!==!1&&(l=f._gsCache=f._gsCache||{},l.time=h,l.width=100*(o/r)),0!==o||n||(o=Z(t,i,r,s,!0))}return p?-o:o},$=I.calculateOffset=function(t,e,i){if("absolute"!==Q(t,"position",i))return 0;var r="left"===e?"Left":"Top",s=Q(t,"margin"+r,i);return t["offset"+r]-(Z(t,e,parseFloat(s),s.replace(x,""))||0)},K=function(t,e){var i,r,s,n={};if(e=e||H(t,null))if(i=e.length)for(;--i>-1;)s=e[i],(-1===s.indexOf("-transform")||Pe===s)&&(n[s.replace(O,C)]=e.getPropertyValue(s));else for(i in e)(-1===i.indexOf("Transform")||be===i)&&(n[i]=e[i]);else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===n[i]&&(n[i.replace(O,C)]=e[i]);return W||(n.opacity=V(t)),r=Xe(t,e,!1),n.rotation=r.rotation,n.skewX=r.skewX,n.scaleX=r.scaleX,n.scaleY=r.scaleY,n.x=r.x,n.y=r.y,Oe&&(n.z=r.z,n.rotationX=r.rotationX,n.rotationY=r.rotationY,n.scaleZ=r.scaleZ),n.filters&&delete n.filters,n},J=function(t,e,i,r,s){var n,a,o,l={},h=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||s&&s[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(l[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(y,"")?n:0:$(t,a),void 0!==h[a]&&(o=new pe(h,a,h[a],o)));if(r)for(a in r)"className"!==a&&(l[a]=r[a]);return{difs:l,firstMPT:o}},te={width:["Left","Right"],height:["Top","Bottom"]},ee=["marginLeft","marginRight","marginTop","marginBottom"],ie=function(t,e,i){var r=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),s=te[e],n=s.length;for(i=i||H(t,null);--n>-1;)r-=parseFloat(Q(t,"padding"+s[n],i,!0))||0,r-=parseFloat(Q(t,"border"+s[n]+"Width",i,!0))||0;return r},re=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),r=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],s=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==s?s="center"===r?"50%":"0":"center"===s&&(s="50%"),("center"===r||isNaN(parseFloat(r))&&-1===(r+"").indexOf("="))&&(r="50%"),t=r+" "+s+(i.length>2?" "+i[2]:""),e&&(e.oxp=-1!==r.indexOf("%"),e.oyp=-1!==s.indexOf("%"),e.oxr="="===r.charAt(1),e.oyr="="===s.charAt(1),e.ox=parseFloat(r.replace(y,"")),e.oy=parseFloat(s.replace(y,"")),e.v=t),e||t},se=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},ne=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)},ae=function(t,e,i,r){var s,n,a,o,l,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(s=360,n=t.split("_"),l="="===t.charAt(1),a=(l?parseInt(t.charAt(0)+"1",10)*parseFloat(n[0].substr(2)):parseFloat(n[0]))*(-1===t.indexOf("rad")?1:L)-(l?0:e),n.length&&(r&&(r[i]=e+a),-1!==t.indexOf("short")&&(a%=s,a!==a%(s/2)&&(a=0>a?a+s:a-s)),-1!==t.indexOf("_cw")&&0>a?a=(a+9999999999*s)%s-(0|a/s)*s:-1!==t.indexOf("ccw")&&a>0&&(a=(a-9999999999*s)%s-(0|a/s)*s)),o=e+a),h>o&&o>-h&&(o=0),o},oe={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},le=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},he=a.parseColor=function(t){var e,i,r,s,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),oe[t]?oe[t]:"#"===t.charAt(0)?(4===t.length&&(e=t.charAt(1),i=t.charAt(2),r=t.charAt(3),t="#"+e+e+i+i+r+r),t=parseInt(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),s=Number(t[0])%360/360,n=Number(t[1])/100,a=Number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=Number(t[3])),t[0]=le(s+1/3,e,i),t[1]=le(s,e,i),t[2]=le(s-1/3,e,i),t):(t=t.match(m)||oe.transparent,t[0]=Number(t[0]),t[1]=Number(t[1]),t[2]=Number(t[2]),t.length>3&&(t[3]=Number(t[3])),t)):oe.black},ue="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(h in oe)ue+="|"+h+"\\b";ue=RegExp(ue+")","gi");var fe=function(t,e,i,r){if(null==t)return function(t){return t};var s,n=e?(t.match(ue)||[""])[0]:"",a=t.split(n).join("").match(v)||[],o=t.substr(0,t.indexOf(a[0])),l=")"===t.charAt(t.length-1)?")":"",h=-1!==t.indexOf(" ")?" ":",",u=a.length,f=u>0?a[0].replace(m,""):"";return u?s=e?function(t){var e,c,p,_;if("number"==typeof t)t+=f;else if(r&&D.test(t)){for(_=t.replace(D,"|").split("|"),p=0;_.length>p;p++)_[p]=s(_[p]);return _.join(",")}if(e=(t.match(ue)||[n])[0],c=t.split(e).join("").match(v)||[],p=c.length,u>p--)for(;u>++p;)c[p]=i?c[0|(p-1)/2]:a[p];return o+c.join(h)+h+e+l+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,n,c;if("number"==typeof t)t+=f;else if(r&&D.test(t)){for(n=t.replace(D,"|").split("|"),c=0;n.length>c;c++)n[c]=s(n[c]);return n.join(",")}if(e=t.match(v)||[],c=e.length,u>c--)for(;u>++c;)e[c]=i?e[0|(c-1)/2]:a[c];return o+e.join(h)+l}:function(t){return t}},ce=function(t){return t=t.split(","),function(e,i,r,s,n,a,o){var l,h=(i+"").split(" ");for(o={},l=0;4>l;l++)o[t[l]]=h[l]=h[l]||h[(l-1)/2>>0];return s.parse(e,o,n,a)}},pe=(I._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,r,s,n=this.data,a=n.proxy,o=n.firstMPT,l=1e-6;o;)e=a[o.v],o.r?e=Math.round(e):l>e&&e>-l&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if(i=o.t,i.type){if(1===i.type){for(s=i.xs0+i.s+i.xs1,r=1;i.l>r;r++)s+=i["xn"+r]+i["xs"+(r+1)];i.e=s}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,r,s){this.t=t,this.p=e,this.v=i,this.r=s,r&&(r._prev=this,this._next=r)}),_e=(I._parseToProxy=function(t,e,i,r,s,n){var a,o,l,h,u,f=r,c={},p={},_=i._transform,d=F;for(i._transform=null,F=e,r=u=i.parse(t,e,r,s),F=d,n&&(i._transform=_,f&&(f._prev=null,f._prev&&(f._prev._next=null)));r&&r!==f;){if(1>=r.type&&(o=r.p,p[o]=r.s+r.c,c[o]=r.s,n||(h=new pe(r,"s",o,h,r.r),r.c=0),1===r.type))for(a=r.l;--a>0;)l="xn"+a,o=r.p+"_"+l,p[o]=r.data[l],c[o]=r[l],n||(h=new pe(r,l,o,h,r.rxp[l]));r=r._next}return{proxy:c,end:p,firstMPT:h,pt:u}},I.CSSPropTween=function(t,e,r,s,a,o,l,h,u,f,c){this.t=t,this.p=e,this.s=r,this.c=s,this.n=l||e,t instanceof _e||n.push(this.n),this.r=h,this.type=o||0,u&&(this.pr=u,i=!0),this.b=void 0===f?r:f,this.e=void 0===c?r+s:c,a&&(this._next=a,a._prev=this)}),de=function(t,e,i,r,s,n){var a=new _e(t,e,i,r-i,s,-1,n);return a.b=i,a.e=a.xs0=r,a},me=a.parseComplex=function(t,e,i,r,s,n,a,o,l,h){i=i||n||"",a=new _e(t,e,0,0,a,h?2:1,null,!1,o,i,r),r+="";var f,c,p,_,d,v,y,x,T,w,b,S,O=i.split(", ").join(",").split(" "),k=r.split(", ").join(",").split(" "),C=O.length,R=u!==!1;for((-1!==r.indexOf(",")||-1!==i.indexOf(","))&&(O=O.join(" ").replace(D,", ").split(" "),k=k.join(" ").replace(D,", ").split(" "),C=O.length),C!==k.length&&(O=(n||"").split(" "),C=O.length),a.plugin=l,a.setRatio=h,f=0;C>f;f++)if(_=O[f],d=k[f],x=parseFloat(_),x||0===x)a.appendXtra("",x,se(d,x),d.replace(g,""),R&&-1!==d.indexOf("px"),!0);else if(s&&("#"===_.charAt(0)||oe[_]||P.test(_)))S=","===d.charAt(d.length-1)?"),":")",_=he(_),d=he(d),T=_.length+d.length>6,T&&!W&&0===d[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(k[f]).join("transparent")):(W||(T=!1),a.appendXtra(T?"rgba(":"rgb(",_[0],d[0]-_[0],",",!0,!0).appendXtra("",_[1],d[1]-_[1],",",!0).appendXtra("",_[2],d[2]-_[2],T?",":S,!0),T&&(_=4>_.length?1:_[3],a.appendXtra("",_,(4>d.length?1:d[3])-_,S,!1)));else if(v=_.match(m)){if(y=d.match(g),!y||y.length!==v.length)return a;for(p=0,c=0;v.length>c;c++)b=v[c],w=_.indexOf(b,p),a.appendXtra(_.substr(p,w-p),Number(b),se(y[c],b),"",R&&"px"===_.substr(w+b.length,2),0===c),p=w+b.length;a["xs"+a.l]+=_.substr(p)}else a["xs"+a.l]+=a.l?" "+_:_;if(-1!==r.indexOf("=")&&a.data){for(S=a.xs0+a.data.s,f=1;a.l>f;f++)S+=a["xs"+f]+a.data["xn"+f];a.e=S+a["xs"+f]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},ge=9;for(h=_e.prototype,h.l=h.pr=0;--ge>0;)h["xn"+ge]=0,h["xs"+ge]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,r,s,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=r||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=s,a["xn"+o]=e,a.plugin||(a.xfirst=new _e(a,"xn"+o,e,i,a.xfirst||a,0,a.n,s,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=s,a)):(a["xs"+o]+=e+(r||""),a)};var ve=function(t,e){e=e||{},this.p=e.prefix?q(t)||t:t,l[t]=l[this.p]=this,this.format=e.formatter||fe(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},ye=I._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var r,s,n=t.split(","),a=e.defaultValue;for(i=i||[a],r=0;n.length>r;r++)e.prefix=0===r&&e.prefix,e.defaultValue=i[r]||a,s=new ve(n[r],e)},xe=function(t){if(!l[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";ye(t,{parser:function(t,i,r,s,n,a,h){var u=o.com.greensock.plugins[e];return u?(u._cssRegister(),l[r].parse(t,i,r,s,n,a,h)):(j("Error: "+e+" js file not loaded."),n)}})}};h=ve.prototype,h.parseComplex=function(t,e,i,r,s,n){var a,o,l,h,u,f,c=this.keyword;if(this.multi&&(D.test(i)||D.test(e)?(o=e.replace(D,"|").split("|"),l=i.replace(D,"|").split("|")):c&&(o=[e],l=[i])),l){for(h=l.length>o.length?l.length:o.length,a=0;h>a;a++)e=o[a]=o[a]||this.dflt,i=l[a]=l[a]||this.dflt,c&&(u=e.indexOf(c),f=i.indexOf(c),u!==f&&(-1===f?o[a]=o[a].split(c).join(""):-1===u&&(o[a]+=" "+c)));e=o.join(", "),i=l.join(", ")}return me(t,this.p,e,i,this.clrs,this.dflt,r,this.pr,s,n)},h.parse=function(t,e,i,r,n,a){return this.parseComplex(t.style,this.format(Q(t,this.p,s,!1,this.dflt)),this.format(e),n,a)},a.registerSpecialProp=function(t,e,i){ye(t,{parser:function(t,r,s,n,a,o){var l=new _e(t,s,0,0,a,2,s,!1,i);return l.plugin=o,l.setRatio=e(t,r,n._tween,s),l},priority:i})},a.useSVGTransformAttr=c||p;var Te,we="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),be=q("transform"),Pe=G+"transform",Se=q("transformOrigin"),Oe=null!==q("perspective"),ke=I.Transform=function(){this.perspective=parseFloat(a.defaultTransformPerspective)||0,this.force3D=a.defaultForce3D!==!1&&Oe?a.defaultForce3D||"auto":!1},Ce=window.SVGElement,Re=function(t,e,i){var r,s=X.createElementNS("http://www.w3.org/2000/svg",t),n=/([a-z])([A-Z])/g;for(r in i)s.setAttributeNS(null,r.replace(n,"$1-$2").toLowerCase(),i[r]);return e.appendChild(s),s},Ae=X.documentElement,Me=function(){var t,e,i,r=d||/Android/i.test(Y)&&!window.chrome;return X.createElementNS&&!r&&(t=Re("svg",Ae),e=Re("rect",t,{width:100,height:50,x:100}),i=e.getBoundingClientRect().width,e.style[Se]="50% 50%",e.style[be]="scaleX(0.5)",r=i===e.getBoundingClientRect().width&&!(p&&Oe),Ae.removeChild(t)),r}(),De=function(t,e,i,r,s){var n,o,l,h,u,f,c,p,_,d,m,g,v,y,x=t._gsTransform,T=Fe(t,!0);x&&(v=x.xOrigin,y=x.yOrigin),(!r||2>(n=r.split(" ")).length)&&(c=t.getBBox(),e=re(e).split(" "),n=[(-1!==e[0].indexOf("%")?parseFloat(e[0])/100*c.width:parseFloat(e[0]))+c.x,(-1!==e[1].indexOf("%")?parseFloat(e[1])/100*c.height:parseFloat(e[1]))+c.y]),i.xOrigin=h=parseFloat(n[0]),i.yOrigin=u=parseFloat(n[1]),r&&T!==Le&&(f=T[0],c=T[1],p=T[2],_=T[3],d=T[4],m=T[5],g=f*_-c*p,o=h*(_/g)+u*(-p/g)+(p*m-_*d)/g,l=h*(-c/g)+u*(f/g)-(f*m-c*d)/g,h=i.xOrigin=n[0]=o,u=i.yOrigin=n[1]=l),x&&(s||s!==!1&&a.defaultSmoothOrigin!==!1?(o=h-v,l=u-y,x.xOffset+=o*T[0]+l*T[2]-o,x.yOffset+=o*T[1]+l*T[3]-l):x.xOffset=x.yOffset=0),t.setAttribute("data-svg-origin",n.join(" "))},Ne=function(t){return!!(Ce&&"function"==typeof t.getBBox&&t.getCTM&&(!t.parentNode||t.parentNode.getBBox&&t.parentNode.getCTM))},Le=[1,0,0,1,0,0],Fe=function(t,e){var i,r,s,n,a,o=t._gsTransform||new ke,l=1e5;if(be?r=Q(t,Pe,null,!0):t.currentStyle&&(r=t.currentStyle.filter.match(A),r=r&&4===r.length?[r[0].substr(4),Number(r[2].substr(4)),Number(r[1].substr(4)),r[3].substr(4),o.x||0,o.y||0].join(","):""),i=!r||"none"===r||"matrix(1, 0, 0, 1, 0, 0)"===r,(o.svg||t.getBBox&&Ne(t))&&(i&&-1!==(t.style[be]+"").indexOf("matrix")&&(r=t.style[be],i=0),s=t.getAttribute("transform"),i&&s&&(-1!==s.indexOf("matrix")?(r=s,i=0):-1!==s.indexOf("translate")&&(r="matrix(1,0,0,1,"+s.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",")+")",i=0))),i)return Le;for(s=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],ge=s.length;--ge>-1;)n=Number(s[ge]),s[ge]=(a=n-(n|=0))?(0|a*l+(0>a?-.5:.5))/l+n:n;return e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s},Xe=I.getTransform=function(t,i,r,n){if(t._gsTransform&&r&&!n)return t._gsTransform;var o,l,h,u,f,c,p=r?t._gsTransform||new ke:new ke,_=0>p.scaleX,d=2e-5,m=1e5,g=Oe?parseFloat(Q(t,Se,i,!1,"0 0 0").split(" ")[2])||p.zOrigin||0:0,v=parseFloat(a.defaultTransformPerspective)||0;if(p.svg=!(!t.getBBox||!Ne(t)),p.svg&&(De(t,Q(t,Se,s,!1,"50% 50%")+"",p,t.getAttribute("data-svg-origin")),Te=a.useSVGTransformAttr||Me),o=Fe(t),o!==Le){if(16===o.length){var y,x,T,w,b,P=o[0],S=o[1],O=o[2],k=o[3],C=o[4],R=o[5],A=o[6],M=o[7],D=o[8],N=o[9],F=o[10],X=o[12],z=o[13],B=o[14],E=o[11],I=Math.atan2(A,F);p.zOrigin&&(B=-p.zOrigin,X=D*B-o[12],z=N*B-o[13],B=F*B+p.zOrigin-o[14]),p.rotationX=I*L,I&&(w=Math.cos(-I),b=Math.sin(-I),y=C*w+D*b,x=R*w+N*b,T=A*w+F*b,D=C*-b+D*w,N=R*-b+N*w,F=A*-b+F*w,E=M*-b+E*w,C=y,R=x,A=T),I=Math.atan2(D,F),p.rotationY=I*L,I&&(w=Math.cos(-I),b=Math.sin(-I),y=P*w-D*b,x=S*w-N*b,T=O*w-F*b,N=S*b+N*w,F=O*b+F*w,E=k*b+E*w,P=y,S=x,O=T),I=Math.atan2(S,P),p.rotation=I*L,I&&(w=Math.cos(-I),b=Math.sin(-I),P=P*w+C*b,x=S*w+R*b,R=S*-b+R*w,A=O*-b+A*w,S=x),p.rotationX&&Math.abs(p.rotationX)+Math.abs(p.rotation)>359.9&&(p.rotationX=p.rotation=0,p.rotationY+=180),p.scaleX=(0|Math.sqrt(P*P+S*S)*m+.5)/m,p.scaleY=(0|Math.sqrt(R*R+N*N)*m+.5)/m,p.scaleZ=(0|Math.sqrt(A*A+F*F)*m+.5)/m,p.skewX=0,p.perspective=E?1/(0>E?-E:E):0,p.x=X,p.y=z,p.z=B,p.svg&&(p.x-=p.xOrigin-(p.xOrigin*P-p.yOrigin*C),p.y-=p.yOrigin-(p.yOrigin*S-p.xOrigin*R))}else if(!(Oe&&!n&&o.length&&p.x===o[4]&&p.y===o[5]&&(p.rotationX||p.rotationY)||void 0!==p.x&&"none"===Q(t,"display",i))){var Y=o.length>=6,W=Y?o[0]:1,V=o[1]||0,j=o[2]||0,G=Y?o[3]:1;p.x=o[4]||0,p.y=o[5]||0,h=Math.sqrt(W*W+V*V),u=Math.sqrt(G*G+j*j),f=W||V?Math.atan2(V,W)*L:p.rotation||0,c=j||G?Math.atan2(j,G)*L+f:p.skewX||0,Math.abs(c)>90&&270>Math.abs(c)&&(_?(h*=-1,c+=0>=f?180:-180,f+=0>=f?180:-180):(u*=-1,c+=0>=c?180:-180)),p.scaleX=h,p.scaleY=u,p.rotation=f,p.skewX=c,Oe&&(p.rotationX=p.rotationY=p.z=0,p.perspective=v,p.scaleZ=1),p.svg&&(p.x-=p.xOrigin-(p.xOrigin*W+p.yOrigin*j),p.y-=p.yOrigin-(p.xOrigin*V+p.yOrigin*G))}p.zOrigin=g;for(l in p)d>p[l]&&p[l]>-d&&(p[l]=0)}return r&&(t._gsTransform=p,p.svg&&(Te&&t.style[be]?e.delayedCall(.001,function(){Ie(t.style,be)}):!Te&&t.getAttribute("transform")&&e.delayedCall(.001,function(){t.removeAttribute("transform")}))),p},ze=function(t){var e,i,r=this.data,s=-r.rotation*N,n=s+r.skewX*N,a=1e5,o=(0|Math.cos(s)*r.scaleX*a)/a,l=(0|Math.sin(s)*r.scaleX*a)/a,h=(0|Math.sin(n)*-r.scaleY*a)/a,u=(0|Math.cos(n)*r.scaleY*a)/a,f=this.t.style,c=this.t.currentStyle;if(c){i=l,l=-h,h=-i,e=c.filter,f.filter="";var p,_,m=this.t.offsetWidth,g=this.t.offsetHeight,v="absolute"!==c.position,y="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+l+", M21="+h+", M22="+u,w=r.x+m*r.xPercent/100,b=r.y+g*r.yPercent/100;if(null!=r.ox&&(p=(r.oxp?.01*m*r.ox:r.ox)-m/2,_=(r.oyp?.01*g*r.oy:r.oy)-g/2,w+=p-(p*o+_*l),b+=_-(p*h+_*u)),v?(p=m/2,_=g/2,y+=", Dx="+(p-(p*o+_*l)+w)+", Dy="+(_-(p*h+_*u)+b)+")"):y+=", sizingMethod='auto expand')",f.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(M,y):y+" "+e,(0===t||1===t)&&1===o&&0===l&&0===h&&1===u&&(v&&-1===y.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf("gradient("&&e.indexOf("Alpha"))&&f.removeAttribute("filter")),!v){var P,S,O,k=8>d?1:-1;for(p=r.ieOffsetX||0,_=r.ieOffsetY||0,r.ieOffsetX=Math.round((m-((0>o?-o:o)*m+(0>l?-l:l)*g))/2+w),r.ieOffsetY=Math.round((g-((0>u?-u:u)*g+(0>h?-h:h)*m))/2+b),ge=0;4>ge;ge++)S=ee[ge],P=c[S],i=-1!==P.indexOf("px")?parseFloat(P):Z(this.t,S,parseFloat(P),P.replace(x,""))||0,O=i!==r[S]?2>ge?-r.ieOffsetX:-r.ieOffsetY:2>ge?p-r.ieOffsetX:_-r.ieOffsetY,f[S]=(r[S]=Math.round(i-O*(0===ge||2===ge?1:k)))+"px"}}},Be=I.set3DTransformRatio=I.setTransformRatio=function(t){var e,i,r,s,n,a,o,l,h,u,f,c,_,d,m,g,v,y,x,T,w,b,P,S=this.data,O=this.t.style,k=S.rotation,C=S.rotationX,R=S.rotationY,A=S.scaleX,M=S.scaleY,D=S.scaleZ,L=S.x,F=S.y,X=S.z,z=S.svg,B=S.perspective,E=S.force3D;if(!(((1!==t&&0!==t||"auto"!==E||this.tween._totalTime!==this.tween._totalDuration&&this.tween._totalTime)&&E||X||B||R||C)&&(!Te||!z)&&Oe))return k||S.skewX||z?(k*=N,b=S.skewX*N,P=1e5,e=Math.cos(k)*A,s=Math.sin(k)*A,i=Math.sin(k-b)*-M,n=Math.cos(k-b)*M,b&&"simple"===S.skewType&&(v=Math.tan(b),v=Math.sqrt(1+v*v),i*=v,n*=v,S.skewY&&(e*=v,s*=v)),z&&(L+=S.xOrigin-(S.xOrigin*e+S.yOrigin*i)+S.xOffset,F+=S.yOrigin-(S.xOrigin*s+S.yOrigin*n)+S.yOffset,Te&&(S.xPercent||S.yPercent)&&(d=this.t.getBBox(),L+=.01*S.xPercent*d.width,F+=.01*S.yPercent*d.height),d=1e-6,d>L&&L>-d&&(L=0),d>F&&F>-d&&(F=0)),x=(0|e*P)/P+","+(0|s*P)/P+","+(0|i*P)/P+","+(0|n*P)/P+","+L+","+F+")",z&&Te?this.t.setAttribute("transform","matrix("+x):O[be]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) matrix(":"matrix(")+x):O[be]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) matrix(":"matrix(")+A+",0,0,"+M+","+L+","+F+")",void 0;if(p&&(d=1e-4,d>A&&A>-d&&(A=D=2e-5),d>M&&M>-d&&(M=D=2e-5),!B||S.z||S.rotationX||S.rotationY||(B=0)),k||S.skewX)k*=N,m=e=Math.cos(k),g=s=Math.sin(k),S.skewX&&(k-=S.skewX*N,m=Math.cos(k),g=Math.sin(k),"simple"===S.skewType&&(v=Math.tan(S.skewX*N),v=Math.sqrt(1+v*v),m*=v,g*=v,S.skewY&&(e*=v,s*=v))),i=-g,n=m;else{if(!(R||C||1!==D||B||z))return O[be]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) translate3d(":"translate3d(")+L+"px,"+F+"px,"+X+"px)"+(1!==A||1!==M?" scale("+A+","+M+")":""),void 0;e=n=1,i=s=0}h=1,r=a=o=l=u=f=0,c=B?-1/B:0,_=S.zOrigin,d=1e-6,T=",",w="0",k=R*N,k&&(m=Math.cos(k),g=Math.sin(k),o=-g,u=c*-g,r=e*g,a=s*g,h=m,c*=m,e*=m,s*=m),k=C*N,k&&(m=Math.cos(k),g=Math.sin(k),v=i*m+r*g,y=n*m+a*g,l=h*g,f=c*g,r=i*-g+r*m,a=n*-g+a*m,h*=m,c*=m,i=v,n=y),1!==D&&(r*=D,a*=D,h*=D,c*=D),1!==M&&(i*=M,n*=M,l*=M,f*=M),1!==A&&(e*=A,s*=A,o*=A,u*=A),(_||z)&&(_&&(L+=r*-_,F+=a*-_,X+=h*-_+_),z&&(L+=S.xOrigin-(S.xOrigin*e+S.yOrigin*i)+S.xOffset,F+=S.yOrigin-(S.xOrigin*s+S.yOrigin*n)+S.yOffset),d>L&&L>-d&&(L=w),d>F&&F>-d&&(F=w),d>X&&X>-d&&(X=0)),x=S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) matrix3d(":"matrix3d(",x+=(d>e&&e>-d?w:e)+T+(d>s&&s>-d?w:s)+T+(d>o&&o>-d?w:o),x+=T+(d>u&&u>-d?w:u)+T+(d>i&&i>-d?w:i)+T+(d>n&&n>-d?w:n),C||R?(x+=T+(d>l&&l>-d?w:l)+T+(d>f&&f>-d?w:f)+T+(d>r&&r>-d?w:r),x+=T+(d>a&&a>-d?w:a)+T+(d>h&&h>-d?w:h)+T+(d>c&&c>-d?w:c)+T):x+=",0,0,0,0,1,0,",x+=L+T+F+T+X+T+(B?1+-X/B:1)+")",O[be]=x};h=ke.prototype,h.x=h.y=h.z=h.skewX=h.skewY=h.rotation=h.rotationX=h.rotationY=h.zOrigin=h.xPercent=h.yPercent=h.xOffset=h.yOffset=0,h.scaleX=h.scaleY=h.scaleZ=1,ye("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(t,e,i,r,n,o,l){if(r._lastParsedTransform===l)return n;r._lastParsedTransform=l;var h,u,f,c,p,_,d,m,g,v=t._gsTransform,y=r._transform=Xe(t,s,!0,l.parseTransform),x=t.style,T=1e-6,w=we.length,b=l,P={},S="transformOrigin";if("string"==typeof b.transform&&be)f=B.style,f[be]=b.transform,f.display="block",f.position="absolute",X.body.appendChild(B),h=Xe(B,null,!1),X.body.removeChild(B),null!=b.xPercent&&(h.xPercent=ne(b.xPercent,y.xPercent)),null!=b.yPercent&&(h.yPercent=ne(b.yPercent,y.yPercent));else if("object"==typeof b){if(h={scaleX:ne(null!=b.scaleX?b.scaleX:b.scale,y.scaleX),scaleY:ne(null!=b.scaleY?b.scaleY:b.scale,y.scaleY),scaleZ:ne(b.scaleZ,y.scaleZ),x:ne(b.x,y.x),y:ne(b.y,y.y),z:ne(b.z,y.z),xPercent:ne(b.xPercent,y.xPercent),yPercent:ne(b.yPercent,y.yPercent),perspective:ne(b.transformPerspective,y.perspective)},d=b.directionalRotation,null!=d)if("object"==typeof d)for(f in d)b[f]=d[f];else b.rotation=d;"string"==typeof b.x&&-1!==b.x.indexOf("%")&&(h.x=0,h.xPercent=ne(b.x,y.xPercent)),"string"==typeof b.y&&-1!==b.y.indexOf("%")&&(h.y=0,h.yPercent=ne(b.y,y.yPercent)),h.rotation=ae("rotation"in b?b.rotation:"shortRotation"in b?b.shortRotation+"_short":"rotationZ"in b?b.rotationZ:y.rotation,y.rotation,"rotation",P),Oe&&(h.rotationX=ae("rotationX"in b?b.rotationX:"shortRotationX"in b?b.shortRotationX+"_short":y.rotationX||0,y.rotationX,"rotationX",P),h.rotationY=ae("rotationY"in b?b.rotationY:"shortRotationY"in b?b.shortRotationY+"_short":y.rotationY||0,y.rotationY,"rotationY",P)),h.skewX=null==b.skewX?y.skewX:ae(b.skewX,y.skewX),h.skewY=null==b.skewY?y.skewY:ae(b.skewY,y.skewY),(u=h.skewY-y.skewY)&&(h.skewX+=u,h.rotation+=u)}for(Oe&&null!=b.force3D&&(y.force3D=b.force3D,_=!0),y.skewType=b.skewType||y.skewType||a.defaultSkewType,p=y.force3D||y.z||y.rotationX||y.rotationY||h.z||h.rotationX||h.rotationY||h.perspective,p||null==b.scale||(h.scaleZ=1);--w>-1;)i=we[w],c=h[i]-y[i],(c>T||-T>c||null!=b[i]||null!=F[i])&&(_=!0,n=new _e(y,i,y[i],c,n),i in P&&(n.e=P[i]),n.xs0=0,n.plugin=o,r._overwriteProps.push(n.n));return c=b.transformOrigin,y.svg&&(c||b.svgOrigin)&&(m=y.xOffset,g=y.yOffset,De(t,re(c),h,b.svgOrigin,b.smoothOrigin),n=de(y,"xOrigin",(v?y:h).xOrigin,h.xOrigin,n,S),n=de(y,"yOrigin",(v?y:h).yOrigin,h.yOrigin,n,S),(m!==y.xOffset||g!==y.yOffset)&&(n=de(y,"xOffset",v?m:y.xOffset,y.xOffset,n,S),n=de(y,"yOffset",v?g:y.yOffset,y.yOffset,n,S)),c=Te?null:"0px 0px"),(c||Oe&&p&&y.zOrigin)&&(be?(_=!0,i=Se,c=(c||Q(t,i,s,!1,"50% 50%"))+"",n=new _e(x,i,0,0,n,-1,S),n.b=x[i],n.plugin=o,Oe?(f=y.zOrigin,c=c.split(" "),y.zOrigin=(c.length>2&&(0===f||"0px"!==c[2])?parseFloat(c[2]):f)||0,n.xs0=n.e=c[0]+" "+(c[1]||"50%")+" 0px",n=new _e(y,"zOrigin",0,0,n,-1,n.n),n.b=f,n.xs0=n.e=y.zOrigin):n.xs0=n.e=c):re(c+"",y)),_&&(r._transformType=y.svg&&Te||!p&&3!==this._transformType?2:3),n},prefix:!0}),ye("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),ye("borderRadius",{defaultValue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,l,h,u,f,c,p,_,d,m,g,v,y,x,T,w,b=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],P=t.style;for(d=parseFloat(t.offsetWidth),m=parseFloat(t.offsetHeight),o=e.split(" "),l=0;b.length>l;l++)this.p.indexOf("border")&&(b[l]=q(b[l])),f=u=Q(t,b[l],s,!1,"0px"),-1!==f.indexOf(" ")&&(u=f.split(" "),f=u[0],u=u[1]),c=h=o[l],p=parseFloat(f),v=f.substr((p+"").length),y="="===c.charAt(1),y?(_=parseInt(c.charAt(0)+"1",10),c=c.substr(2),_*=parseFloat(c),g=c.substr((_+"").length-(0>_?1:0))||""):(_=parseFloat(c),g=c.substr((_+"").length)),""===g&&(g=r[i]||v),g!==v&&(x=Z(t,"borderLeft",p,v),T=Z(t,"borderTop",p,v),"%"===g?(f=100*(x/d)+"%",u=100*(T/m)+"%"):"em"===g?(w=Z(t,"borderLeft",1,"em"),f=x/w+"em",u=T/w+"em"):(f=x+"px",u=T+"px"),y&&(c=parseFloat(f)+_+g,h=parseFloat(u)+_+g)),a=me(P,b[l],f+" "+u,c+" "+h,!1,"0px",a);return a},prefix:!0,formatter:fe("0px 0px 0px 0px",!1,!0)}),ye("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,r,n,a){var o,l,h,u,f,c,p="background-position",_=s||H(t,null),m=this.format((_?d?_.getPropertyValue(p+"-x")+" "+_.getPropertyValue(p+"-y"):_.getPropertyValue(p):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),g=this.format(e);if(-1!==m.indexOf("%")!=(-1!==g.indexOf("%"))&&(c=Q(t,"backgroundImage").replace(k,""),c&&"none"!==c)){for(o=m.split(" "),l=g.split(" "),E.setAttribute("src",c),h=2;--h>-1;)m=o[h],u=-1!==m.indexOf("%"),u!==(-1!==l[h].indexOf("%"))&&(f=0===h?t.offsetWidth-E.width:t.offsetHeight-E.height,o[h]=u?parseFloat(m)/100*f+"px":100*(parseFloat(m)/f)+"%");m=o.join(" ")}return this.parseComplex(t.style,m,g,n,a)},formatter:re}),ye("backgroundSize",{defaultValue:"0 0",formatter:re}),ye("perspective",{defaultValue:"0px",prefix:!0}),ye("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),ye("transformStyle",{prefix:!0}),ye("backfaceVisibility",{prefix:!0}),ye("userSelect",{prefix:!0}),ye("margin",{parser:ce("marginTop,marginRight,marginBottom,marginLeft")}),ye("padding",{parser:ce("paddingTop,paddingRight,paddingBottom,paddingLeft")}),ye("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,r,n,a){var o,l,h;return 9>d?(l=t.currentStyle,h=8>d?" ":",",o="rect("+l.clipTop+h+l.clipRight+h+l.clipBottom+h+l.clipLeft+")",e=this.format(e).split(",").join(h)):(o=this.format(Q(t,this.p,s,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),ye("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),ye("autoRound,strictUnits",{parser:function(t,e,i,r,s){return s}}),ye("border",{defaultValue:"0px solid #000",parser:function(t,e,i,r,n,a){return this.parseComplex(t.style,this.format(Q(t,"borderTopWidth",s,!1,"0px")+" "+Q(t,"borderTopStyle",s,!1,"solid")+" "+Q(t,"borderTopColor",s,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(ue)||["#000"])[0]}}),ye("borderWidth",{parser:ce("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),ye("float,cssFloat,styleFloat",{parser:function(t,e,i,r,s){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new _e(n,a,0,0,s,-1,i,!1,0,n[a],e)}});var Ee=function(t){var e,i=this.t,r=i.filter||Q(this.data,"filter")||"",s=0|this.s+this.c*t;100===s&&(-1===r.indexOf("atrix(")&&-1===r.indexOf("radient(")&&-1===r.indexOf("oader(")?(i.removeAttribute("filter"),e=!Q(this.data,"filter")):(i.filter=r.replace(b,""),e=!0)),e||(this.xn1&&(i.filter=r=r||"alpha(opacity="+s+")"),-1===r.indexOf("pacity")?0===s&&this.xn1||(i.filter=r+" alpha(opacity="+s+")"):i.filter=r.replace(T,"opacity="+s))};ye("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,r,n,a){var o=parseFloat(Q(t,"opacity",s,!1,"1")),l=t.style,h="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),h&&1===o&&"hidden"===Q(t,"visibility",s)&&0!==e&&(o=0),W?n=new _e(l,"opacity",o,e-o,n):(n=new _e(l,"opacity",100*o,100*(e-o),n),n.xn1=h?1:0,l.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=Ee),h&&(n=new _e(l,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",r._overwriteProps.push(n.n),r._overwriteProps.push(i)),n}});var Ie=function(t,e){e&&(t.removeProperty?(("ms"===e.substr(0,2)||"webkit"===e.substr(0,6))&&(e="-"+e),t.removeProperty(e.replace(S,"-$1").toLowerCase())):t.removeAttribute(e))},Ye=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Ie(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};ye("className",{parser:function(t,e,r,n,a,o,l){var h,u,f,c,p,_=t.getAttribute("class")||"",d=t.style.cssText;if(a=n._classNamePT=new _e(t,r,0,0,a,2),a.setRatio=Ye,a.pr=-11,i=!0,a.b=_,u=K(t,s),f=t._gsClassPT){for(c={},p=f.data;p;)c[p.p]=1,p=p._next;f.setRatio(1)}return t._gsClassPT=a,a.e="="!==e.charAt(1)?e:_.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),t.setAttribute("class",a.e),h=J(t,u,K(t),l,c),t.setAttribute("class",_),a.data=h.firstMPT,t.style.cssText=d,a=a.xfirst=n.parse(t,h.difs,a,o)}});var We=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,r,s,n,a=this.t.style,o=l.transform.parse;if("all"===this.e)a.cssText="",s=!0;else for(e=this.e.split(" ").join("").split(","),r=e.length;--r>-1;)i=e[r],l[i]&&(l[i].parse===o?s=!0:i="transformOrigin"===i?Se:l[i].p),Ie(a,i);s&&(Ie(a,be),n=this.t._gsTransform,n&&(n.svg&&this.t.removeAttribute("data-svg-origin"),delete this.t._gsTransform))}};for(ye("clearProps",{parser:function(t,e,r,s,n){return n=new _e(t,r,0,0,n,2),n.setRatio=We,n.e=e,n.pr=-10,n.data=s._tween,i=!0,n}}),h="bezier,throwProps,physicsProps,physics2D".split(","),ge=h.length;ge--;)xe(h[ge]);h=a.prototype,h._firstPT=h._lastParsedTransform=h._transform=null,h._onInitTween=function(t,e,o){if(!t.nodeType)return!1;this._target=t,this._tween=o,this._vars=e,u=e.autoRound,i=!1,r=e.suffixMap||a.suffixMap,s=H(t,""),n=this._overwriteProps;
13 | var h,p,d,m,g,v,y,x,T,b=t.style;if(f&&""===b.zIndex&&(h=Q(t,"zIndex",s),("auto"===h||""===h)&&this._addLazySet(b,"zIndex",0)),"string"==typeof e&&(m=b.cssText,h=K(t,s),b.cssText=m+";"+e,h=J(t,h,K(t)).difs,!W&&w.test(e)&&(h.opacity=parseFloat(RegExp.$1)),e=h,b.cssText=m),this._firstPT=p=e.className?l.className.parse(t,e.className,"className",this,null,null,e):this.parse(t,e,null),this._transformType){for(T=3===this._transformType,be?c&&(f=!0,""===b.zIndex&&(y=Q(t,"zIndex",s),("auto"===y||""===y)&&this._addLazySet(b,"zIndex",0)),_&&this._addLazySet(b,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(T?"visible":"hidden"))):b.zoom=1,d=p;d&&d._next;)d=d._next;x=new _e(t,"transform",0,0,null,2),this._linkCSSP(x,null,d),x.setRatio=be?Be:ze,x.data=this._transform||Xe(t,s,!0),x.tween=o,x.pr=-1,n.pop()}if(i){for(;p;){for(v=p._next,d=m;d&&d.pr>p.pr;)d=d._next;(p._prev=d?d._prev:g)?p._prev._next=p:m=p,(p._next=d)?d._prev=p:g=p,p=v}this._firstPT=m}return!0},h.parse=function(t,e,i,n){var a,o,h,f,c,p,_,d,m,g,v=t.style;for(a in e)p=e[a],o=l[a],o?i=o.parse(t,p,a,this,i,n,e):(c=Q(t,a,s)+"",m="string"==typeof p,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexOf("Color")||m&&P.test(p)?(m||(p=he(p),p=(p.length>3?"rgba(":"rgb(")+p.join(",")+")"),i=me(v,a,c,p,!0,"transparent",i,0,n)):!m||-1===p.indexOf(" ")&&-1===p.indexOf(",")?(h=parseFloat(c),_=h||0===h?c.substr((h+"").length):"",(""===c||"auto"===c)&&("width"===a||"height"===a?(h=ie(t,a,s),_="px"):"left"===a||"top"===a?(h=$(t,a,s),_="px"):(h="opacity"!==a?0:1,_="")),g=m&&"="===p.charAt(1),g?(f=parseInt(p.charAt(0)+"1",10),p=p.substr(2),f*=parseFloat(p),d=p.replace(x,"")):(f=parseFloat(p),d=m?p.replace(x,""):""),""===d&&(d=a in r?r[a]:_),p=f||0===f?(g?f+h:f)+d:e[a],_!==d&&""!==d&&(f||0===f)&&h&&(h=Z(t,a,h,_),"%"===d?(h/=Z(t,a,100,"%")/100,e.strictUnits!==!0&&(c=h+"%")):"em"===d?h/=Z(t,a,1,"em"):"px"!==d&&(f=Z(t,a,f,d),d="px"),g&&(f||0===f)&&(p=f+h+d)),g&&(f+=h),!h&&0!==h||!f&&0!==f?void 0!==v[a]&&(p||"NaN"!=p+""&&null!=p)?(i=new _e(v,a,f||h||0,0,i,-1,a,!1,0,c,p),i.xs0="none"!==p||"display"!==a&&-1===a.indexOf("Style")?p:c):j("invalid "+a+" tween value: "+e[a]):(i=new _e(v,a,h,f-h,i,0,a,u!==!1&&("px"===d||"zIndex"===a),0,c,p),i.xs0=d)):i=me(v,a,c,p,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n);return i},h.setRatio=function(t){var e,i,r,s=this._firstPT,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;s;){if(e=s.c*t+s.s,s.r?e=Math.round(e):n>e&&e>-n&&(e=0),s.type)if(1===s.type)if(r=s.l,2===r)s.t[s.p]=s.xs0+e+s.xs1+s.xn1+s.xs2;else if(3===r)s.t[s.p]=s.xs0+e+s.xs1+s.xn1+s.xs2+s.xn2+s.xs3;else if(4===r)s.t[s.p]=s.xs0+e+s.xs1+s.xn1+s.xs2+s.xn2+s.xs3+s.xn3+s.xs4;else if(5===r)s.t[s.p]=s.xs0+e+s.xs1+s.xn1+s.xs2+s.xn2+s.xs3+s.xn3+s.xs4+s.xn4+s.xs5;else{for(i=s.xs0+e+s.xs1,r=1;s.l>r;r++)i+=s["xn"+r]+s["xs"+(r+1)];s.t[s.p]=i}else-1===s.type?s.t[s.p]=s.xs0:s.setRatio&&s.setRatio(t);else s.t[s.p]=e+s.xs0;s=s._next}else for(;s;)2!==s.type?s.t[s.p]=s.b:s.setRatio(t),s=s._next;else for(;s;){if(2!==s.type)if(s.r&&-1!==s.type)if(e=Math.round(s.s+s.c),s.type){if(1===s.type){for(r=s.l,i=s.xs0+e+s.xs1,r=1;s.l>r;r++)i+=s["xn"+r]+s["xs"+(r+1)];s.t[s.p]=i}}else s.t[s.p]=e+s.xs0;else s.t[s.p]=s.e;else s.setRatio(t);s=s._next}},h._enableTransforms=function(t){this._transform=this._transform||Xe(this._target,s,!0),this._transformType=this._transform.svg&&Te||!t&&3!==this._transformType?2:3};var Ve=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};h._addLazySet=function(t,e,i){var r=this._firstPT=new _e(t,e,0,0,this._firstPT,2);r.e=i,r.setRatio=Ve,r.data=this},h._linkCSSP=function(t,e,i,r){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,r=!0),i?i._next=t:r||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,r,s,n=e;if(e.autoAlpha||e.alpha){n={};for(r in e)n[r]=e[r];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return e.className&&(i=this._classNamePT)&&(s=i.xfirst,s&&s._prev?this._linkCSSP(s._prev,i._next,s._prev._prev):s===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,s._prev),this._classNamePT=null),t.prototype._kill.call(this,n)};var je=function(t,e,i){var r,s,n,a;if(t.slice)for(s=t.length;--s>-1;)je(t[s],e,i);else for(r=t.childNodes,s=r.length;--s>-1;)n=r[s],a=n.type,n.style&&(e.push(K(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||je(n,e,i)};return a.cascadeTo=function(t,i,r){var s,n,a,o,l=e.to(t,i,r),h=[l],u=[],f=[],c=[],p=e._internals.reservedProps;for(t=l._targets||l.target,je(t,u,c),l.render(i,!0,!0),je(t,f),l.render(0,!0,!0),l._enabled(!0),s=c.length;--s>-1;)if(n=J(c[s],u[s],f[s]),n.firstMPT){n=n.difs;for(a in r)p[a]&&(n[a]=r[a]);o={};for(a in n)o[a]=u[s][a];h.push(e.fromTo(c[s],i,o,n))}return h},t.activate([a]),a},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t){"use strict";var e=function(){return(_gsScope.GreenSockGlobals||_gsScope)[t]};"function"==typeof define&&define.amd?define(["TweenLite"],e):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=e())}("CSSPlugin");
14 |
--------------------------------------------------------------------------------
/project/_oridinal/develop/assets/javascripts/libraries/TimelineLite.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 1.17.0
3 | * DATE: 2015-05-27
4 | * UPDATES AND DOCS AT: http://greensock.com
5 | *
6 | * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://greensock.com/standard-license or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
18 |
19 | var TimelineLite = function(vars) {
20 | SimpleTimeline.call(this, vars);
21 | this._labels = {};
22 | this.autoRemoveChildren = (this.vars.autoRemoveChildren === true);
23 | this.smoothChildTiming = (this.vars.smoothChildTiming === true);
24 | this._sortChildren = true;
25 | this._onUpdate = this.vars.onUpdate;
26 | var v = this.vars,
27 | val, p;
28 | for (p in v) {
29 | val = v[p];
30 | if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) {
31 | v[p] = this._swapSelfInParams(val);
32 | }
33 | }
34 | if (_isArray(v.tweens)) {
35 | this.add(v.tweens, 0, v.align, v.stagger);
36 | }
37 | },
38 | _tinyNum = 0.0000000001,
39 | TweenLiteInternals = TweenLite._internals,
40 | _internals = TimelineLite._internals = {},
41 | _isSelector = TweenLiteInternals.isSelector,
42 | _isArray = TweenLiteInternals.isArray,
43 | _lazyTweens = TweenLiteInternals.lazyTweens,
44 | _lazyRender = TweenLiteInternals.lazyRender,
45 | _blankArray = [],
46 | _globals = _gsScope._gsDefine.globals,
47 | _copy = function(vars) {
48 | var copy = {}, p;
49 | for (p in vars) {
50 | copy[p] = vars[p];
51 | }
52 | return copy;
53 | },
54 | _pauseCallback = _internals.pauseCallback = function(tween, callback, params, scope) {
55 | var tl = tween._timeline,
56 | time = tl._totalTime,
57 | startTime = tween._startTime,
58 | reversed = (tween._rawPrevTime < 0 || (tween._rawPrevTime === 0 && tl._reversed)),//don't use tween.ratio because if the playhead lands exactly on top of the addPause(), ratio will be 1 even if the master timeline was reversed (which is correct). The key here is to sense the direction of the playhead.
59 | next = reversed ? 0 : _tinyNum,
60 | prev = reversed ? _tinyNum : 0,
61 | sibling;
62 | if (callback || !this._forcingPlayhead) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
63 | tl.pause(startTime);
64 | //now find sibling tweens that are EXACTLY at the same spot on the timeline and adjust the _rawPrevTime so that they fire (or don't fire) correctly on the next render. This is primarily to accommodate zero-duration tweens/callbacks that are positioned right on top of a pause. For example, tl.to(...).call(...).addPause(...).call(...) - notice that there's a call() on each side of the pause, so when it's running forward it should call the first one and then pause, and then when resumed, call the other. Zero-duration tweens use _rawPrevTime to sense momentum figure out if events were suppressed when arriving directly on top of that time.
65 | sibling = tween._prev;
66 | while (sibling && sibling._startTime === startTime) {
67 | sibling._rawPrevTime = prev;
68 | sibling = sibling._prev;
69 | }
70 | sibling = tween._next;
71 | while (sibling && sibling._startTime === startTime) {
72 | sibling._rawPrevTime = next;
73 | sibling = sibling._next;
74 | }
75 | if (callback) {
76 | callback.apply(scope || tl.vars.callbackScope || tl, params || _blankArray);
77 | }
78 | if (this._forcingPlayhead || !tl._paused) { //the callback could have called resume().
79 | tl.seek(time);
80 | }
81 | }
82 | },
83 | _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()
84 | var b = [],
85 | l = a.length,
86 | i;
87 | for (i = 0; i !== l; b.push(a[i++]));
88 | return b;
89 | },
90 | p = TimelineLite.prototype = new SimpleTimeline();
91 |
92 | TimelineLite.version = "1.17.0";
93 | p.constructor = TimelineLite;
94 | p.kill()._gc = p._forcingPlayhead = false;
95 |
96 | /* might use later...
97 | //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales.
98 | function localToGlobal(time, animation) {
99 | while (animation) {
100 | time = (time / animation._timeScale) + animation._startTime;
101 | animation = animation.timeline;
102 | }
103 | return time;
104 | }
105 |
106 | //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales
107 | function globalToLocal(time, animation) {
108 | var scale = 1;
109 | time -= localToGlobal(0, animation);
110 | while (animation) {
111 | scale *= animation._timeScale;
112 | animation = animation.timeline;
113 | }
114 | return time * scale;
115 | }
116 | */
117 |
118 | p.to = function(target, duration, vars, position) {
119 | var Engine = (vars.repeat && _globals.TweenMax) || TweenLite;
120 | return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position);
121 | };
122 |
123 | p.from = function(target, duration, vars, position) {
124 | return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, vars), position);
125 | };
126 |
127 | p.fromTo = function(target, duration, fromVars, toVars, position) {
128 | var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite;
129 | return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position);
130 | };
131 |
132 | p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
133 | var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}),
134 | i;
135 | if (typeof(targets) === "string") {
136 | targets = TweenLite.selector(targets) || targets;
137 | }
138 | targets = targets || [];
139 | if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array.
140 | targets = _slice(targets);
141 | }
142 | stagger = stagger || 0;
143 | if (stagger < 0) {
144 | targets = _slice(targets);
145 | targets.reverse();
146 | stagger *= -1;
147 | }
148 | for (i = 0; i < targets.length; i++) {
149 | if (vars.startAt) {
150 | vars.startAt = _copy(vars.startAt);
151 | }
152 | tl.to(targets[i], duration, _copy(vars), i * stagger);
153 | }
154 | return this.add(tl, position);
155 | };
156 |
157 | p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
158 | vars.immediateRender = (vars.immediateRender != false);
159 | vars.runBackwards = true;
160 | return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
161 | };
162 |
163 | p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
164 | toVars.startAt = fromVars;
165 | toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
166 | return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
167 | };
168 |
169 | p.call = function(callback, params, scope, position) {
170 | return this.add( TweenLite.delayedCall(0, callback, params, scope), position);
171 | };
172 |
173 | p.set = function(target, vars, position) {
174 | position = this._parseTimeOrLabel(position, 0, true);
175 | if (vars.immediateRender == null) {
176 | vars.immediateRender = (position === this._time && !this._paused);
177 | }
178 | return this.add( new TweenLite(target, 0, vars), position);
179 | };
180 |
181 | TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) {
182 | vars = vars || {};
183 | if (vars.smoothChildTiming == null) {
184 | vars.smoothChildTiming = true;
185 | }
186 | var tl = new TimelineLite(vars),
187 | root = tl._timeline,
188 | tween, next;
189 | if (ignoreDelayedCalls == null) {
190 | ignoreDelayedCalls = true;
191 | }
192 | root._remove(tl, true);
193 | tl._startTime = 0;
194 | tl._rawPrevTime = tl._time = tl._totalTime = root._time;
195 | tween = root._first;
196 | while (tween) {
197 | next = tween._next;
198 | if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) {
199 | tl.add(tween, tween._startTime - tween._delay);
200 | }
201 | tween = next;
202 | }
203 | root.add(tl, 0);
204 | return tl;
205 | };
206 |
207 | p.add = function(value, position, align, stagger) {
208 | var curTime, l, i, child, tl, beforeRawTime;
209 | if (typeof(position) !== "number") {
210 | position = this._parseTimeOrLabel(position, 0, true, value);
211 | }
212 | if (!(value instanceof Animation)) {
213 | if ((value instanceof Array) || (value && value.push && _isArray(value))) {
214 | align = align || "normal";
215 | stagger = stagger || 0;
216 | curTime = position;
217 | l = value.length;
218 | for (i = 0; i < l; i++) {
219 | if (_isArray(child = value[i])) {
220 | child = new TimelineLite({tweens:child});
221 | }
222 | this.add(child, curTime);
223 | if (typeof(child) !== "string" && typeof(child) !== "function") {
224 | if (align === "sequence") {
225 | curTime = child._startTime + (child.totalDuration() / child._timeScale);
226 | } else if (align === "start") {
227 | child._startTime -= child.delay();
228 | }
229 | }
230 | curTime += stagger;
231 | }
232 | return this._uncache(true);
233 | } else if (typeof(value) === "string") {
234 | return this.addLabel(value, position);
235 | } else if (typeof(value) === "function") {
236 | value = TweenLite.delayedCall(0, value);
237 | } else {
238 | throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string.");
239 | }
240 | }
241 |
242 | SimpleTimeline.prototype.add.call(this, value, position);
243 |
244 | //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
245 | if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) {
246 | //in case any of the ancestors had completed but should now be enabled...
247 | tl = this;
248 | beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect.
249 | while (tl._timeline) {
250 | if (beforeRawTime && tl._timeline.smoothChildTiming) {
251 | tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it.
252 | } else if (tl._gc) {
253 | tl._enabled(true, false);
254 | }
255 | tl = tl._timeline;
256 | }
257 | }
258 |
259 | return this;
260 | };
261 |
262 | p.remove = function(value) {
263 | if (value instanceof Animation) {
264 | return this._remove(value, false);
265 | } else if (value instanceof Array || (value && value.push && _isArray(value))) {
266 | var i = value.length;
267 | while (--i > -1) {
268 | this.remove(value[i]);
269 | }
270 | return this;
271 | } else if (typeof(value) === "string") {
272 | return this.removeLabel(value);
273 | }
274 | return this.kill(null, value);
275 | };
276 |
277 | p._remove = function(tween, skipDisable) {
278 | SimpleTimeline.prototype._remove.call(this, tween, skipDisable);
279 | var last = this._last;
280 | if (!last) {
281 | this._time = this._totalTime = this._duration = this._totalDuration = 0;
282 | } else if (this._time > last._startTime + last._totalDuration / last._timeScale) {
283 | this._time = this.duration();
284 | this._totalTime = this._totalDuration;
285 | }
286 | return this;
287 | };
288 |
289 | p.append = function(value, offsetOrLabel) {
290 | return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value));
291 | };
292 |
293 | p.insert = p.insertMultiple = function(value, position, align, stagger) {
294 | return this.add(value, position || 0, align, stagger);
295 | };
296 |
297 | p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) {
298 | return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger);
299 | };
300 |
301 | p.addLabel = function(label, position) {
302 | this._labels[label] = this._parseTimeOrLabel(position);
303 | return this;
304 | };
305 |
306 | p.addPause = function(position, callback, params, scope) {
307 | var t = TweenLite.delayedCall(0, _pauseCallback, ["{self}", callback, params, scope], this);
308 | t.data = "isPause"; // we use this flag in TweenLite's render() method to identify it as a special case that shouldn't be triggered when the virtual playhead is LEAVING the exact position where the pause is, otherwise timeline.addPause(1).play(1) would end up paused on the very next tick.
309 | return this.add(t, position);
310 | };
311 |
312 | p.removeLabel = function(label) {
313 | delete this._labels[label];
314 | return this;
315 | };
316 |
317 | p.getLabelTime = function(label) {
318 | return (this._labels[label] != null) ? this._labels[label] : -1;
319 | };
320 |
321 | p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
322 | var i;
323 | //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
324 | if (ignore instanceof Animation && ignore.timeline === this) {
325 | this.remove(ignore);
326 | } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) {
327 | i = ignore.length;
328 | while (--i > -1) {
329 | if (ignore[i] instanceof Animation && ignore[i].timeline === this) {
330 | this.remove(ignore[i]);
331 | }
332 | }
333 | }
334 | if (typeof(offsetOrLabel) === "string") {
335 | return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
336 | }
337 | offsetOrLabel = offsetOrLabel || 0;
338 | if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
339 | i = timeOrLabel.indexOf("=");
340 | if (i === -1) {
341 | if (this._labels[timeOrLabel] == null) {
342 | return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
343 | }
344 | return this._labels[timeOrLabel] + offsetOrLabel;
345 | }
346 | offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
347 | timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
348 | } else if (timeOrLabel == null) {
349 | timeOrLabel = this.duration();
350 | }
351 | return Number(timeOrLabel) + offsetOrLabel;
352 | };
353 |
354 | p.seek = function(position, suppressEvents) {
355 | return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false));
356 | };
357 |
358 | p.stop = function() {
359 | return this.paused(true);
360 | };
361 |
362 | p.gotoAndPlay = function(position, suppressEvents) {
363 | return this.play(position, suppressEvents);
364 | };
365 |
366 | p.gotoAndStop = function(position, suppressEvents) {
367 | return this.pause(position, suppressEvents);
368 | };
369 |
370 | p.render = function(time, suppressEvents, force) {
371 | if (this._gc) {
372 | this._enabled(true, false);
373 | }
374 | var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
375 | prevTime = this._time,
376 | prevStart = this._startTime,
377 | prevTimeScale = this._timeScale,
378 | prevPaused = this._paused,
379 | tween, isComplete, next, callback, internalForce;
380 | if (time >= totalDur) {
381 | this._totalTime = this._time = totalDur;
382 | if (!this._reversed) if (!this._hasPausedChild()) {
383 | isComplete = true;
384 | callback = "onComplete";
385 | internalForce = !!this._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline.
386 | if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0 || this._rawPrevTime === _tinyNum) if (this._rawPrevTime !== time && this._first) {
387 | internalForce = true;
388 | if (this._rawPrevTime > _tinyNum) {
389 | callback = "onReverseComplete";
390 | }
391 | }
392 | }
393 | this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
394 | time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7.
395 |
396 | } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
397 | this._totalTime = this._time = 0;
398 | if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime !== _tinyNum && (this._rawPrevTime > 0 || (time < 0 && this._rawPrevTime >= 0)))) {
399 | callback = "onReverseComplete";
400 | isComplete = this._reversed;
401 | }
402 | if (time < 0) {
403 | this._active = false;
404 | if (this._timeline.autoRemoveChildren && this._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing.
405 | internalForce = isComplete = true;
406 | callback = "onReverseComplete";
407 | } else if (this._rawPrevTime >= 0 && this._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state.
408 | internalForce = true;
409 | }
410 | this._rawPrevTime = time;
411 | } else {
412 | this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
413 | if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good).
414 | tween = this._first;
415 | while (tween && tween._startTime === 0) {
416 | if (!tween._duration) {
417 | isComplete = false;
418 | }
419 | tween = tween._next;
420 | }
421 | }
422 | time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline)
423 | if (!this._initted) {
424 | internalForce = true;
425 | }
426 | }
427 |
428 | } else {
429 | this._totalTime = this._time = this._rawPrevTime = time;
430 | }
431 | if ((this._time === prevTime || !this._first) && !force && !internalForce) {
432 | return;
433 | } else if (!this._initted) {
434 | this._initted = true;
435 | }
436 |
437 | if (!this._active) if (!this._paused && this._time !== prevTime && time > 0) {
438 | this._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example.
439 | }
440 |
441 | if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) {
442 | this._callback("onStart");
443 | }
444 |
445 | if (this._time >= prevTime) {
446 | tween = this._first;
447 | while (tween) {
448 | next = tween._next; //record it here because the value could change after rendering...
449 | if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
450 | break;
451 | } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
452 | if (!tween._reversed) {
453 | tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
454 | } else {
455 | tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
456 | }
457 | }
458 | tween = next;
459 | }
460 | } else {
461 | tween = this._last;
462 | while (tween) {
463 | next = tween._prev; //record it here because the value could change after rendering...
464 | if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
465 | break;
466 | } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
467 | if (!tween._reversed) {
468 | tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
469 | } else {
470 | tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
471 | }
472 | }
473 | tween = next;
474 | }
475 | }
476 |
477 | if (this._onUpdate) if (!suppressEvents) {
478 | if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.
479 | _lazyRender();
480 | }
481 | this._callback("onUpdate");
482 | }
483 |
484 | if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate
485 | if (isComplete) {
486 | if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values.
487 | _lazyRender();
488 | }
489 | if (this._timeline.autoRemoveChildren) {
490 | this._enabled(false, false);
491 | }
492 | this._active = false;
493 | }
494 | if (!suppressEvents && this.vars[callback]) {
495 | this._callback(callback);
496 | }
497 | }
498 | };
499 |
500 | p._hasPausedChild = function() {
501 | var tween = this._first;
502 | while (tween) {
503 | if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) {
504 | return true;
505 | }
506 | tween = tween._next;
507 | }
508 | return false;
509 | };
510 |
511 | p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) {
512 | ignoreBeforeTime = ignoreBeforeTime || -9999999999;
513 | var a = [],
514 | tween = this._first,
515 | cnt = 0;
516 | while (tween) {
517 | if (tween._startTime < ignoreBeforeTime) {
518 | //do nothing
519 | } else if (tween instanceof TweenLite) {
520 | if (tweens !== false) {
521 | a[cnt++] = tween;
522 | }
523 | } else {
524 | if (timelines !== false) {
525 | a[cnt++] = tween;
526 | }
527 | if (nested !== false) {
528 | a = a.concat(tween.getChildren(true, tweens, timelines));
529 | cnt = a.length;
530 | }
531 | }
532 | tween = tween._next;
533 | }
534 | return a;
535 | };
536 |
537 | p.getTweensOf = function(target, nested) {
538 | var disabled = this._gc,
539 | a = [],
540 | cnt = 0,
541 | tweens, i;
542 | if (disabled) {
543 | this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here.
544 | }
545 | tweens = TweenLite.getTweensOf(target);
546 | i = tweens.length;
547 | while (--i > -1) {
548 | if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) {
549 | a[cnt++] = tweens[i];
550 | }
551 | }
552 | if (disabled) {
553 | this._enabled(false, true);
554 | }
555 | return a;
556 | };
557 |
558 | p.recent = function() {
559 | return this._recent;
560 | };
561 |
562 | p._contains = function(tween) {
563 | var tl = tween.timeline;
564 | while (tl) {
565 | if (tl === this) {
566 | return true;
567 | }
568 | tl = tl.timeline;
569 | }
570 | return false;
571 | };
572 |
573 | p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) {
574 | ignoreBeforeTime = ignoreBeforeTime || 0;
575 | var tween = this._first,
576 | labels = this._labels,
577 | p;
578 | while (tween) {
579 | if (tween._startTime >= ignoreBeforeTime) {
580 | tween._startTime += amount;
581 | }
582 | tween = tween._next;
583 | }
584 | if (adjustLabels) {
585 | for (p in labels) {
586 | if (labels[p] >= ignoreBeforeTime) {
587 | labels[p] += amount;
588 | }
589 | }
590 | }
591 | return this._uncache(true);
592 | };
593 |
594 | p._kill = function(vars, target) {
595 | if (!vars && !target) {
596 | return this._enabled(false, false);
597 | }
598 | var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target),
599 | i = tweens.length,
600 | changed = false;
601 | while (--i > -1) {
602 | if (tweens[i]._kill(vars, target)) {
603 | changed = true;
604 | }
605 | }
606 | return changed;
607 | };
608 |
609 | p.clear = function(labels) {
610 | var tweens = this.getChildren(false, true, true),
611 | i = tweens.length;
612 | this._time = this._totalTime = 0;
613 | while (--i > -1) {
614 | tweens[i]._enabled(false, false);
615 | }
616 | if (labels !== false) {
617 | this._labels = {};
618 | }
619 | return this._uncache(true);
620 | };
621 |
622 | p.invalidate = function() {
623 | var tween = this._first;
624 | while (tween) {
625 | tween.invalidate();
626 | tween = tween._next;
627 | }
628 | return Animation.prototype.invalidate.call(this);;
629 | };
630 |
631 | p._enabled = function(enabled, ignoreTimeline) {
632 | if (enabled === this._gc) {
633 | var tween = this._first;
634 | while (tween) {
635 | tween._enabled(enabled, true);
636 | tween = tween._next;
637 | }
638 | }
639 | return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline);
640 | };
641 |
642 | p.totalTime = function(time, suppressEvents, uncapped) {
643 | this._forcingPlayhead = true;
644 | var val = Animation.prototype.totalTime.apply(this, arguments);
645 | this._forcingPlayhead = false;
646 | return val;
647 | };
648 |
649 | p.duration = function(value) {
650 | if (!arguments.length) {
651 | if (this._dirty) {
652 | this.totalDuration(); //just triggers recalculation
653 | }
654 | return this._duration;
655 | }
656 | if (this.duration() !== 0 && value !== 0) {
657 | this.timeScale(this._duration / value);
658 | }
659 | return this;
660 | };
661 |
662 | p.totalDuration = function(value) {
663 | if (!arguments.length) {
664 | if (this._dirty) {
665 | var max = 0,
666 | tween = this._last,
667 | prevStart = 999999999999,
668 | prev, end;
669 | while (tween) {
670 | prev = tween._prev; //record it here in case the tween changes position in the sequence...
671 | if (tween._dirty) {
672 | tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it.
673 | }
674 | if (tween._startTime > prevStart && this._sortChildren && !tween._paused) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence
675 | this.add(tween, tween._startTime - tween._delay);
676 | } else {
677 | prevStart = tween._startTime;
678 | }
679 | if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.
680 | max -= tween._startTime;
681 | if (this._timeline.smoothChildTiming) {
682 | this._startTime += tween._startTime / this._timeScale;
683 | }
684 | this.shiftChildren(-tween._startTime, false, -9999999999);
685 | prevStart = 0;
686 | }
687 | end = tween._startTime + (tween._totalDuration / tween._timeScale);
688 | if (end > max) {
689 | max = end;
690 | }
691 | tween = prev;
692 | }
693 | this._duration = this._totalDuration = max;
694 | this._dirty = false;
695 | }
696 | return this._totalDuration;
697 | }
698 | if (this.totalDuration() !== 0) if (value !== 0) {
699 | this.timeScale(this._totalDuration / value);
700 | }
701 | return this;
702 | };
703 |
704 | p.paused = function(value) {
705 | if (!value) { //if there's a pause directly at the spot from where we're unpausing, skip it.
706 | var tween = this._first,
707 | time = this._time;
708 | while (tween) {
709 | if (tween._startTime === time && tween.data === "isPause") {
710 | tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire.
711 | }
712 | tween = tween._next;
713 | }
714 | }
715 | return Animation.prototype.paused.apply(this, arguments);
716 | };
717 |
718 | p.usesFrames = function() {
719 | var tl = this._timeline;
720 | while (tl._timeline) {
721 | tl = tl._timeline;
722 | }
723 | return (tl === Animation._rootFramesTimeline);
724 | };
725 |
726 | p.rawTime = function() {
727 | return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale;
728 | };
729 |
730 | return TimelineLite;
731 |
732 | }, true);
733 |
734 |
735 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
736 |
737 | //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
738 | (function(name) {
739 | "use strict";
740 | var getGlobal = function() {
741 | return (_gsScope.GreenSockGlobals || _gsScope)[name];
742 | };
743 | if (typeof(define) === "function" && define.amd) { //AMD
744 | define(["TweenLite"], getGlobal);
745 | } else if (typeof(module) !== "undefined" && module.exports) { //node
746 | require("./TweenLite.js"); //dependency
747 | module.exports = getGlobal();
748 | }
749 | }("TimelineLite"));
750 |
--------------------------------------------------------------------------------
/project/_oridinal/develop/assets/javascripts/libraries/TweenLite.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 1.17.0
3 | * DATE: 2015-05-27
4 | * UPDATES AND DOCS AT: http://greensock.com
5 | *
6 | * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://greensock.com/standard-license or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | (function(window, moduleName) {
13 |
14 | "use strict";
15 | var _globals = window.GreenSockGlobals = window.GreenSockGlobals || window;
16 | if (_globals.TweenLite) {
17 | return; //in case the core set of classes is already loaded, don't instantiate twice.
18 | }
19 | var _namespace = function(ns) {
20 | var a = ns.split("."),
21 | p = _globals, i;
22 | for (i = 0; i < a.length; i++) {
23 | p[a[i]] = p = p[a[i]] || {};
24 | }
25 | return p;
26 | },
27 | gs = _namespace("com.greensock"),
28 | _tinyNum = 0.0000000001,
29 | _slice = function(a) { //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()
30 | var b = [],
31 | l = a.length,
32 | i;
33 | for (i = 0; i !== l; b.push(a[i++]));
34 | return b;
35 | },
36 | _emptyFunc = function() {},
37 | _isArray = (function() { //works around issues in iframe environments where the Array global isn't shared, thus if the object originates in a different window/iframe, "(obj instanceof Array)" will evaluate false. We added some speed optimizations to avoid Object.prototype.toString.call() unless it's absolutely necessary because it's VERY slow (like 20x slower)
38 | var toString = Object.prototype.toString,
39 | array = toString.call([]);
40 | return function(obj) {
41 | return obj != null && (obj instanceof Array || (typeof(obj) === "object" && !!obj.push && toString.call(obj) === array));
42 | };
43 | }()),
44 | a, i, p, _ticker, _tickerActive,
45 | _defLookup = {},
46 |
47 | /**
48 | * @constructor
49 | * Defines a GreenSock class, optionally with an array of dependencies that must be instantiated first and passed into the definition.
50 | * This allows users to load GreenSock JS files in any order even if they have interdependencies (like CSSPlugin extends TweenPlugin which is
51 | * inside TweenLite.js, but if CSSPlugin is loaded first, it should wait to run its code until TweenLite.js loads and instantiates TweenPlugin
52 | * and then pass TweenPlugin to CSSPlugin's definition). This is all done automatically and internally.
53 | *
54 | * Every definition will be added to a "com.greensock" global object (typically window, but if a window.GreenSockGlobals object is found,
55 | * it will go there as of v1.7). For example, TweenLite will be found at window.com.greensock.TweenLite and since it's a global class that should be available anywhere,
56 | * it is ALSO referenced at window.TweenLite. However some classes aren't considered global, like the base com.greensock.core.Animation class, so
57 | * those will only be at the package like window.com.greensock.core.Animation. Again, if you define a GreenSockGlobals object on the window, everything
58 | * gets tucked neatly inside there instead of on the window directly. This allows you to do advanced things like load multiple versions of GreenSock
59 | * files and put them into distinct objects (imagine a banner ad uses a newer version but the main site uses an older one). In that case, you could
60 | * sandbox the banner one like:
61 | *
62 | *
65 | *
66 | *
69 | *
70 | *
74 | *
75 | * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back".
76 | * @param {!Array.} dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"]
77 | * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition.
78 | * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object)
79 | */
80 | Definition = function(ns, dependencies, func, global) {
81 | this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses
82 | _defLookup[ns] = this;
83 | this.gsClass = null;
84 | this.func = func;
85 | var _classes = [];
86 | this.check = function(init) {
87 | var i = dependencies.length,
88 | missing = i,
89 | cur, a, n, cl;
90 | while (--i > -1) {
91 | if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
92 | _classes[i] = cur.gsClass;
93 | missing--;
94 | } else if (init) {
95 | cur.sc.push(this);
96 | }
97 | }
98 | if (missing === 0 && func) {
99 | a = ("com.greensock." + ns).split(".");
100 | n = a.pop();
101 | cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes);
102 |
103 | //exports to multiple environments
104 | if (global) {
105 | _globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
106 | if (typeof(define) === "function" && define.amd){ //AMD
107 | define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
108 | } else if (ns === moduleName && typeof(module) !== "undefined" && module.exports){ //node
109 | module.exports = cl;
110 | }
111 | }
112 | for (i = 0; i < this.sc.length; i++) {
113 | this.sc[i].check();
114 | }
115 | }
116 | };
117 | this.check(true);
118 | },
119 |
120 | //used to create Definition instances (which basically registers a class that has dependencies).
121 | _gsDefine = window._gsDefine = function(ns, dependencies, func, global) {
122 | return new Definition(ns, dependencies, func, global);
123 | },
124 |
125 | //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class).
126 | _class = gs._class = function(ns, func, global) {
127 | func = func || function() {};
128 | _gsDefine(ns, [], function(){ return func; }, global);
129 | return func;
130 | };
131 |
132 | _gsDefine.globals = _globals;
133 |
134 |
135 |
136 | /*
137 | * ----------------------------------------------------------------
138 | * Ease
139 | * ----------------------------------------------------------------
140 | */
141 | var _baseParams = [0, 0, 1, 1],
142 | _blankArray = [],
143 | Ease = _class("easing.Ease", function(func, extraParams, type, power) {
144 | this._func = func;
145 | this._type = type || 0;
146 | this._power = power || 0;
147 | this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams;
148 | }, true),
149 | _easeMap = Ease.map = {},
150 | _easeReg = Ease.register = function(ease, names, types, create) {
151 | var na = names.split(","),
152 | i = na.length,
153 | ta = (types || "easeIn,easeOut,easeInOut").split(","),
154 | e, name, j, type;
155 | while (--i > -1) {
156 | name = na[i];
157 | e = create ? _class("easing."+name, null, true) : gs.easing[name] || {};
158 | j = ta.length;
159 | while (--j > -1) {
160 | type = ta[j];
161 | _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease();
162 | }
163 | }
164 | };
165 |
166 | p = Ease.prototype;
167 | p._calcEnd = false;
168 | p.getRatio = function(p) {
169 | if (this._func) {
170 | this._params[0] = p;
171 | return this._func.apply(null, this._params);
172 | }
173 | var t = this._type,
174 | pw = this._power,
175 | r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2;
176 | if (pw === 1) {
177 | r *= r;
178 | } else if (pw === 2) {
179 | r *= r * r;
180 | } else if (pw === 3) {
181 | r *= r * r * r;
182 | } else if (pw === 4) {
183 | r *= r * r * r * r;
184 | }
185 | return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2);
186 | };
187 |
188 | //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut)
189 | a = ["Linear","Quad","Cubic","Quart","Quint,Strong"];
190 | i = a.length;
191 | while (--i > -1) {
192 | p = a[i]+",Power"+i;
193 | _easeReg(new Ease(null,null,1,i), p, "easeOut", true);
194 | _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : ""));
195 | _easeReg(new Ease(null,null,3,i), p, "easeInOut");
196 | }
197 | _easeMap.linear = gs.easing.Linear.easeIn;
198 | _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks
199 |
200 |
201 | /*
202 | * ----------------------------------------------------------------
203 | * EventDispatcher
204 | * ----------------------------------------------------------------
205 | */
206 | var EventDispatcher = _class("events.EventDispatcher", function(target) {
207 | this._listeners = {};
208 | this._eventTarget = target || this;
209 | });
210 | p = EventDispatcher.prototype;
211 |
212 | p.addEventListener = function(type, callback, scope, useParam, priority) {
213 | priority = priority || 0;
214 | var list = this._listeners[type],
215 | index = 0,
216 | listener, i;
217 | if (list == null) {
218 | this._listeners[type] = list = [];
219 | }
220 | i = list.length;
221 | while (--i > -1) {
222 | listener = list[i];
223 | if (listener.c === callback && listener.s === scope) {
224 | list.splice(i, 1);
225 | } else if (index === 0 && listener.pr < priority) {
226 | index = i + 1;
227 | }
228 | }
229 | list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority});
230 | if (this === _ticker && !_tickerActive) {
231 | _ticker.wake();
232 | }
233 | };
234 |
235 | p.removeEventListener = function(type, callback) {
236 | var list = this._listeners[type], i;
237 | if (list) {
238 | i = list.length;
239 | while (--i > -1) {
240 | if (list[i].c === callback) {
241 | list.splice(i, 1);
242 | return;
243 | }
244 | }
245 | }
246 | };
247 |
248 | p.dispatchEvent = function(type) {
249 | var list = this._listeners[type],
250 | i, t, listener;
251 | if (list) {
252 | i = list.length;
253 | t = this._eventTarget;
254 | while (--i > -1) {
255 | listener = list[i];
256 | if (listener) {
257 | if (listener.up) {
258 | listener.c.call(listener.s || t, {type:type, target:t});
259 | } else {
260 | listener.c.call(listener.s || t);
261 | }
262 | }
263 | }
264 | }
265 | };
266 |
267 |
268 | /*
269 | * ----------------------------------------------------------------
270 | * Ticker
271 | * ----------------------------------------------------------------
272 | */
273 | var _reqAnimFrame = window.requestAnimationFrame,
274 | _cancelAnimFrame = window.cancelAnimationFrame,
275 | _getTime = Date.now || function() {return new Date().getTime();},
276 | _lastUpdate = _getTime();
277 |
278 | //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill.
279 | a = ["ms","moz","webkit","o"];
280 | i = a.length;
281 | while (--i > -1 && !_reqAnimFrame) {
282 | _reqAnimFrame = window[a[i] + "RequestAnimationFrame"];
283 | _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"];
284 | }
285 |
286 | _class("Ticker", function(fps, useRAF) {
287 | var _self = this,
288 | _startTime = _getTime(),
289 | _useRAF = (useRAF !== false && _reqAnimFrame),
290 | _lagThreshold = 500,
291 | _adjustedLag = 33,
292 | _tickWord = "tick", //helps reduce gc burden
293 | _fps, _req, _id, _gap, _nextTime,
294 | _tick = function(manual) {
295 | var elapsed = _getTime() - _lastUpdate,
296 | overlap, dispatch;
297 | if (elapsed > _lagThreshold) {
298 | _startTime += elapsed - _adjustedLag;
299 | }
300 | _lastUpdate += elapsed;
301 | _self.time = (_lastUpdate - _startTime) / 1000;
302 | overlap = _self.time - _nextTime;
303 | if (!_fps || overlap > 0 || manual === true) {
304 | _self.frame++;
305 | _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap);
306 | dispatch = true;
307 | }
308 | if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.
309 | _id = _req(_tick);
310 | }
311 | if (dispatch) {
312 | _self.dispatchEvent(_tickWord);
313 | }
314 | };
315 |
316 | EventDispatcher.call(_self);
317 | _self.time = _self.frame = 0;
318 | _self.tick = function() {
319 | _tick(true);
320 | };
321 |
322 | _self.lagSmoothing = function(threshold, adjustedLag) {
323 | _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited
324 | _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0);
325 | };
326 |
327 | _self.sleep = function() {
328 | if (_id == null) {
329 | return;
330 | }
331 | if (!_useRAF || !_cancelAnimFrame) {
332 | clearTimeout(_id);
333 | } else {
334 | _cancelAnimFrame(_id);
335 | }
336 | _req = _emptyFunc;
337 | _id = null;
338 | if (_self === _ticker) {
339 | _tickerActive = false;
340 | }
341 | };
342 |
343 | _self.wake = function() {
344 | if (_id !== null) {
345 | _self.sleep();
346 | } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout().
347 | _lastUpdate = _getTime() - _lagThreshold + 5;
348 | }
349 | _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame;
350 | if (_self === _ticker) {
351 | _tickerActive = true;
352 | }
353 | _tick(2);
354 | };
355 |
356 | _self.fps = function(value) {
357 | if (!arguments.length) {
358 | return _fps;
359 | }
360 | _fps = value;
361 | _gap = 1 / (_fps || 60);
362 | _nextTime = this.time + _gap;
363 | _self.wake();
364 | };
365 |
366 | _self.useRAF = function(value) {
367 | if (!arguments.length) {
368 | return _useRAF;
369 | }
370 | _self.sleep();
371 | _useRAF = value;
372 | _self.fps(_fps);
373 | };
374 | _self.fps(fps);
375 |
376 | //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition.
377 | setTimeout(function() {
378 | if (_useRAF && _self.frame < 5) {
379 | _self.useRAF(false);
380 | }
381 | }, 1500);
382 | });
383 |
384 | p = gs.Ticker.prototype = new gs.events.EventDispatcher();
385 | p.constructor = gs.Ticker;
386 |
387 |
388 | /*
389 | * ----------------------------------------------------------------
390 | * Animation
391 | * ----------------------------------------------------------------
392 | */
393 | var Animation = _class("core.Animation", function(duration, vars) {
394 | this.vars = vars = vars || {};
395 | this._duration = this._totalDuration = duration || 0;
396 | this._delay = Number(vars.delay) || 0;
397 | this._timeScale = 1;
398 | this._active = (vars.immediateRender === true);
399 | this.data = vars.data;
400 | this._reversed = (vars.reversed === true);
401 |
402 | if (!_rootTimeline) {
403 | return;
404 | }
405 | if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly.
406 | _ticker.wake();
407 | }
408 |
409 | var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline;
410 | tl.add(this, tl._time);
411 |
412 | if (this.vars.paused) {
413 | this.paused(true);
414 | }
415 | });
416 |
417 | _ticker = Animation.ticker = new gs.Ticker();
418 | p = Animation.prototype;
419 | p._dirty = p._gc = p._initted = p._paused = false;
420 | p._totalTime = p._time = 0;
421 | p._rawPrevTime = -1;
422 | p._next = p._last = p._onUpdate = p._timeline = p.timeline = null;
423 | p._paused = false;
424 |
425 |
426 | //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.
427 | var _checkTimeout = function() {
428 | if (_tickerActive && _getTime() - _lastUpdate > 2000) {
429 | _ticker.wake();
430 | }
431 | setTimeout(_checkTimeout, 2000);
432 | };
433 | _checkTimeout();
434 |
435 |
436 | p.play = function(from, suppressEvents) {
437 | if (from != null) {
438 | this.seek(from, suppressEvents);
439 | }
440 | return this.reversed(false).paused(false);
441 | };
442 |
443 | p.pause = function(atTime, suppressEvents) {
444 | if (atTime != null) {
445 | this.seek(atTime, suppressEvents);
446 | }
447 | return this.paused(true);
448 | };
449 |
450 | p.resume = function(from, suppressEvents) {
451 | if (from != null) {
452 | this.seek(from, suppressEvents);
453 | }
454 | return this.paused(false);
455 | };
456 |
457 | p.seek = function(time, suppressEvents) {
458 | return this.totalTime(Number(time), suppressEvents !== false);
459 | };
460 |
461 | p.restart = function(includeDelay, suppressEvents) {
462 | return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true);
463 | };
464 |
465 | p.reverse = function(from, suppressEvents) {
466 | if (from != null) {
467 | this.seek((from || this.totalDuration()), suppressEvents);
468 | }
469 | return this.reversed(true).paused(false);
470 | };
471 |
472 | p.render = function(time, suppressEvents, force) {
473 | //stub - we override this method in subclasses.
474 | };
475 |
476 | p.invalidate = function() {
477 | this._time = this._totalTime = 0;
478 | this._initted = this._gc = false;
479 | this._rawPrevTime = -1;
480 | if (this._gc || !this.timeline) {
481 | this._enabled(true);
482 | }
483 | return this;
484 | };
485 |
486 | p.isActive = function() {
487 | var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.
488 | startTime = this._startTime,
489 | rawTime;
490 | return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime()) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
491 | };
492 |
493 | p._enabled = function (enabled, ignoreTimeline) {
494 | if (!_tickerActive) {
495 | _ticker.wake();
496 | }
497 | this._gc = !enabled;
498 | this._active = this.isActive();
499 | if (ignoreTimeline !== true) {
500 | if (enabled && !this.timeline) {
501 | this._timeline.add(this, this._startTime - this._delay);
502 | } else if (!enabled && this.timeline) {
503 | this._timeline._remove(this, true);
504 | }
505 | }
506 | return false;
507 | };
508 |
509 |
510 | p._kill = function(vars, target) {
511 | return this._enabled(false, false);
512 | };
513 |
514 | p.kill = function(vars, target) {
515 | this._kill(vars, target);
516 | return this;
517 | };
518 |
519 | p._uncache = function(includeSelf) {
520 | var tween = includeSelf ? this : this.timeline;
521 | while (tween) {
522 | tween._dirty = true;
523 | tween = tween.timeline;
524 | }
525 | return this;
526 | };
527 |
528 | p._swapSelfInParams = function(params) {
529 | var i = params.length,
530 | copy = params.concat();
531 | while (--i > -1) {
532 | if (params[i] === "{self}") {
533 | copy[i] = this;
534 | }
535 | }
536 | return copy;
537 | };
538 |
539 | p._callback = function(type) {
540 | var v = this.vars;
541 | v[type].apply(v[type + "Scope"] || v.callbackScope || this, v[type + "Params"] || _blankArray);
542 | };
543 |
544 | //----Animation getters/setters --------------------------------------------------------
545 |
546 | p.eventCallback = function(type, callback, params, scope) {
547 | if ((type || "").substr(0,2) === "on") {
548 | var v = this.vars;
549 | if (arguments.length === 1) {
550 | return v[type];
551 | }
552 | if (callback == null) {
553 | delete v[type];
554 | } else {
555 | v[type] = callback;
556 | v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params;
557 | v[type + "Scope"] = scope;
558 | }
559 | if (type === "onUpdate") {
560 | this._onUpdate = callback;
561 | }
562 | }
563 | return this;
564 | };
565 |
566 | p.delay = function(value) {
567 | if (!arguments.length) {
568 | return this._delay;
569 | }
570 | if (this._timeline.smoothChildTiming) {
571 | this.startTime( this._startTime + value - this._delay );
572 | }
573 | this._delay = value;
574 | return this;
575 | };
576 |
577 | p.duration = function(value) {
578 | if (!arguments.length) {
579 | this._dirty = false;
580 | return this._duration;
581 | }
582 | this._duration = this._totalDuration = value;
583 | this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration.
584 | if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) {
585 | this.totalTime(this._totalTime * (value / this._duration), true);
586 | }
587 | return this;
588 | };
589 |
590 | p.totalDuration = function(value) {
591 | this._dirty = false;
592 | return (!arguments.length) ? this._totalDuration : this.duration(value);
593 | };
594 |
595 | p.time = function(value, suppressEvents) {
596 | if (!arguments.length) {
597 | return this._time;
598 | }
599 | if (this._dirty) {
600 | this.totalDuration();
601 | }
602 | return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents);
603 | };
604 |
605 | p.totalTime = function(time, suppressEvents, uncapped) {
606 | if (!_tickerActive) {
607 | _ticker.wake();
608 | }
609 | if (!arguments.length) {
610 | return this._totalTime;
611 | }
612 | if (this._timeline) {
613 | if (time < 0 && !uncapped) {
614 | time += this.totalDuration();
615 | }
616 | if (this._timeline.smoothChildTiming) {
617 | if (this._dirty) {
618 | this.totalDuration();
619 | }
620 | var totalDuration = this._totalDuration,
621 | tl = this._timeline;
622 | if (time > totalDuration && !uncapped) {
623 | time = totalDuration;
624 | }
625 | this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale);
626 | if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.
627 | this._uncache(false);
628 | }
629 | //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed.
630 | if (tl._timeline) {
631 | while (tl._timeline) {
632 | if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) {
633 | tl.totalTime(tl._totalTime, true);
634 | }
635 | tl = tl._timeline;
636 | }
637 | }
638 | }
639 | if (this._gc) {
640 | this._enabled(true, false);
641 | }
642 | if (this._totalTime !== time || this._duration === 0) {
643 | this.render(time, suppressEvents, false);
644 | if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.
645 | _lazyRender();
646 | }
647 | }
648 | }
649 | return this;
650 | };
651 |
652 | p.progress = p.totalProgress = function(value, suppressEvents) {
653 | return (!arguments.length) ? this._time / this.duration() : this.totalTime(this.duration() * value, suppressEvents);
654 | };
655 |
656 | p.startTime = function(value) {
657 | if (!arguments.length) {
658 | return this._startTime;
659 | }
660 | if (value !== this._startTime) {
661 | this._startTime = value;
662 | if (this.timeline) if (this.timeline._sortChildren) {
663 | this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.
664 | }
665 | }
666 | return this;
667 | };
668 |
669 | p.endTime = function(includeRepeats) {
670 | return this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale;
671 | };
672 |
673 | p.timeScale = function(value) {
674 | if (!arguments.length) {
675 | return this._timeScale;
676 | }
677 | value = value || _tinyNum; //can't allow zero because it'll throw the math off
678 | if (this._timeline && this._timeline.smoothChildTiming) {
679 | var pauseTime = this._pauseTime,
680 | t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime();
681 | this._startTime = t - ((t - this._startTime) * this._timeScale / value);
682 | }
683 | this._timeScale = value;
684 | return this._uncache(false);
685 | };
686 |
687 | p.reversed = function(value) {
688 | if (!arguments.length) {
689 | return this._reversed;
690 | }
691 | if (value != this._reversed) {
692 | this._reversed = value;
693 | this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true);
694 | }
695 | return this;
696 | };
697 |
698 | p.paused = function(value) {
699 | if (!arguments.length) {
700 | return this._paused;
701 | }
702 | var tl = this._timeline,
703 | raw, elapsed;
704 | if (value != this._paused) if (tl) {
705 | if (!_tickerActive && !value) {
706 | _ticker.wake();
707 | }
708 | raw = tl.rawTime();
709 | elapsed = raw - this._pauseTime;
710 | if (!value && tl.smoothChildTiming) {
711 | this._startTime += elapsed;
712 | this._uncache(false);
713 | }
714 | this._pauseTime = value ? raw : null;
715 | this._paused = value;
716 | this._active = this.isActive();
717 | if (!value && elapsed !== 0 && this._initted && this.duration()) {
718 | this.render((tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale), true, true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.
719 | }
720 | }
721 | if (this._gc && !value) {
722 | this._enabled(true, false);
723 | }
724 | return this;
725 | };
726 |
727 |
728 | /*
729 | * ----------------------------------------------------------------
730 | * SimpleTimeline
731 | * ----------------------------------------------------------------
732 | */
733 | var SimpleTimeline = _class("core.SimpleTimeline", function(vars) {
734 | Animation.call(this, 0, vars);
735 | this.autoRemoveChildren = this.smoothChildTiming = true;
736 | });
737 |
738 | p = SimpleTimeline.prototype = new Animation();
739 | p.constructor = SimpleTimeline;
740 | p.kill()._gc = false;
741 | p._first = p._last = p._recent = null;
742 | p._sortChildren = false;
743 |
744 | p.add = p.insert = function(child, position, align, stagger) {
745 | var prevTween, st;
746 | child._startTime = Number(position || 0) + child._delay;
747 | if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order).
748 | child._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale);
749 | }
750 | if (child.timeline) {
751 | child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one.
752 | }
753 | child.timeline = child._timeline = this;
754 | if (child._gc) {
755 | child._enabled(true, true);
756 | }
757 | prevTween = this._last;
758 | if (this._sortChildren) {
759 | st = child._startTime;
760 | while (prevTween && prevTween._startTime > st) {
761 | prevTween = prevTween._prev;
762 | }
763 | }
764 | if (prevTween) {
765 | child._next = prevTween._next;
766 | prevTween._next = child;
767 | } else {
768 | child._next = this._first;
769 | this._first = child;
770 | }
771 | if (child._next) {
772 | child._next._prev = child;
773 | } else {
774 | this._last = child;
775 | }
776 | child._prev = prevTween;
777 | this._recent = child;
778 | if (this._timeline) {
779 | this._uncache(true);
780 | }
781 | return this;
782 | };
783 |
784 | p._remove = function(tween, skipDisable) {
785 | if (tween.timeline === this) {
786 | if (!skipDisable) {
787 | tween._enabled(false, true);
788 | }
789 |
790 | if (tween._prev) {
791 | tween._prev._next = tween._next;
792 | } else if (this._first === tween) {
793 | this._first = tween._next;
794 | }
795 | if (tween._next) {
796 | tween._next._prev = tween._prev;
797 | } else if (this._last === tween) {
798 | this._last = tween._prev;
799 | }
800 | tween._next = tween._prev = tween.timeline = null;
801 | if (tween === this._recent) {
802 | this._recent = this._last;
803 | }
804 |
805 | if (this._timeline) {
806 | this._uncache(true);
807 | }
808 | }
809 | return this;
810 | };
811 |
812 | p.render = function(time, suppressEvents, force) {
813 | var tween = this._first,
814 | next;
815 | this._totalTime = this._time = this._rawPrevTime = time;
816 | while (tween) {
817 | next = tween._next; //record it here because the value could change after rendering...
818 | if (tween._active || (time >= tween._startTime && !tween._paused)) {
819 | if (!tween._reversed) {
820 | tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
821 | } else {
822 | tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
823 | }
824 | }
825 | tween = next;
826 | }
827 | };
828 |
829 | p.rawTime = function() {
830 | if (!_tickerActive) {
831 | _ticker.wake();
832 | }
833 | return this._totalTime;
834 | };
835 |
836 | /*
837 | * ----------------------------------------------------------------
838 | * TweenLite
839 | * ----------------------------------------------------------------
840 | */
841 | var TweenLite = _class("TweenLite", function(target, duration, vars) {
842 | Animation.call(this, duration, vars);
843 | this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method)
844 |
845 | if (target == null) {
846 | throw "Cannot tween a null target.";
847 | }
848 |
849 | this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target;
850 |
851 | var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),
852 | overwrite = this.vars.overwrite,
853 | i, targ, targets;
854 |
855 | this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite];
856 |
857 | if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") {
858 | this._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()
859 | this._propLookup = [];
860 | this._siblings = [];
861 | for (i = 0; i < targets.length; i++) {
862 | targ = targets[i];
863 | if (!targ) {
864 | targets.splice(i--, 1);
865 | continue;
866 | } else if (typeof(targ) === "string") {
867 | targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings
868 | if (typeof(targ) === "string") {
869 | targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case)
870 | }
871 | continue;
872 | } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that