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
| /******* | |
| * MATH | |
| *******/ | |
| // http://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range | |
| export const randInt(min, max) { | |
| min = Math.ceil(min); | |
| return Math.floor(Math.random() * (Math.floor(max) - min + 1)) + min; | |
| } | |
| export const randFloat = (min, max) => (Math.random() * (max - min) + min); |
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
| class Loop { | |
| constructor() { | |
| this._idRAF = -1; | |
| this._count = 0; | |
| this._listeners = []; | |
| this._binds = {}; | |
| this._binds.update = this._update.bind(this); |
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
| class SizeControl { | |
| constructor() { | |
| this._width = null; | |
| this._height = null; | |
| this._action = null; | |
| this._onMobile = this._mobileCheck(); | |
| window.addEventListener('resize', this._onResize.bind(this), false); | |
| window.addEventListener('orientationchange', this._onResize.bind(this), false); |
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
| class LetterTransition { | |
| constructor(element, style) { | |
| this.element = element; | |
| this.text = this.element.innerText; | |
| this.element.innerText = ''; | |
| this.letters = []; | |
| let i; | |
| let key; | |
| for (i = 0; i < this.text.length; i++) { |
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
| h1, | |
| h2, | |
| h3, | |
| h4, | |
| h5, | |
| h6, | |
| p, | |
| blockquote { | |
| margin: 0; | |
| padding: 0; |
NewerOlder