Last active
January 10, 2018 17:58
-
-
Save nightire/e8f43eeb87e0fc9e8d6dd7b517b9c980 to your computer and use it in GitHub Desktop.
Web Animation with Ember
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from 'ember-controller'; | |
export default class ApplicationController extends Controller { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from 'ember-route'; | |
export default class ApplicationRoute extends Route { | |
activate() { | |
super.activate(...arguments); | |
document.body.classList.add('standard'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from 'ember-component'; | |
export default class AnimElemComponent extends Component { | |
didInsertElement() { | |
this.player = this.element.animate([ | |
{ left: '100px', width: '600px' } | |
], { | |
duration: 500, | |
easing: 'linear', | |
delay: 500, | |
iterations: 1, | |
fill: 'forwards' | |
}); | |
this.set('status', this.player.playState); | |
this.player.ready.then(() => { | |
this.set('status', this.player.playState); | |
}); | |
this.player.onfinish = () => { | |
this.set('status', this.player.playState); | |
}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from 'ember-controller'; | |
export default class IndexController extends Controller { | |
start() { | |
this.toggleProperty('running'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from 'ember-route'; | |
export default class IndexRoute extends Route { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.anim-elem { | |
position: fixed; | |
left: 200px; | |
padding: 1rem; | |
width: 200px; | |
height: 400px; | |
box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.2", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"hack": "//cdn.staticfile.org/hack/0.7.7/hack.css", | |
"standard": "//cdn.staticfile.org/hack/0.7.7/standard.css", | |
"jquery": "//cdn.staticfile.org/jquery/3.2.1/jquery.min.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-truth-helpers": "2.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment