Use gsap in this

PHOTO EMBED

Fri Feb 09 2024 19:04:58 GMT+0000 (Coordinated Universal Time)

Saved by @Zohaib77

// Wait for the DOM to be ready
document.addEventListener("DOMContentLoaded", function () {
    // Select the box element
    const box = document.getElementById('box');

    // Use GSAP to animate the box
    gsap.to(box, {
        x: 300, // Destination X position
        duration: 2, // Animation duration in seconds
        ease: "power2.inOut", // Easing function (optional)
        repeat: -1, // Repeat the animation indefinitely
        yoyo: true // Reverse the animation on each repeat
    });
});
content_copyCOPY