스크롤링 window.addEventListener("scroll", () => { const { scrollTop, scrollHeight, clientHeight } = document.documentElement; if (Math.round(scrollHeight - scrollTop) { loading.classList.remove("show"); setTimeout(() => { page++; showPosts(); }, 300); }, 1000); } setTimeout: 일정시간 후에 함수를 실행한다. 로딩 화면을 띄우고 난 후 setTimeout 함수로 1초 후에 로딩 화면을 지우고, 또다른 setTimeout함수를 실행해 0.3초 후에 다른 포스트들을 띄운다. Post 보여주기 async..