Gsap Animation

Animation Builder with GSAP

Create a visually dynamic experience using GSAP-powered transitions. From hover effects to animated NFT reveals, everything feels alive and interactive—without needing heavy JavaScript skills.

use a context so that if this is called from within another context or a gsap.matchMedia(), we can perform proper cleanup like the "resize" event handler on the window

The returned timeline will have the following methods added to it: osmo.js// project slider

  • next() - animates to the next element using a timeline.tweenTo() which it returns. You can pass in a vars object to control duration, easing, etc.

  • previous() - animates to the previous element using a timeline.tweenTo() which it returns. You can pass in a vars object to control duration, easing, etc.

  • toIndex() - pass in a zero-based index value of the element that it should animate to, and optionally pass in a vars object to control duration, easing, etc. Always goes in the shortest direction

  • current() - returns the current index (if an animation is in-progress, it reflects the final index)

Javascript files

// gsap slider
gsap.registerPlugin(CustomEase, Flip )

CustomEase.create("osmo-ease", "0.625, 0.05, 0, 1")

gsap.defaults({
  ease: "osmo-ease",
  duration: 0.8,
});

function initFlipButtons() {
  ...
}

Example

Looping words
<div class="looping-words lg">

    <div class="looping-words-containers">
        <div data-looping-words-list="" class="looping-words-list">

            <div class="looping-words-list">
                <div class="looping-words-p">
                    ...
                </div>
            </div>

            <div class="looping-words-list">
                <div class="looping-words-p">
                    ...
                </div>
            </div>

            <div class="looping-words-list">
                <div class="looping-words-p">
                    ...
                </div>
            </div>

            <div class="looping-words-list">
                <div class="looping-words-p">
                    ...
                </div>
            </div>

            <div class="looping-words-list">
                <div class="looping-words-p">
                    ...
                </div>
            </div>

        </div>
    </div>

    <div class="looping-words-fade"></div>
    
    <div data-looping-words-selector="" class="looping-words-selector">

        <div class="looping-words-edge"></div>
        <div class="looping-words-edge is--2"></div>
        <div class="looping-words-edge is--3"></div>
        <div class="looping-words-edge is--4"></div>

    </div>

</div>

Last updated