Skip to content

Instantly share code, notes, and snippets.

@piouc
piouc / cqw.js
Last active December 20, 2024 08:45
LP
(() => {
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
const waitForLoad = fn => {
if(document.readyState === 'loading'){
document.addEventListener('DOMContentLoaded', fn)
} else {
fn()
}
}