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
(() => { | |
let points = [] | |
const handleClick = (event) => { | |
const section = event.target.closest('section') | |
if (!section) return | |
const rect = section.getBoundingClientRect() | |
const sectionWidth = rect.width | |
const x = (event.clientX - rect.left) / sectionWidth * 100 |
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 waitForLoad = fn => { | |
if(document.readyState === 'loading'){ | |
document.addEventListener('DOMContentLoaded', fn) | |
} else { | |
fn() | |
} | |
} |
OlderNewer