Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Posts posted by kvncnls

  1. 14 hours ago, ApplePieGiraffe said:

    Hey, kvncnls! (I think I remember seeing you on Frontend Mentor, as well! 😆)


    I actually ended up storing my animations in a separate file and then importing them into App.svelte, which is where I set up ScrollTrigger and smooth-scrollbar. That way, the script tag for App.svelte wouldn't be like a million lines long. 😅  (Here's the repo, if you want to check it out.)


    This was first time using Svelte and ScrollTrigger together, so there might be a better way to do things, but this worked out okay for this project, I guess. 🙂

    Wow, thanks so much for this!! I honestly don't know much about best practices for Svelte or GSAP, let alone combining them, so this was really great to see what clean code looks like. Thanks again!

    • Like 1
  2. On 5/13/2021 at 4:27 PM, ApplePieGiraffe said:

    Thank you very much, @akapowl!


    The REPL you made works perfectly, so I implemented all of those tips in my project and things are working great, now! As @Dipscom mentioned, I do have to initialize my animations in App.svelte after setting up ScrollTrigger and smooth-scrollbar in order for the animations to play (which, yes, isn't ideal, but I'm just happy that things are working). 😅

    Just to be clear—do I only have to setpinType: transform if I'm using the body as the smooth-scrollbar container? If I decide to switch to a container within the body for the scroll container instead, should I leave it as pinType: fixed?

    Hey APG! I think I've seen you on Frontend Mentor! Awesome to see you working with Svelte AND GSAP (since I use the same haha).


    I'm curious how you're using GSAP with Svelte. Are you putting ALL of your ScrollTrigger animations in the App.svelte file?