Share Posted May 6, 2022 Hi, Made a five elements timeline animation, they all start together, and I notice that it's like flickering a bit on mobile (safari/chrome). Is that a browser issue like computing power capacity too low? Or maybe because they all start together? Can't reproduce on codepen easily. I leave here the page link and the piece of code. Link (the toggle animation, see the snapshot) That's the whole animation code const toggleTl = gsap.timeline({ scrollTrigger: { trigger: '.toggle-section', pin: true, toggleActions: 'restart play reverse reverse', startTrigger: '.toggle-button', start: 'center center', endTrigger: '.toggle-button', end: () => '+=' + (document.querySelector('.toggle-button').clientWidth * 2), }, }); ScrollTrigger.clearScrollMemory(); toggleTl .to(".toggle-section", { background: 'white', duration: 0.5, ease: 'ease' }, 'start') .to(".toggle-section-text-1", { color: '#1a1a1d', duration: 0.5, ease: 'ease' }, 'start') .to(".toggle", { background: '#1a1a1d', duration: 0.5, ease: 'ease' }, 'start') .to(".toggle-button", { background: 'white', duration: 0.5, ease: 'ease' }, 'start') .to(".toggle-button", { right: 5, transformOrigin: "left center", duration: 0.5, ease: 'ease' }, 'start'); Thank you for your support Link to comment Share on other sites More sharing options...
Share Posted May 6, 2022 It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer. Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo: See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. Link to comment Share on other sites More sharing options...
Share Posted May 6, 2022 46 minutes ago, Meetallo said: Can't reproduce on codepen Why can't you reproduce it easily on codepen? Does the bug not show in codepen, because than maybe something else is interfering. You could try changing your `right: 5,` animation to something more performant like `x:` or `xPercent:` . Also `background:` is a shorthand for a lot in CSS feature, if you just want to animate the `background-color` you'll be better off animating `backgroundColor` 2 Link to comment Share on other sites More sharing options...
Author Share Posted May 9, 2022 Here is the pen See the Pen YzeqNpz by Meetallo (@Meetallo) on CodePen But it seems more fluid on mobile. You can see differences from the first link I sent (wordpress). Link to comment Share on other sites More sharing options...
Share Posted May 9, 2022 Sorry, @Meetallo but I don't understand your question. Can you elaborate? Is that demo not working for you? Seems to work fine for me, but maybe I'm missing something. By the way, "ease" is not a valid ease. Perhaps you meant "power1.inOut"? Link to comment Share on other sites More sharing options...
Share Posted May 9, 2022 I'm not seeing any issues, but if performance is a problem, you may want to consider to do a crossfade between a light and dark version of that section instead of animating colors. Animating opacity is known to be more performant than animating colors. https://csstriggers.com/ 2 Link to comment Share on other sites More sharing options...
Author Share Posted May 10, 2022 Hi @GreenSock, the demo is working for me, but it's like flickering a lot on mobile (on the site linked in the first post, wordpress). i forget to mention that there's two gsap animation on the same page, different sections, could be the reason why it flickers a bit on mobile? Thank you @OSUblake, I'll give it a try for sure. Link to comment Share on other sites More sharing options...
Share Posted May 12, 2022 On 5/10/2022 at 8:41 AM, Meetallo said: Hi @GreenSock, the demo is working for me, but it's like flickering a lot on mobile (on the site linked in the first post, wordpress). i forget to mention that there's two gsap animation on the same page, different sections, could be the reason why it flickers a bit on mobile? I'm not seeing flickering. What device/OS? How can we reproduce the issue? It should be totally fine to have many animations on the page, sure. You're not limited to one ScrollTrigger animation per page. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now