let load = false; (() => { const posts = document.querySelector("#posts"); if(posts) { document.addEventListener("wheel", e => { if((((document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop + window.innerHeight) + 310 >= ((document.documentElement && document.documentElement.scrollHeight) || document.body.scrollHeight)) && !load) { load = true; fetch(`./api/p/${posts.dataset.last}`) .then(res => res.json()) .then((msg, html = "") => { for(let i = 0; i < msg.items.length; i++) if(msg.items[i].id) html += `