├── .editorconfig ├── .ember-cli ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .npmignore ├── .travis.yml ├── .watchmanconfig ├── LICENSE.md ├── README.md ├── blueprints └── ember-gsap │ └── index.js ├── config ├── ember-try.js └── environment.js ├── ember-cli-build.js ├── index.js ├── package.json ├── testem.js ├── tests ├── .eslintrc.js ├── dummy │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ ├── .gitkeep │ │ │ ├── draggable-item.js │ │ │ └── ember-logo.js │ │ ├── controllers │ │ │ ├── .gitkeep │ │ │ └── application.js │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── index.html │ │ ├── models │ │ │ └── .gitkeep │ │ ├── resolver.js │ │ ├── router.js │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── styles │ │ │ └── app.css │ │ └── templates │ │ │ ├── application.hbs │ │ │ └── components │ │ │ ├── .gitkeep │ │ │ ├── draggable-item.hbs │ │ │ └── ember-logo.hbs │ ├── config │ │ ├── environment.js │ │ └── targets.js │ └── public │ │ ├── crossdomain.xml │ │ └── robots.txt ├── helpers │ ├── destroy-app.js │ ├── module-for-acceptance.js │ ├── resolver.js │ └── start-app.js ├── index.html ├── integration │ └── .gitkeep ├── test-helper.js └── unit │ ├── .gitkeep │ └── utils │ └── gsap-export-test.js ├── vendor ├── .gitkeep ├── polyfills │ └── array.includes.js └── shims │ └── gsap.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parserOptions: { 4 | ecmaVersion: 2017, 5 | sourceType: 'module' 6 | }, 7 | extends: 'eslint:recommended', 8 | env: { 9 | browser: true 10 | }, 11 | rules: { 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/dummy/* linguist-vendored 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log* 17 | yarn-error.log 18 | testem.log 19 | /DEBUG 20 | 21 | # ember-try 22 | .node_modules.ember-try/ 23 | bower.json.ember-try 24 | package.json.ember-try 25 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /bower_components 2 | /config/ember-try.js 3 | /dist 4 | /tests 5 | /tmp 6 | **/.gitkeep 7 | .bowerrc 8 | .editorconfig 9 | .ember-cli 10 | .gitignore 11 | .eslintrc.js 12 | .watchmanconfig 13 | .travis.yml 14 | bower.json 15 | ember-cli-build.js 16 | testem.js 17 | /DEBUG 18 | Icon^M^M 19 | Icon* 20 | 21 | # ember-try 22 | .node_modules.ember-try/ 23 | bower.json.ember-try 24 | package.json.ember-try 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "4" 7 | 8 | sudo: false 9 | dist: trusty 10 | 11 | addons: 12 | chrome: stable 13 | 14 | cache: 15 | yarn: true 16 | 17 | env: 18 | global: 19 | # See https://git.io/vdao3 for details. 20 | - JOBS=1 21 | matrix: 22 | # we recommend new addons test the current and previous LTS 23 | # as well as latest stable release (bonus points to beta/canary) 24 | - EMBER_TRY_SCENARIO=ember-lts-2.12 25 | - EMBER_TRY_SCENARIO=ember-lts-2.16 26 | - EMBER_TRY_SCENARIO=ember-release 27 | - EMBER_TRY_SCENARIO=ember-beta 28 | - EMBER_TRY_SCENARIO=ember-canary 29 | - EMBER_TRY_SCENARIO=ember-default 30 | 31 | matrix: 32 | fast_finish: true 33 | allow_failures: 34 | - env: EMBER_TRY_SCENARIO=ember-canary 35 | 36 | before_install: 37 | - curl -o- -L https://yarnpkg.com/install.sh | bash 38 | - export PATH=$HOME/.yarn/bin:$PATH 39 | 40 | install: 41 | - yarn install --no-lockfile --non-interactive 42 | 43 | script: 44 | # Usually, it's ok to finish the test scenario without reverting 45 | # to the addon's original dependency state, skipping "cleanup". 46 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup 47 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### ⚠️ Ember GSAP is deprecated in favour of using ember-auto-import 2 | 3 | New happy path: 4 | 5 | 1. Install [Ember Auto Import](https://github.com/ef4/ember-auto-import) 6 | ```bash 7 | ember install ember-auto-import 8 | ``` 9 | 10 | 2. Install GSAP as a `devDependency`. 11 | ```bash 12 | npm install --save-dev gsap 13 | ``` 14 | 15 | 3. Import away, following GSAP [docs](https://greensock.com/docs/NPMUsage). 16 | ```js 17 | import TweenMax from 'gsap/TweenMax' 18 | ``` 19 | 20 | --- 21 | 22 | 23 | 24 | Ember GSAP [![Build Status](https://travis-ci.org/willviles/ember-gsap.svg)](https://travis-ci.org/willviles/ember-gsap) [![Ember Observer Score](http://emberobserver.com/badges/ember-gsap.svg)](http://emberobserver.com/addons/ember-gsap) ![Download count all time](https://img.shields.io/npm/dt/ember-gsap.svg) [![npm](https://img.shields.io/npm/v/ember-gsap.svg)](https://www.npmjs.com/package/ember-gsap) 25 | ====== 26 | 27 | Ember GSAP allows consumption of [GSAP - Greensock Animation Platform](https://github.com/greensock/GreenSock-JS) as ES6 Module imports in Ember applications. 28 | 29 | ## Installation 30 | 31 | `ember install ember-gsap` 32 | 33 | ## Demo 34 | 35 | Check out this Ember Twiddle [demo](https://ember-twiddle.com/f61209fc8ad1f1e85613f8f4ef4573e1) to show Ember GSAP in action. 36 | 37 | ## Usage 38 | 39 | Ember GSAP by default includes `TweenMax`, `TweenLite`, `TimelineLite`, `TimelineMax`, `CSSPlugin`, `RoundPropsPlugin`, `BezierPlugin`, `AttrPlugin`, `DirectionalRotationPlugin`, and all of the easing functions `Power1`, `Power2`, `Power3`, `Power4`, `Back`, `Bounce`, `Circ`, `Cubic`, `Elastic`, `Expo`, `Linear`, `Sine`, `RoughEase`, `SlowMo` and `SteppedEase`. 40 | 41 | Recommended import style is as follows: 42 | 43 | ```javascript 44 | import { TimelineMax, TweenMax, easing } from 'gsap'; 45 | 46 | const { Power2, Back, Elastic } = easing; 47 | ``` 48 | 49 | Easing functions can also be directly imported like so: 50 | 51 | ```javascript 52 | import { Power2, Back, Elastic } from 'gsap/easing'; 53 | ``` 54 | 55 | ## Core Libraries 56 | 57 | To prevent Ember GSAP from importing `TweenMax`, which automatically includes all the utilities listed above, you can cherry pick the core libraries and plugins you wish to include. 58 | 59 | ```js 60 | // config/environment.js 61 | ENV['ember-gsap'] = { 62 | core: [ 63 | 'TweenLite', 64 | 'TimelineLite' 65 | ] 66 | } 67 | ``` 68 | 69 | ## GSAP Plugins 70 | 71 | Popular Greensock Plugin libraries can be enabled like so: 72 | 73 | ```js 74 | // config/environment.js 75 | ENV['ember-gsap'] = { 76 | plugins: [ 77 | 'draggable', 78 | 'scrollTo' 79 | ] 80 | } 81 | ``` 82 | 83 | | Plugin | Key | Included in TweenMax? | Import | 84 | |-|-|-|-| 85 | | [Attr](https://greensock.com/docs/Plugins/AttrPlugin) | `attr` | ✓ | | 86 | | [Bezier](https://greensock.com/docs/Plugins/BezierPlugin) | `bezier` | ✓ | | 87 | | [ColorProps](https://greensock.com/docs/Plugins/ColorPropsPlugin) | `colorProps` | | | 88 | | [CSS](https://greensock.com/docs/Plugins/CSSPlugin) | `css` | ✓ | | 89 | | [CSSRule](https://greensock.com/docs/Plugins/CSSRulePlugin) | `cssRule` | | | 90 | | [DirectionalRotation](https://greensock.com/docs/Plugins/DirectionalRotationPlugin) | `directionalRotation` | ✓ | | 91 | | [Draggable](https://greensock.com/draggable) | `draggable` | | ```import { Draggable } from 'gsap';``` | 92 | | [Easel](https://greensock.com/docs/Plugins/EaselPlugin) | `easel` | | | 93 | | [Modifiers](https://greensock.com/docs/Plugins/ModifiersPlugin) | `modifiers` | | | 94 | | [Raphael](https://greensock.com/docs/Plugins/RaphaelPlugin) | `raphael` | | | 95 | | [RoundProps](https://greensock.com/docs/Plugins/RoundPropsPlugin) | `roundProps` | ✓ | | 96 | | [ScrollTo](https://greensock.com/docs/Plugins/ScrollToPlugin) | `scrollTo` | | | 97 | | [Text](https://greensock.com/docs/Plugins/TextPlugin) | `text` | | | 98 | 99 | ## Fastboot 100 | 101 | Ember GSAP >=0.3.0 is fully compatible with all versions of [Ember CLI Fastboot](https://github.com/ember-fastboot/ember-cli-fastboot). 102 | -------------------------------------------------------------------------------- /blueprints/ember-gsap/index.js: -------------------------------------------------------------------------------- 1 | /* eslint node: true */ 2 | 'use strict'; 3 | 4 | module.exports = { 5 | normalizeEntityName: function() {} 6 | }; 7 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | useYarn: true, 4 | scenarios: [ 5 | { 6 | name: 'ember-lts-2.12', 7 | npm: { 8 | devDependencies: { 9 | 'ember-source': '~2.12.0' 10 | } 11 | } 12 | }, 13 | { 14 | name: 'ember-lts-2.16', 15 | npm: { 16 | devDependencies: { 17 | 'ember-source': '~2.16.0' 18 | } 19 | } 20 | }, 21 | { 22 | name: 'ember-release', 23 | bower: { 24 | dependencies: { 25 | 'ember': 'components/ember#release' 26 | }, 27 | resolutions: { 28 | 'ember': 'release' 29 | } 30 | }, 31 | npm: { 32 | devDependencies: { 33 | 'ember-source': null 34 | } 35 | } 36 | }, 37 | { 38 | name: 'ember-beta', 39 | bower: { 40 | dependencies: { 41 | 'ember': 'components/ember#beta' 42 | }, 43 | resolutions: { 44 | 'ember': 'beta' 45 | } 46 | }, 47 | npm: { 48 | devDependencies: { 49 | 'ember-source': null 50 | } 51 | } 52 | }, 53 | { 54 | name: 'ember-canary', 55 | bower: { 56 | dependencies: { 57 | 'ember': 'components/ember#canary' 58 | }, 59 | resolutions: { 60 | 'ember': 'canary' 61 | } 62 | }, 63 | npm: { 64 | devDependencies: { 65 | 'ember-source': null 66 | } 67 | } 68 | }, 69 | { 70 | name: 'ember-default', 71 | npm: { 72 | devDependencies: {} 73 | } 74 | } 75 | ] 76 | }; 77 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | module.exports = function(/* environment, appConfig */) { 5 | return { }; 6 | }; 7 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | module.exports = function(defaults) { 7 | let app = new EmberAddon(defaults, { 8 | // Add options here 9 | }); 10 | 11 | /* 12 | This build file specifies the options for the dummy test app of this 13 | addon, located in `/tests/dummy` 14 | This build file does *not* influence how the addon or the app using it 15 | behave. You most likely want to be modifying `./index.js` or app's build file 16 | */ 17 | 18 | return app.toTree(); 19 | }; 20 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | const Funnel = require('broccoli-funnel'); 5 | const mergeTrees = require('broccoli-merge-trees'); 6 | const BroccoliDebug = require('broccoli-debug'); 7 | const fastbootTransform = require('fastboot-transform'); 8 | const path = require('path'); 9 | 10 | module.exports = { 11 | name: 'ember-gsap', 12 | 13 | included(app) { 14 | if (typeof app.import !== 'function' && app.app) { 15 | app = app.app; 16 | } 17 | this.app = app; 18 | 19 | this.addonConfig = this.app.project.config(app.env)['ember-gsap'] || {}; 20 | this.importDependencies(app); 21 | 22 | return this._super.included.apply(this, arguments); 23 | }, 24 | 25 | importDependencies(app) { 26 | let importConfig = this.addonConfig.core || ['TweenMax'], 27 | pluginConfig = Array.isArray(this.addonConfig.plugins) ? this.addonConfig.plugins : [], 28 | vendor = this.treePaths.vendor, 29 | dir = `${vendor}/gsap`; 30 | 31 | importConfig.forEach(key => { 32 | app.import(`${dir}/${key}.js`); 33 | }); 34 | 35 | let plugins = { 36 | 'attr': 'AttrPlugin.js', 37 | 'bezier': 'BezierPlugin.js', 38 | 'colorProps': 'ColorPropsPlugin.js', 39 | 'css': 'CSSPlugin.js', 40 | 'cssRule': 'CSSRulePlugin.js', 41 | 'directionalRotation': 'DirectionalRotationPlugin.js', 42 | 'draggable': 'Draggable.js', 43 | 'easel': 'EaselPlugin.js', 44 | 'modifiers': 'ModifiersPlugin.js', 45 | 'raphael': 'RaphaelPlugin.js', 46 | 'roundProps': 'RoundPropsPlugin.js', 47 | 'scrollTo': 'ScrollToPlugin.js', 48 | 'TextPlugin': 'TextPlugin.js' 49 | }; 50 | 51 | if (!Array.prototype.includes) { 52 | require('./vendor/polyfills/array.includes.js'); 53 | } 54 | 55 | Object.keys(plugins).forEach(key => { 56 | if (pluginConfig.includes(key)) { 57 | app.import(`${dir}/${plugins[key]}`); 58 | } 59 | }); 60 | 61 | app.import('vendor/shims/gsap.js', { 62 | exports: { 63 | 'gsap': ['TweenMax', 'TweenLite', 'TimelineMax', 'TimelineLite', 'easing'], 64 | 'TweenMax': ['default'], 65 | 'TweenLite': ['default'], 66 | 'TimelineMax': ['default'], 67 | 'TimelineLite': ['default'] 68 | } 69 | }); 70 | 71 | }, 72 | 73 | treeForVendor(vendorTree) { 74 | let debugTree = BroccoliDebug.buildDebugCallback(this.name); 75 | let trees = []; 76 | 77 | if (vendorTree) { 78 | trees.push( 79 | debugTree(vendorTree, 'vendorTree') 80 | ); 81 | } 82 | 83 | let gsap = fastbootTransform( 84 | moduleToFunnel('gsap') 85 | ); 86 | trees.push(debugTree(gsap, 'gsap')); 87 | 88 | return debugTree(mergeTrees(trees), 'mergedTrees'); 89 | } 90 | 91 | }; 92 | 93 | function moduleToFunnel(moduleName, destination) { 94 | return new Funnel(resolveModulePath(moduleName), { 95 | destDir: destination || moduleName 96 | }); 97 | } 98 | 99 | function resolveModulePath(moduleName) { 100 | return path.dirname(require.resolve(moduleName)); 101 | } 102 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-gsap", 3 | "version": "1.0.1", 4 | "description": "GSAP - Greensock Animation Platform as ES6 Modules for Ember.js applications.", 5 | "keywords": [ 6 | "ember-addon", 7 | "gsap", 8 | "greensock", 9 | "animation", 10 | "platform" 11 | ], 12 | "license": "MIT", 13 | "author": { 14 | "name": "Will Viles", 15 | "email": "will@vil.es", 16 | "url": "https://willviles.com" 17 | }, 18 | "directories": { 19 | "doc": "doc", 20 | "test": "tests" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/willviles/ember-gsap.git" 25 | }, 26 | "scripts": { 27 | "build": "ember build", 28 | "start": "ember serve", 29 | "test": "ember try:each" 30 | }, 31 | "dependencies": { 32 | "broccoli-debug": "^0.6.2", 33 | "broccoli-stew": "^1.5.0", 34 | "ember-cli-babel": "^6.6.0", 35 | "fastboot-transform": "^0.1.2", 36 | "gsap": "^1.19.1" 37 | }, 38 | "devDependencies": { 39 | "broccoli-asset-rev": "^2.4.5", 40 | "ember-ajax": "^3.0.0", 41 | "ember-cli": "~2.17.1", 42 | "ember-cli-dependency-checker": "^2.0.0", 43 | "ember-cli-eslint": "^4.2.1", 44 | "ember-cli-fastboot": "1.0.0-rc.2", 45 | "ember-cli-htmlbars": "^2.0.1", 46 | "ember-cli-htmlbars-inline-precompile": "^1.0.0", 47 | "ember-cli-inject-live-reload": "^1.4.1", 48 | "ember-cli-qunit": "^4.1.1", 49 | "ember-cli-shims": "^1.2.0", 50 | "ember-cli-sri": "^2.1.0", 51 | "ember-cli-uglify": "^2.0.0", 52 | "ember-disable-prototype-extensions": "^1.1.2", 53 | "ember-export-application-global": "^2.0.0", 54 | "ember-load-initializers": "^1.0.0", 55 | "ember-resolver": "^4.0.0", 56 | "ember-source": "~2.17.0", 57 | "ember-try": "0.2.22", 58 | "loader.js": "^4.2.3" 59 | }, 60 | "engines": { 61 | "node": "^4.5 || 6.* || >= 7.*" 62 | }, 63 | "ember-addon": { 64 | "configPath": "tests/dummy/config" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | test_page: 'tests/index.html?hidepassed', 4 | disable_watching: true, 5 | launch_in_ci: [ 6 | 'Chrome' 7 | ], 8 | launch_in_dev: [ 9 | 'Chrome' 10 | ], 11 | browser_args: { 12 | Chrome: { 13 | mode: 'ci', 14 | args: [ 15 | '--disable-gpu', 16 | '--headless', 17 | '--remote-debugging-port=9222', 18 | '--window-size=1440,900' 19 | ] 20 | }, 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /tests/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | embertest: true 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Application from '@ember/application'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | const App = Application.extend({ 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix, 9 | Resolver 10 | }); 11 | 12 | loadInitializers(App, config.modulePrefix); 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/components/draggable-item.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import { Draggable } from 'gsap'; 3 | 4 | export default Ember.Component.extend({ 5 | tagName: 'div', 6 | classNames: ['draggable'], 7 | 8 | didInsertElement() { 9 | this._super(...arguments); 10 | 11 | Draggable.create(this.element, { type:"rotation", throwProps:true }); 12 | 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /tests/dummy/app/components/ember-logo.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Component.extend({ 4 | tagName: 'div', 5 | classNames: ['image-w', 'ember-logo'], 6 | }); 7 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/application.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import { TweenLite, easing } from 'gsap'; 3 | 4 | const { Power2, Elastic } = easing; 5 | 6 | export default Ember.Controller.extend({ 7 | appName: 'gsap', 8 | 9 | actions: { 10 | gsapTest() { 11 | const page = document.documentElement; 12 | const targetElement = document.querySelector('h1'); 13 | const emberLogo = document.querySelector('.ember-logo'); 14 | 15 | // Body Tween 16 | new TweenLite(page, 1, { 17 | ease: Power2.easeOut, 18 | backgroundColor: '#1A1E24', 19 | }); 20 | 21 | // Copy Tween 22 | new TweenLite(targetElement, 2.0, { 23 | ease: Elastic.easeOut, 24 | scale: 1.4, 25 | color: '#E34C32', 26 | }); 27 | 28 | // Logo Tween 29 | new TweenLite(emberLogo, 1.3467, { 30 | ease: Elastic.easeOut, 31 | x: 0, 32 | delay: 2.5 33 | }); 34 | 35 | }, 36 | 37 | scrollToTest() { 38 | TweenLite.to(window, .5, { scrollTo: 400 }); 39 | } 40 | 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | 12 | 13 | 14 | 15 | {{content-for "head-footer"}} 16 | 17 | 18 | {{content-for "body"}} 19 | 20 | 21 | 22 | 23 | {{content-for "body-footer"}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import EmberRouter from '@ember/routing/router'; 2 | import config from './config/environment'; 3 | 4 | const Router = EmberRouter.extend({ 5 | location: config.locationType, 6 | rootURL: config.rootURL 7 | }); 8 | 9 | Router.map(function() { 10 | }); 11 | 12 | export default Router; 13 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/routes/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 12px 16px; 3 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 4 | font-size: 12pt; 5 | padding-bottom: 400px; 6 | } 7 | 8 | h1 { 9 | transform-origin: 0 0; 10 | } 11 | 12 | .image-w img, .image-w svg { 13 | display: block; 14 | width: 100%; 15 | height: auto; 16 | } 17 | 18 | .ember-logo { 19 | max-width: 100px; 20 | transform: translateX(-120%) 21 | } 22 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

ember-{{appName}}

2 | 3 | 4 | 5 | {{ember-logo}} 6 | 7 | {{#draggable-item}} 8 |

DRAG ME

9 | {{/draggable-item}} 10 | 11 | 12 | 13 |
14 | 15 | Test app made by @sherriffderek 16 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/dummy/app/templates/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/draggable-item.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/ember-logo.hbs: -------------------------------------------------------------------------------- 1 | 4 | 40 | 47 | 53 | 54 | 55 | 65 | 67 | 70 | 73 | 76 | 80 | 83 | 84 | 87 | 90 | 93 | 97 | 99 | 102 | 106 | 108 | 109 | 117 | 118 | 119 | 128 | 129 | 130 | 133 | 134 | 135 | 138 | 139 | 140 | 146 | 147 | 158 | 160 | 163 | 165 | 168 | 169 | 171 | 172 | 175 | 176 | 178 | 179 | 180 | 182 | 183 | 184 | 185 | 186 | 187 | 189 | 190 | 191 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 201 | 202 | 203 | 205 | 206 | 207 | 208 | 209 | 210 | 233 | 234 | 236 | 237 | 258 | 259 | 260 | 277 | 278 | 279 | 281 | 282 | 283 | 285 | 286 | 287 | 288 | 289 | 290 | 292 | 293 | 300 | 301 | 302 | 303 | 305 | 306 | 307 | 308 | 322 | 323 | 324 | 338 | 339 | 341 | 342 | 347 | 348 | 349 | 350 | 352 | 353 | 354 | 356 | 357 | 358 | 361 | 366 | 367 | 368 | 370 | 371 | 372 | 374 | 375 | 381 | 382 | 383 | 384 | 386 | 387 | 388 | 390 | 391 | 392 | 394 | 395 | 396 | 399 | 400 | 401 | 405 | 406 | 420 | 421 | 422 | 423 | 425 | 427 | 428 | 429 | 431 | 433 | 434 | 435 | 436 | 437 | 442 | 443 | 444 | 446 | 447 | 448 | 450 | 451 | 452 | 454 | 455 | 456 | 458 | 459 | 460 | 462 | 463 | 464 | 466 | 467 | 468 | 469 | 470 | 471 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 486 | 487 | 488 | 490 | 491 | 492 | 493 | 494 | 510 | 528 | 529 | 530 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | module.exports = function(environment) { 5 | let ENV = { 6 | modulePrefix: 'dummy', 7 | environment, 8 | rootURL: '/', 9 | locationType: 'auto', 10 | EmberENV: { 11 | FEATURES: { 12 | // Here you can enable experimental features on an ember canary build 13 | // e.g. 'with-controller': true 14 | }, 15 | EXTEND_PROTOTYPES: { 16 | // Prevent Ember Data from overriding Date.parse. 17 | Date: false 18 | } 19 | }, 20 | 21 | APP: { 22 | // Here you can pass flags/options to your application instance 23 | // when it is created 24 | } 25 | }; 26 | 27 | ENV['ember-gsap'] = { 28 | plugins: [ 29 | 'draggable', 30 | 'scrollTo' 31 | ] 32 | }; 33 | 34 | if (environment === 'development') { 35 | // ENV.APP.LOG_RESOLVER = true; 36 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 37 | // ENV.APP.LOG_TRANSITIONS = true; 38 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 39 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 40 | } 41 | 42 | if (environment === 'test') { 43 | // Testem prefers this... 44 | ENV.locationType = 'none'; 45 | 46 | // keep test console output quieter 47 | ENV.APP.LOG_ACTIVE_GENERATION = false; 48 | ENV.APP.LOG_VIEW_LOOKUPS = false; 49 | 50 | ENV.APP.rootElement = '#ember-testing'; 51 | } 52 | 53 | if (environment === 'production') { 54 | // here you can enable a production-specific feature 55 | } 56 | 57 | return ENV; 58 | }; 59 | -------------------------------------------------------------------------------- /tests/dummy/config/targets.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | module.exports = { 3 | browsers: [ 4 | 'ie 9', 5 | 'last 1 Chrome versions', 6 | 'last 1 Firefox versions', 7 | 'last 1 Safari versions' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/destroy-app.js: -------------------------------------------------------------------------------- 1 | import { run } from '@ember/runloop'; 2 | 3 | export default function destroyApp(application) { 4 | run(application, 'destroy'); 5 | } 6 | -------------------------------------------------------------------------------- /tests/helpers/module-for-acceptance.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import { resolve } from 'rsvp'; 3 | import startApp from '../helpers/start-app'; 4 | import destroyApp from '../helpers/destroy-app'; 5 | 6 | export default function(name, options = {}) { 7 | module(name, { 8 | beforeEach() { 9 | this.application = startApp(); 10 | 11 | if (options.beforeEach) { 12 | return options.beforeEach.apply(this, arguments); 13 | } 14 | }, 15 | 16 | afterEach() { 17 | let afterEach = options.afterEach && options.afterEach.apply(this, arguments); 18 | return resolve(afterEach).then(() => destroyApp(this.application)); 19 | } 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from '../../resolver'; 2 | import config from '../../config/environment'; 3 | 4 | const resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Application from '../../app'; 2 | import config from '../../config/environment'; 3 | import { merge } from '@ember/polyfills'; 4 | import { run } from '@ember/runloop'; 5 | 6 | export default function startApp(attrs) { 7 | let attributes = merge({}, config.APP); 8 | attributes = merge(attributes, attrs); // use defaults, but you can override; 9 | 10 | return run(() => { 11 | let application = Application.create(attributes); 12 | application.setupForTesting(); 13 | application.injectTestHelpers(); 14 | return application; 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for "head-footer"}} 18 | {{content-for "test-head-footer"}} 19 | 20 | 21 | {{content-for "body"}} 22 | {{content-for "test-body"}} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for "body-footer"}} 31 | {{content-for "test-body-footer"}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/integration/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/integration/.gitkeep -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from '../app'; 2 | import { setApplication } from '@ember/test-helpers'; 3 | import { start } from 'ember-qunit'; 4 | 5 | setApplication(Application.create({ autoboot: false })); 6 | 7 | start(); 8 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/tests/unit/.gitkeep -------------------------------------------------------------------------------- /tests/unit/utils/gsap-export-test.js: -------------------------------------------------------------------------------- 1 | import { test, module } from 'qunit'; 2 | 3 | import { A } from '@ember/array'; 4 | 5 | import { 6 | default as gsap, 7 | TweenMax, 8 | TweenLite, 9 | TimelineMax, 10 | TimelineLite, 11 | easing, 12 | plugins, 13 | Draggable 14 | } from 'gsap'; 15 | 16 | import _easing from 'gsap/easing'; 17 | import _plugins from 'gsap/plugins'; 18 | 19 | module('Unit | gsap exports'); 20 | 21 | test('gsap exports an object', (assert) => { 22 | assert.equal(typeof gsap, 'object'); 23 | }); 24 | 25 | test('TweenMax exports a function', (assert) => { 26 | assert.equal(typeof TweenMax, 'function'); 27 | }); 28 | 29 | test('TweenLite exports a function', (assert) => { 30 | assert.equal(typeof TweenLite, 'function'); 31 | }); 32 | 33 | test('TimelineMax exports a function', (assert) => { 34 | assert.equal(typeof TimelineMax, 'function'); 35 | }); 36 | 37 | test('TimelineLite exports a function', (assert) => { 38 | assert.equal(typeof TimelineLite, 'function'); 39 | }); 40 | 41 | test('easing exports an object', (assert) => { 42 | assert.equal(typeof easing, 'object'); 43 | }); 44 | 45 | test('gsap/easing exports an object', (assert) => { 46 | assert.equal(typeof _easing, 'object'); 47 | }); 48 | 49 | const easingTypes = A([ 50 | 'Power1', 'Power2', 'Power3', 'Power4', 51 | 'Back', 'Bounce', 'Circ', 'Cubic', 'Elastic', 52 | 'Expo', 'Linear', 'Sine', 'RoughEase', 53 | 'SlowMo', 'SteppedEase' 54 | ]); 55 | 56 | test('easing exports all easing types', (assert) => { 57 | let keys = A(Object.keys(easing)).filter(s => s !== 'default'); 58 | assert.deepEqual(keys, easingTypes); 59 | }); 60 | 61 | test('gsap/easing exports all easing types', (assert) => { 62 | let keys = A(Object.keys(_easing)).filter(s => s !== 'default'); 63 | assert.deepEqual(keys, easingTypes); 64 | }); 65 | 66 | test('plugins exports an object', (assert) => { 67 | assert.equal(typeof plugins, 'object'); 68 | }); 69 | 70 | test('gsap/plugins exports an object', (assert) => { 71 | assert.equal(typeof _plugins, 'object'); 72 | }); 73 | 74 | test('Draggable exports a function', (assert) => { 75 | assert.equal(typeof Draggable, 'function'); 76 | }); 77 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willviles/ember-gsap/6d14dd4292b321c5d7b6c0346bd3f0c2ffc1b1c3/vendor/.gitkeep -------------------------------------------------------------------------------- /vendor/polyfills/array.includes.js: -------------------------------------------------------------------------------- 1 | Object.defineProperty(Array.prototype, 'includes', { 2 | value: function(searchElement, fromIndex) { 3 | 4 | if (this == null) { 5 | throw new TypeError('"this" is null or not defined'); 6 | } 7 | 8 | // 1. Let O be ? ToObject(this value). 9 | var o = Object(this); 10 | 11 | // 2. Let len be ? ToLength(? Get(O, "length")). 12 | var len = o.length >>> 0; 13 | 14 | // 3. If len is 0, return false. 15 | if (len === 0) { 16 | return false; 17 | } 18 | 19 | // 4. Let n be ? ToInteger(fromIndex). 20 | // (If fromIndex is undefined, this step produces the value 0.) 21 | var n = fromIndex | 0; 22 | 23 | // 5. If n ≥ 0, then 24 | // a. Let k be n. 25 | // 6. Else n < 0, 26 | // a. Let k be len + n. 27 | // b. If k < 0, let k be 0. 28 | var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); 29 | 30 | function sameValueZero(x, y) { 31 | return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y)); 32 | } 33 | 34 | // 7. Repeat, while k < len 35 | while (k < len) { 36 | // a. Let elementK be the result of ? Get(O, ! ToString(k)). 37 | // b. If SameValueZero(searchElement, elementK) is true, return true. 38 | if (sameValueZero(o[k], searchElement)) { 39 | return true; 40 | } 41 | // c. Increase k by 1. 42 | k++; 43 | } 44 | 45 | // 8. Return false 46 | return false; 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /vendor/shims/gsap.js: -------------------------------------------------------------------------------- 1 | /* global define, self */ 2 | 3 | (function() { 4 | 5 | function unavailableAttr(attr) { 6 | var error = attr + " is not available. Either the bower package is missing or your app is in Fastboot Mode."; 7 | 8 | if (attr === 'TweenLite' || attr === 'TweenMax' || attr === 'TimelineLite' || attr === 'TimelineMax') { 9 | this.to = function() { 10 | throw Error(error); 11 | }; 12 | } 13 | 14 | throw Error(error); 15 | } 16 | 17 | function checkAttrAvailable(attr) { 18 | return self[attr] || unavailableAttr; 19 | } 20 | 21 | var availableAttrs = [ 22 | // Timelines 23 | 'TimelineLite', 'TimelineMax', 24 | // Tweens 25 | 'TweenLite', 'TweenMax', 26 | // Easing 27 | 'Power1', 'Power2', 'Power3', 'Power4', 'Back', 'Bounce', 'Circ', 'Cubic', 'Elastic', 'Expo', 'Linear', 'Sine', 'RoughEase', 'SlowMo', 'SteppedEase', 28 | // Plugins 29 | 'Draggable' 30 | ]; 31 | 32 | var attrs = availableAttrs.reduce(function (prev, key) { 33 | prev[key] = checkAttrAvailable(key); 34 | return prev; 35 | }, {}); 36 | 37 | var easing = { 38 | 'Power1': attrs.Power1, 39 | 'Power2': attrs.Power2, 40 | 'Power3': attrs.Power3, 41 | 'Power4': attrs.Power4, 42 | 'Back': attrs.Back, 43 | 'Bounce': attrs.Bounce, 44 | 'Circ': attrs.Circ, 45 | 'Cubic': attrs.Cubic, 46 | 'Elastic': attrs.Elastic, 47 | 'Expo': attrs.Expo, 48 | 'Linear': attrs.Linear, 49 | 'Sine': attrs.Sine, 50 | 'RoughEase': attrs.RoughEase, 51 | 'SlowMo': attrs.SlowMo, 52 | 'SteppedEase': attrs.SteppedEase 53 | }; 54 | 55 | var plugins = { 56 | 'Draggable': attrs.Draggable 57 | }; 58 | 59 | define('gsap', [], function() { 60 | 'use strict'; 61 | return { 62 | 'TweenLite': attrs.TweenLite, 63 | 'TweenMax': attrs.TweenMax, 64 | 'TimelineLite': attrs.TimelineLite, 65 | 'TimelineMax': attrs.TimelineMax, 66 | 'easing': easing, 67 | 'plugins': plugins, 68 | 'Draggable': attrs.Draggable 69 | }; 70 | }); 71 | 72 | define('TweenLite', [], function() { 73 | 'use strict'; 74 | return { 'default': attrs.TweenLite }; 75 | }); 76 | 77 | define('TweenMax', [], function() { 78 | 'use strict'; 79 | return { 'default': attrs.TweenMax }; 80 | }); 81 | 82 | define('TimelineLite', [], function() { 83 | 'use strict'; 84 | return { 'default': attrs.TimelineLite }; 85 | }); 86 | 87 | define('TimelineMax', [], function() { 88 | 'use strict'; 89 | return { 'default': attrs.TimelineMax } ; 90 | }); 91 | 92 | define('gsap/easing', [], function() { 93 | 'use strict'; 94 | return easing; 95 | }); 96 | 97 | define('gsap/plugins', [], function() { 98 | 'use strict'; 99 | return plugins; 100 | }); 101 | 102 | })(); 103 | --------------------------------------------------------------------------------