window.addEventListener("load", function () { let animation = gsap.timeline(); setTimeout(() => { $(".page-wrapper").css("overflow", "visible"); }, 3000); setInterval(() => { let x_1 = Math.floor(Math.random() * 36) - 25; let y_1 = Math.floor(Math.random() * 15) - 10; let x_2 = Math.floor(Math.random() * 20) - 14; let y_2 = Math.floor(Math.random() * 13) - 2; // console.log(x_1, x_2, y_1, y_2); animation .to("._404-bg-item-1", { x: `${x_1}em`, y: `${y_1}em`, ease: "none", duration: 15 }) .to( "._404-bg-item-2", { x: `${x_2}em`, y: `${y_2}em`, ease: "none", duration: 15 }, "<" ); }, 1500); });