Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by pbj

  1. Currently trying to get an idea going for an animation. Duplicated the started template from GSAP's CodePen and included a started Timeline with ScrollTrigger but noticed its automatically erroring. 


    I haven't done anything too major but saw console log errors. Could there be an issue with the core library?


    Uncaught TypeError: Cannot read properties of undefined (reading 'left')

    ScrollTrigger.min.js:10 Uncaught TypeError: r.revert is not a function

    See the Pen eYKEyzZ?editors=0010 by pbj (@pbj) on CodePen

  2. I've attempted to review other forums and while I see how the solution was created in the other codepens. What I'm not sure about is *why* its working and that seems to be my missing piece for the infinite looping vertical images I'm attempting to create. 


    Effectively copied the codepen from 10/5/21 and it works but i cannot figure out how to get the loop to occur seamlessly without any particular jumping. 




    See the Pen mdKRYxp?editors=0010 by pbj (@pbj) on CodePen

  3. Hopefully this is relatively as straight forward as the title suggests. Using yarn as our package manager and running gsap.matchMedia() fails with the following error

    gsap.matchMedia is not a function

    Curious if there is something particular we need to do? To things:

    1. Apologies if formatting is off, for some reason it's not liking my code!

    2. Will work in a MVP use case to help offset any testing. 

    My file in Vue.js


    import scrollTo from "../../mixins/scrollto";

    import {
    } from "gsap";
    import {
    } from "gsap/ScrollTrigger";


    export default {
        name: "FaqAccordion",
        mounted() {
        methods: {
            initScrollTrigger() {
                let mm = gsap.matchMedia();

                mm.add("(min-width: 768px)", () => {
                    this.faqs.forEach((faq, index) => {
                        const el = document.querySelector(`[data-nav="${faq.handle}"]`);

                            trigger: `#${faq.handle}`,
                            start: "top 50%",
                            end: "bottom 50%",
                            scrub: 1,
                            markers: true,
                            onEnter: ({
                            }) => {
                                console.log('on enter:: ', faq)
                                el.classList.add('bg-cactus', 'text-white')
                            onEnterBack: () => {
                                console.log('on enterback:: ', faq)
                                el.classList.add('bg-cactus', 'text-white')
                            onLeave: ({
                            }) => {
                                console.log('on leave:: ', faq)
                                el.classList.remove('bg-cactus', 'text-white')


    • Like 1
  4. Ahhh okay. I gotcha. I'll keep poking around and re-read the article I was under the impression that article (and tool) just "sort of worked" in that it would translate a path from absolute to relative and then *booom* animation galore! Thank you nonetheless for the quick help!

  5. Hey Cassie!


    This is incredibly helpful! I wanted to confirm one thing: creating a relative path enabled you to then animation correct? 


    Meaning → You had to create a relative SVG to then manipulate in an editing tool, then manipulate with SVGMorph? We have a few areas where we'll need to do this so wanted to make sure we're doing it correctly!

  6. Trying to figure out how to allow the bottom of the SVG to be anchored to the bottom of a div. This feels like a mix of CSS + GSAP issue so happy to be told to go figure it out :)


    What's happening now is this animation works perfectly, *except* it transitions from top down to bottom, but we need the opposite. The ideal flow for this animation is that once the user interacts with the page the circular "cutout" transitions into a flat line. 

    See the Pen abqYQyW by pbj (@pbj) on CodePen

  7. Banging my head a bit. I've got a few Scroll Trigger based animations on the home page of a site and it works flawlessly when in local development. It isn't until we've deployed to a production/staging environment does it break. 


    Effectively what's happening is when we load the site on production/staging all animations run immediately. Not sure if its a component mounting issue (which would mean its not a GSAP issue) or if something is being compiled/computed differently in a live environment? 


    Each section is setup as follows:

    1. Define the animation/scroll trigger in the `mount` lifecycle hook

    2. Use `$refs` to pass elements into the animation. 

        <div id="vid-container" class="h-screen w-screen bg-white">
          <video @loadeddata="loaded" class="w-full fixed inset-0 duration-500 transition-opacity opacity-0" :class="{'opacity-100': videoLoaded}" src="https://player.vimeo.com/external/611257045.hd.mp4?s=785a9d52ed5d188f762436b1bb618493f784d3f5&profile_id=174" autoplay loop muted preload></video>
            class="mask absolute w-full h-full"
            <mask id="mask">
              <rect width="100%" height="100%" fill="white"></rect>
                font-family="Bagnard, serif"
                class="origin-center "
                <tspan x="50%">Freelance</tspan>
                <tspan x="50%" dy="1em">Founders</tspan>
                <tspan style="font-size: .5rem" x="50%" dy="2em">

            <rect id="bg" width="100%" height="100%" fill="#fff"></rect>

      import { gsap } from "gsap";
      import { ScrollTrigger } from "gsap/ScrollTrigger";
      import { CSSRulePlugin } from "gsap/CSSRulePlugin";
      if (process.client) {
        gsap.registerPlugin(ScrollTrigger, CSSRulePlugin);
      export default {  
        data() {
          return {
          videoLoaded: false,  
        mounted() {
          console.log('hero mounted')
          let width = window.innerWidth
          let speed = 350 //pixels per second
          let endX = width
          let duration = endX / speed
          let ease = "sine.inOut"
          let intro = '';
          if (this.$refs.mask) {
            this.$nextTick(() => {
              intro = gsap.timeline({
                onComplete: () => {},
                  trigger: this.$refs.mask,
                  start: "bottom 100%",
                  end: "bottom 50%",
                  pin: true,
                  scrub: true
              intro.to(this.$refs.mask, {
                scale: 5,
                opacity: 0,
                duration: 5,
                ease: ease
              }, 'intro')
        methods: {
          loaded() {
            this.videoLoaded = true;



    Staging link example: https://freelance-founders-hgc9zjyrf-progresslabs.vercel.app/


    FYI - Working on a minimal example to post here shortly.