Last active
October 11, 2017 07:30
-
-
Save GavinJoyce/abd363c19a51d4c0c0764853dd461d16 to your computer and use it in GitHub Desktop.
drums
This file contains hidden or 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
| //http://www.javascriptkit.com/javatutors/requestanimationframe.shtml | |
| //http://learncssgrid.com/ | |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| _scroll() { | |
| let $el = document.getElementsByClassName('tracks-container')[0]; | |
| let maxScrollLeft = $el.scrollWidth - $el.clientWidth; | |
| if($el.scrollLeft < maxScrollLeft) { | |
| $el.scrollLeft += 1; | |
| /*Ember.run.later(this, function() { | |
| this._scroll(); | |
| }, 6);*/ | |
| window.requestAnimationFrame(() => { //see http://www.javascriptkit.com/javatutors/requestanimationframe.shtml | |
| console.log(1); | |
| this._scroll(); | |
| }); | |
| } | |
| }, | |
| actions: { | |
| scroll() { | |
| let $el = document.getElementsByClassName('tracks-container')[0]; | |
| $el.scrollLeft = 0; | |
| //this._scroll(); | |
| window.requestAnimationFrame(() => { | |
| console.log(1); | |
| this._scroll(); | |
| }); | |
| } | |
| } | |
| }); |
This file contains hidden or 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
| .container { | |
| width: 100%; | |
| height: 400px; | |
| background-color: black; | |
| display: grid; | |
| grid-template-columns: 100px auto; | |
| } | |
| .labels { | |
| background-color: #999; | |
| color: white; | |
| } | |
| .tracks-container { | |
| overflow: auto; | |
| white-space: nowrap; | |
| } | |
| .tracks { | |
| display: grid; | |
| width: 1600px; | |
| height: 400px; | |
| grid-template-columns: repeat(64, 40px); | |
| grid-template-rows: auto auto; | |
| } | |
| .beat { | |
| background-color: #333; | |
| border-right: 1px solid #444; | |
| border-top: 1px solid #444; | |
| } | |
| .beat:nth-child(4n) { | |
| color: #ccc; | |
| border-right: 1px solid #666; | |
| } | |
| .beat::before { | |
| content: ""; | |
| background-color: pink; | |
| display: block; | |
| position: relative; | |
| width: 40px; | |
| height: 2px; | |
| top: 100px; | |
| } | |
| .beat .marker { | |
| width: 20px; | |
| height: 20px; | |
| background-color: yellow; | |
| position: relative; | |
| top: 90px; | |
| left: -10px; | |
| z-index: 9; | |
| } | |
| .time { | |
| color: red; | |
| position: absolute; | |
| height: 400px; | |
| background-color: red; | |
| width: 4px; | |
| left: 424px; | |
| z-index: 99; | |
| } | |
This file contains hidden or 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.1", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "2.12.0", | |
| "ember-template-compiler": "2.12.0", | |
| "ember-testing": "2.12.0" | |
| }, | |
| "addons": { | |
| "ember-data": "2.12.1" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment