Jump to content
Search Community

wpsoul

Business
  • Posts

    89
  • Joined

  • Last visited

Posts posted by wpsoul

  1. 3 hours ago, GreenSock said:

    I read that a few times but I still don't understand what you mean. Can you provide a minimal demo that illustrates the problem? 

     

    Hm, that also sounds odd to me. Why would appendChild() fail? Again, a demo that illustrates the problem would be super duper amazingly helpful. 🙂

    I have backend integrated in system so I can't make demo. Users can change data of animation, so, when it's loaded - it's working but when they change data, for some reason, style tags simply removed and don't add again. But using afterend place style tags outside block and it's working

     

    It will be good to have parameter in Splittext to exclude some inner tags. <style> is not only the one which we may want to exclude from text animations. For example, I can have block with text and also table that  is generated on fly. I want to add text animation to everything in block but except table

  2. @GreenSock

     

    style tags are only in backend, because we need to add some conditional styles. 

     

    Code is working for first animation but failed when I do update. I replaced appendChild to .insertAdjacentElement('afterend', style))); and I think it's working fine

  3. I found weird behavior in Split Text. If content has style tags

     

    <div id="text">
      Some text
      <style>.example{color:red}</style>
    </div>

    it also divided on chunks

     

    <div style='position:relative;display:inline-block;' class='gsap-g-word'><div style='position:relative;display:inline-block;' class='gsap-g-char'>.</div><div style='position:relative;display:inline-block;' class='gsap-g-char'>e</div><div style='position:relative;display:inline-block;' class='gsap-g-char'>x</div>...

    How to prevent it from touching style tags? 

  4. Checked the documentation but can't find answers. I want to create a vertical timeline when the line is animated and when it reaches a specific point, it triggers svg shape to scale on it. But I can't find any information on how to make proper relative timelines when I use a scrub. I see that the animation starts at different time when I set different duration of animations.

     

    so, my code is like

    let tl - gsap.timeline({scrollTrigger: {trigger: "#id"start: "top top", end: "+=100%"}});

    tl.to("#id", {scaleY: 1, duration: 2});
    tl.from("#id2", {scale: 0, duration: 1}, '<+=1');

     

    I thought that the second animation should start when I reached the middle point of the first animation, but it's starting at 75%. So, how it's calculated?

     

  5. On 8/14/2023 at 10:00 AM, GreenSock said:

    I don't have much time at the moment, but from a cursory glance the issue is that you set the scroller incorrectly.

     

    So, there is no way to use Scrolltrigger for Iframes?

  6. 8 hours ago, GreenSock said:

    So you're telling ScrollTrigger to watch one scrollbar, but using an entirely different one to actually scroll things. 


    yes, and that’s the main problem. When I try to use Iframe object as scroller, it’s completely broken, I don't see scroll markers at all in this case. Without providing scroller, it’s calculating parent window and again it’s broken. So, currently it’s not clear what to set in such scenario 

  7. Ok, i tried on all services and they can't have iframes.

     

    So, I made on my site. It's simple HTML page so you can copy it to local environment for testing

     

    Iframe control for Scrolltrigger

     

    See how markers are working for animated object. They are not moving when you scroll down, so I need somehow to keep scroller for block wrapper around Iframe, but still detect animated objects which are inside Iframe

  8. On 8/11/2023 at 9:33 AM, GreenSock said:

    @wpsoul we're not aware of any issues with ScrollTrigger having wrong positions in an iframe; please provide a minimal demo 

     

    I have the same problem as mentioned above - I can't make codepen demo because it doesn't allow to inject cross domain iframes

     

    So, I have possible two ways of solving.

     

    1. Hard coding core GSAP files

    2. Modifying trigger to use proper scroller

     

    Biggest problem is that my iframe is generated automatically in CMS and scripts are possible to add:

     

    1. Outside and inside iframe. In this way GSAP goes crazy and is applying animations twice. Scrolltrigger added also twice, on inner iframe window and on parent window

    2. Only outside iframe. In this way animations are correct but ScrollTrigger uses wrong position. I tried to use something like

     

    elementDocument.defaultView.frameElement

    elementDocument

    elementDocument.defaultView

     

    where elementDocument is getting from useRef.current.ownerDocument

     

    and then attach it to scroller property but it fails in proper detection of scroll position

     

    So, the question is - if GSAP scripts are loaded outside iframe and we use React to add animations to iframe, is it possible to dynamically assign proper scroller window to ScrollTrigger?

     

  9. App is fine, all other gsap animations are working. And I use context cleaning already. This app is for WordPress which has additional react functionality, I guess that problem is because text is inside Richtext editor, which also manipulates text. Unfortunately, I can't make any kind of demo so I can't see how you can help. It's not very critical in current point.

     

    I fount temporal fix. Instead of dealing with text, I just check if block has inner div and simply change textobject for something like textobj.querySelector('div')

    This works, but unfortunately, GSAP makes more lines. When I have 2 lines of text, it's making 4 lines and here I gave up. Better to keep previous logic when whole block is line, it's not so critical like wrong line break 

  10. Maybe, I am wrong because I used "words" type before. I checked now and such problem is only when dividing by lines. 

     

    Unfortunately, your solution doesn't work for me in React, it's breaking whole text and merging it, words and chars type totally destroyed . So, I will keep as is.

  11. I continue to get a lot of issues with stagger in last update. I found that when I have several animations on page with ScrollTrigger + stagger + .from direction, then it works really bad. Sometimes it loads correctly, sometimes it doesn't hide element (even those which are not in first screen), sometimes animation is not finished.

     

    What was changed in last update for staggers?  3.10 version - hide element before animation, it's correct. 3.11 - sometimes it hides, sometimes it doesn't

     

     

    See the Pen yLjaMxv by igor-sunz (@igor-sunz) on CodePen

    See the Pen JjvRQrN by igor-sunz (@igor-sunz) on CodePen

    • Like 1
×
×
  • Create New...