Jump to content
Search Community

akudlac

Premium
  • Posts

    8
  • Joined

  • Last visited

Posts posted by akudlac

  1. 6 hours ago, akapowl said:

     

    So it doesn't remain being orange when scrolling further? Sure.

     

    If you don't mind the content on the left jumping back to the initial view too, the easiest way would be to just remove the "remaining" class on that content-div. What you could also do in that case is change the toggleActions to just "play reverse play reverse".

     

    If you want to keep the content on the left at the last state when scrolling any further, with this setup you would probably have to split that first timeline/ScrollTrigger setup into two individual scroll-triggered timelines/tweens with the one for the content on the left having the exact same setup as the smallTimeline has now but an empty tween in place of the tween that changes the color now...

     

      contentTimeline 
        .to({},{ duration: 0.25 }, 0) 
        .set(relevantContent,{ autoAlpha: 1 }, 0.125)
      ;

     

    ...and the other one that is then only responsible for changing the headings having its toggleActions set to "play reverse play reverse".

     

     

     

     

     

     

    Or alternatively just set up one ScrollTrigger for the headings with the toggleActions as mentioned above, and handle the logic for the visibility-change of the content on the left 'manually' in ScrollTrigger's callbacks, like so:

     

     

     

     

     

     

    If you are fairly new to ScrollTrigger, this example in general might not be the best to get started with though, and I would strongly recommend reading up on how toggleActions and the callback-system work in the ScrollTrigger docs.

     

    Nonetheless, I hope this will help a bit. Good luck woth the project!

     

    I am fairly new to it, and I will read up.

     

    Thank you so much for your extensive help.

    • Like 2
  2. 2 hours ago, akapowl said:

     

    Looks like you are now also tweening on the autoAlpha on that other timeline's tween in the forEach loop that is targetting the texts - and I think that is the cause for the jump back.

     

    Also in the second timeline's tween you created, you are tweening on opacity AND autoAlpha, which really isn't neccessary. autoAlpha is a handy shorthand combination of opacity with visibility being toggled, so better choose one of those - either opacity or autoAlpha.

     

    I removed the autoAlpha from both timeline's tweens and got this (also got rid of the blue color). Is that what you were going for?

     

     

     

     

    Thank you. I knew something was occurring after but couldn't identify it.

     

    Is there a way to remove the styling on the last one( Awesomeness)? 

     

    Sorry for all the basic question, I appreciate the help.

  3. On 11/1/2022 at 3:18 PM, akapowl said:

     

    Welcome to the forum @akudlac

     

    Following the logic of that pen, in the forEach loop over the headlines, create a second ScrollTrigger and tl/tween setup, that is only tweening on the opacity of the element. That ScrollTrigger should have the same vars (start, end, etc.) as the first ScrollTrigger - but instead of the toggleActions, just set once: truethere. Then in your CSS set the opacity of .text to 0.5 and you should be good to go.

     

    Give it a shot yourself and if you get stuck I'll be happy to help you figure out what went wrong with your approach.

     

    Hi,

     

    I tried this. It works on the one element being affected in the loop. When it switches to the next element, it reverts to .5.

  4. Hi,

     

    In the attached CodePen, I'd like the initial state of the text on the right to be opacity 0.5. After an element is turned orange, I'd like its opacity to be 1, while those that haven't yet been orange staying at 0.5.

     

    I've tried using gsap.set with the autoAlpha to .5 initially, while setting the element's CSS class to to 1, but it affects all the elements.

     

    Thanks.

    See the Pen 85fd1433b311d0197397addc90617a77 by akapowl (@akapowl) on CodePen

×
×
  • Create New...