Jump to content
Search Community

gmullinix

Business
  • Posts

    39
  • Joined

  • Last visited

About gmullinix

Recent Profile Visitors

2,762 profile views

gmullinix's Achievements

  1. Got this working for two different scenarios I often run into. I'm happy with the solve for #1, but would appreciate some eyes on my solve for #2 Scenario #1 --------------------- Problem: Div height changes because of media query Solution: Swap start value at breakpoint using MatchMedia In this example, the pages are full height above 769px but swap to height: auto for mobile. Since there is a clear pixel value for the breakpoint, I used Match Media contexts to change my start value. Seems pretty straightforward and easy to code. 👍🏻 https://codepen.io/gem0303/pen/LYqNmJJ Scenario #2 --------------------- Problem: Div height changes because translated text is different lengths Solution: Start function checks the height of the div and returns different start point if div is too short Some context on this example: we create content that is translated into 20+ languages. Some languages have very long translations (German, Russian) while others are quite short (symbol languages like Japanese and Korean). This means we occasionally run into short languages not triggering start values depending on layout and/or screen size. We typically avoid coding custom animations on a per-language basis because we build tons of these. In my solution, I wrote a function that checks the div height against the window height and returns a different start value if needed. Haven't tested thoroughly but seems to be working ok. Thoughts? I couldn't figure out how "clamp()" would help me in this instance (though the video linked by @mvaneijgen was excellent, thank you for including it). https://codepen.io/gem0303/pen/LYqNrxo I envisioned the Scrolltrigger would be watching both of the start values and fire when it hits either/any of them. Subsequent hits would just be ignored.
  2. Would it be possible to add a feature to Scrolltrigger to support multiple start values? Here's the use case: I have an element with a start value of "top 40%". However it's a short div located near the end of the page. On certain mobile devices, the top of the div never reaches the 40% mark, so the Scrolltrigger never fires. If I could pass in a second start value of "bottom bottom" as backup, then I know the tween will always fire regardless of the screen size. I know a workaround is to set up two ST's with different start values using matchMedia, but was hoping for a simpler solution. Possible way it could look, passing in an array of values: gsap.from("#el", { scrollTrigger: { trigger: "#el", start: ["top 40%", "bottom bottom"] }, y: 200 });
  3. Habit, I guess. ? The menu is animated with GSAP. There was a CSS transition leftover in my CSS code for a different element that wasn't doing anything. I removed it for clarity. And good news, I was able to fix the issue with a force3D: false on the tween. Thanks for that tip!
  4. First of all, I'm pretty sure this is a browser issue and not any kind of bug in GSAP, but I'm posting here in hopes someone knows how to fix it. In the attached Codepen, the #main_wrapper is set up to transform: scale to fit the window. As the blue #menu animates left and right, it will leave behind some streaks of blue. The streaks only appear in Chrome and new Edge. The streaks will not appear if I remove the transforms on #main_wrapper. They also won't appear if I put a will-change: transform on #menu. Anyone have ideas on how to fix this, or should I open an issue at bugs.chromium.org? Hesitant to use will-change unless there's no other solution.
  5. It appears to be the OS scaling specifically. I was able to recreate the shaking effect in my project by scaling my display to 150% and viewing it in Chrome. Unfortunately, only my project breaks. Your Codepen works fine. I spent a few hours debugging and trying to pinpoint what is causing the error in my project, but was unable to isolate a specific cause. I have a lot of element and div heights based on vw and %ages, so perhaps that is the culprit. I also figured out if I set the #main_wrapper's overflow-y to hidden, it hides the issue since the extra scrollbar will never appear.
  6. Had a bug report from a user on a 4K monitor who has the Windows OS zoomed/scaled. When he reaches the horizontal scroll section, the entire screen starts to shake. It appears that a scrollbar is rapidly appearing and vanishing on the #main_wrapper (the pinned div). If he turns off the Windows OS zoom, the problem goes away. The issue only happens in Chrome, not Firefox. He had the most current versions of both browsers. The problem also went away if I pin just the horizontal scroll section, though the effect isn't as nice (the panels don't stick together). Have you encountered bugs like this before? Any suggestions or theories on how to fix it for Chrome?
  7. This works beautifully! Thank you for the quick reply, and also thank you for the cleaner syntax in the horizontal_scroll_tl scrollTrigger object.
  8. I have a project with a bunch of panels, all stacked vertically. There are images inside some panels that animate via Scrolltriggers attached to that panel. There is also one fancy panel that gets pinned, content inside it animates horizontally, then the panel unpins at the end. However, I don't want the fancy panel to visually separate from the panels above and below it, so I made its Scrolltrigger pin the entire main_wrapper, with some custom math to determine the start pin location. However, this breaks the Scrolltriggers for panels underneath the fancy panel. In the codepen, you will see the red squares in panels #B and #C animate even though they are not at "top 0%". I'm assuming pinning the main wrapper is causing the issue. You can also see some commented out code that fixes the problem, but there's a whole function involved with extra steps to get the correct math. In my actual project, I have 20+ divs to animate below the fancy one, and would prefer to not customize a start function for all of them. Any suggestions on how to fix this code so a) all of the panels stick together on the screen, and b) the panels under the fancy panel animate at the appropriate start point? Thank you for your time!
  9. I often play around with eases in the Ease Visualizer and copy the code from there, into my project. The code used to copy/paste cleanly, like this: ease: "power2.out" Now, it copy/pastes poorly with extra data: ease: " power2. out out" Did something change in the visualizer to break the old functionality?
  10. Set up your timeline as a .to like your second example, and then immediately set the progress of that timeline to 1. You might also want to pause the timeline by default, so there isn't a flash of animation as it starts to render before setting the progress. https://codepen.io/gem0303/pen/WNQxpOX
  11. @ZachSaucier Thanks for the info. We will do our best to be patient! In the meantime, we're going to use the Intersection Observer unless you have a different suggestion.
  12. My team is really interested in this as well. Is there an estimated release date for either a beta or final version? Any way to be notified when it's available? (I'm signed up for the newsletter but it seems like only big/major releases are announced there.)
  13. Getting some weird behavior when animating elements with the sine ease. The boxes should all start from display: none, animate to display: flex, and then animate back to display: none. However, boxes animated with the sine ease do not follow this logic and are set to display: flex at the wrong times. Additionally, sine vs sine.in seem to break in different ways. I tested with several other eases and did not encounter this same problem. Please see the Codepen for more details.
  14. I changed your "from" tween to a "fromTo" and it appears to animate as desired. Also, autoalpha automatically sets the "visibility" and "opacity" properties so no need to specify it in the tween. https://codepen.io/gem0303/pen/PoqGdyv
  15. Here's some places I have bookmarked. Obviously don't have to use the library, you can just recreate the effect on your own. Converting CSS animations to GSAP animations is good practice, too. https://tympanus.net/Development/PageTransitions/ jsfiddle version: http://jsfiddle.net/EbhdM/3/ https://codepen.io/chriscoyier/pen/ydrGYw https://codepen.io/chriscoyier/pen/EBLZVG https://www.minimamente.com/project/magic/ https://daneden.github.io/animate.css/ https://css-tricks.com/css-animation-libraries/
×
×
  • Create New...