the home site for me: also iteration 3 or 4 of my site
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: debounce the resize check

+6 -1
+6 -1
templates/shortcodes/is.md
··· 51 51 console.error("Error fetching status update:", error); 52 52 }); 53 53 } 54 + let resizeTimeout; 54 55 function checkTimeWrap() { 55 56 const wrap = document.getElementById("time-ago-wrap"); 56 57 const statusText = document.getElementById("status-text"); ··· 60 61 wrap.classList.toggle("wrapped", wrapTop > statusTop); 61 62 } 62 63 } 64 + function debouncedCheckWrap() { 65 + clearTimeout(resizeTimeout); 66 + resizeTimeout = setTimeout(checkTimeWrap, 100); 67 + } 63 68 document.addEventListener("DOMContentLoaded", fetchStatus); 64 - window.addEventListener("resize", checkTimeWrap); 69 + window.addEventListener("resize", debouncedCheckWrap); 65 70 setInterval(fetchStatus, 3600000); 66 71 </script>