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
| // Utils | |
| const getIntBetween = (min, max) => { | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } | |
| // Typewriter 'class' | |
| const TypeWriter = function(element = null) { | |
| this.el = element; | |
| this.delay = 0; | |
| this.lastFrame = null; |
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
| const getUserId = async () => { | |
| return new Promise((resolve, reject) => { | |
| const iframe = document.createElement('iframe'); | |
| iframe.onload = () => { | |
| resolve(JSON.parse(iframe.contentWindow.localStorage.getItem('user_id_cache'))); | |
| } | |
| iframe.src = 'about:blank'; | |
| document.body.appendChild(iframe); | |
| }); | |
| }; |