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 PhoneMask { | |
| constructor(element) { | |
| this.element = null; | |
| this.phoneMask = this.phoneMask.bind(this) | |
| this.init(element); | |
| } | |
| init(element) { | |
| this.element = document.querySelector(element); | |
| this.element.addEventListener('input', this.phoneMask); |
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
| @function classConcatNumber($className: '.class-', $from:1, $to:6) { | |
| @if $from == $to { | |
| @return '#{$className}#{$from}'; | |
| } @else { | |
| @return '#{$className}#{$from},' + classConcatNumber($className, $from+1, $to); | |
| } | |
| } | |
| #{classConcatNumber('.col-xs-', 1, 12)}, | |
| #{classConcatNumber('.col-sm-', 1, 12)} { |
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
| $breakpoints: ( | |
| "phone": 400px, | |
| "phone-wide": 480px, | |
| "phablet": 560px, | |
| "tablet-small": 640px, | |
| "tablet": 768px, | |
| "tablet-wide": 1024px, | |
| "desktop": 1248px, | |
| "desktop-wide": 1440px | |
| ); |
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
| // left: 37, up: 38, right: 39, down: 40, | |
| // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
| var keys = {37: 1, 38: 1, 39: 1, 40: 1}; | |
| function preventDefault(e) { | |
| e = e || window.event; | |
| if (e.preventDefault) | |
| e.preventDefault(); | |
| e.returnValue = 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
| .div { | |
| width: 70px; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| white-space: normal; | |
| border: 1px solid #000; | |
| } |
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 EventEmitter { | |
| constructor() { | |
| this.events = {}; | |
| } | |
| on(type, listener) { | |
| this.events[type] = this.events[type] || []; | |
| this.events[type].push(listener); | |
| } |
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
| if (!(Symbol.iterator in Object.prototype)) { | |
| Object.defineProperty(Object.prototype,Symbol.iterator,{ | |
| enumerable: false, | |
| writable: false, | |
| configurable: true, | |
| value: function*() { | |
| var o = this; | |
| var ks = Object.keys(o); | |
| for (var idx = 0, length = ks.length; idx < length; idx++) { | |
| yield o[ks[idx]]; |
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
| <input type="text" | |
| autocomplete="off" | |
| autocorrect="off" | |
| autocapitalize="off" | |
| spellcheck="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
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", | |
| Helvetica, Arial, sans-serif, | |
| "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
| } |
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 Button { | |
| constructor(color) { | |
| this.element = null; | |
| this.color = color; | |
| this.onAdd = () => {}; | |
| this.onInit() | |
| } | |
| onInit() { | |
| this.element = document.querySelector('button'); |