Jump to content
GreenSock

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

Rodrigo last won the day on April 27

Rodrigo had the most liked content!

Rodrigo

Moderators
  • Content Count

    1,944
  • Joined

  • Last visited

  • Days Won

    164

Rodrigo last won the day on April 27

Rodrigo had the most liked content!

Community Reputation

3,408 Superhero

4 Followers

About Rodrigo

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    Santiago - Chile

Recent Profile Visitors

26,369 profile views
  1. Hi, There is an Ease Visualizer in the blog and in the ease pack docs: https://greensock.com/docs/v3/Eases Is that what you're looking for? As far as I know there isn't a full visualizer/GUI editor out there like the link you provide, but I could be wrong about it. Happy Tweening!!!
  2. One alternative would be to store the ScrollTrigger instance in a constant and after is created access the spacer property where you'll find the pin spacer element with the inline styles. @GreenSock Jack, is it safe/recommendable to access the spacer property in a ScrollTrigger instance with the purpose of getting it's inline styles? Another option is to directly access the parent of the element of the trigger property of the ScrollTrigger instance. Be aware that sometimes this could be another element, so you might want to wait a few milliseconds to access it or you'll
  3. Hey, First, you have the same issue as in your other post. Your useEffect() hook doesn't have a dependencies array passed to it, so when you update the showNavbar state value, the entire useEffect hook runs again, that's why when you don't upate the state in the ScrollTrigger callbacks nothing goes wrong. Pass an empty array and see if it works. Second, free React advice. Is there any need to have the logic to show/hide the navbar component in it's parent component? Normally is better to keep that inside the component itself, with that your code becomes a bit unpredicta
  4. Hi, A couple of things. First you created three different posts for the same autoalpha issue, please try to keep it to just one, the admin/mod staff always try as hard as possible to answer every question as fast as possible, no need to re-post, you'll only caught out attention the wrong way. Second, I see a couple of issues in the React side of your code. Your useEffect() hook doesn't have a dependencies array passed to it as the second parameter, that means that the entire code in that block will run everytime the state of the component is updated or a prop passed to
  5. I think this is a FF issue on Mac OS. FF 83 in windows 10 Pro I see the exact same animation I see in Chrome. Finally I ran a couple of tests in Browserstack on Mojave an Catalina and it works on both using FF 83. Perhaps other users could check in similar setups and share their findings. Happy Tweening!!!
  6. Hi and welcome to the GreenSock forums. Could you setup a live reduced sample in codesandbox in order to have a better look at it? https://codesandbox.io/ They have a VueJS template based (I believe in Vue CLI) so setting it up is not too complicated. This is a simple example of a GSAP app with Vue in codesandbox, feel free to fork it and adapt it to your scenario: https://codesandbox.io/s/l261n378km Happy Tweening!!!
  7. Hey, This sample in the GreenSock collection uses snapping for the horizontal sections: https://codepen.io/GreenSock/pen/XWmEoNg This fork I made comments out the snapping code and sets scrub to true in order to move the elements based just on the scroll position: https://codepen.io/rhernando/pen/qBaWwWB?editors=0010 You could also move the entire container as well in order to tween just one element, but the CSS and HTML of those samples are simple enough to be added in any other app. Happy Tweening!!!
  8. I always use this approach and it works fine: import { gsap } from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; if (typeof window !== "undefined") { gsap.registerPlugin(ScrollTrigger); } Keep in mind that process.browser is an environmental variable from webpack, not NextJS, so you shouldn't rely on it for production. You can check other ways to do that in this article: https://dev.to/vvo/how-to-solve-window-is-not-defined-errors-in-react-and-next-js-5f97 Happy Tweening!!!
  9. Hey Fernando, First keep in mind that Express is simply a server-side library that makes working with Node's HTTP and HTTPS modules quite simple and easy. What express does is receive a request from the browser, takes the Handlebars templates you pass to it, transforms them into HTML documents and send them back to the browser as a response, nothing more. If you want to serve the GSAP files directly from the express server (I don't recommend it), you'll have to setup either Webpack, Browserify, Gulp or some bundler in order to generate a file from the NPM package and add it to the
  10. Hey, The stagger is not part of the config options of ScrollTrigger, you should move it to the tween config object: let exptl = gsap.timeline({ scrollTrigger:{ trigger: ".z-out", start: "top 85%", end: "top 5%", scrub: 2, markers: true } }); exptl.from(".z-out", { x: 100, opacity: 0, stagger: 1, duration: 1 }); Finally you could explore the batch() method, I believe that would be more appropriate for what you're trying to do: https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.batch() Happy Tweening!!!
  11. The CDN links are not an option? As far as I know whatever you do it will run on the browser. Can you provide more details on the project? Are you using a templating engine for your HTML files? If you do: Which one?
  12. Actually no, since you're not using the instance elsewhere, also, as I said before, at that point you have to take into account what Vue will do after the component is destroyed/unmounted, which could possibly release everything to garbage collection. Honestly I don't have the slightest idea of how Vue handles garbage collection, but I'm pretty sure that is done the right way, otherwise no one would use Vue. Having a reference in the code is close to mention or remember it, soto speak. I'm going to get a little grim here, sorry. Let's say that you have a plant and that plant dies,
  13. Hi and welcome to the forums. Indeed kill() should be enough for what you intend. Mhh I don't know if killAll made it to GSAP 3, I believe that is a v2 method of TweenMax. The best approach I can think of is to use the mounted() hook to add the GSAP instance to the component: mounted: function () { this.animation = gsap.to(/* GSAP config here */); }, beforeDestroy: function () { // Kill the GSAP instance this.animation.kill(); } That would allow to kill as many GSAP instances as you need/want, since you'll have the reference in the specific Vue instance of
  14. Perhaps the only thing not-react-way is the cleanup effect being run at the start of the hook and not in the cleanup function, but besides that Zach's solution is spot on, because He is using a ref to store the GSAP instance so is kept in subsequent re-renders. Then in order to avoid any possible conflicts He creates a new GSAP instance when the component is re-rendered because since the scroll height of each route is different the ScrollTrigger animation might won't happen. Finally He's using a fromTo() instance instead of a from() instance, because you could have issues with GSAP taking the
  15. Rodrigo

    Toggle Animation

    Hi and welcome to the GreenSock forums. The easiest way to toggle a GSAP instance is to toggle it's reversed state. Normally what I do is create the Tween or Timeline paused, then after adding all the config or child instances I reverse it. Since the instance is at 0 seconds there is no change. Then you toggle the reversed() state. This code seems to work in your sample: // Timeline created and paused var tl = gsap.timeline({ paused: true }); function openNav() { animateOpenNav(); var navBtn = document.getElementById("nav"); navBtn.onclick = function (e) { // Toggle
×