Jump to content
Search Community

LReds29

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by LReds29

  1. That's it... thank you very much. I only need to refine the first layer but that's on me.
  2. Hello GreenSock, thanks for the reply... but this is almost what I want. Transformation-wrapper doesn't need to hide or appear, is just the wrapper of the layers that I want to show up one by one... I tried something like: const tl = gsap.timeline({ scrollTrigger: { trigger: ".transformation-wrapper", start: "top top", end: "bottom 20%", markers: true, scrub: 1, pin: true }, }) tl.fromTo(".transformation-layer:first-child", { autoAlpha: 1, duration: 0.3 },{ autoAlpha: 0, duration: 0.1 } ) // show .fromTo(".transformation-layer:nth-child(2)", {autoAlpha: 1, duration: 0.3 },{ autoAlpha: 0, duration: 0.1 } ) .fromTo(".transformation-layer:nth-child(3)", ... )... So every layer behind/below the previous will show up, just like a carousel effect does... but the thing is... it appears overlaping the image and the text, due that is no background on each layer...
  3. Hello people, I'm calling to you for help. I'm new to gsap and with Scroll Trigger too. After playing around I see that's very easy to set and make animations to elements, and I know that maybe what I'm asking is very easy, but I can't find how to do it, I've been struggling for a few days... maybe I'm not clearly understand the tween to and fromTo methods. So, the thing is: I have a group of layers one above the other due the z-index property which I set on start: gsap.set(".transformation-layer", { zIndex: (i, target, targets) => targets.length - i, //backgroundColor: (i, target, targets) => `#${Math.floor(Math.random()*16777215).toString(16)}`, }); Please ignore the background, this is the property that I have conflict with. I have 5 layers, which the first one gets z-index:5, the second one z-index: 4 and so on... They're inside a wrapper wich is the one who triggers the animation: gsap.to(".transformation-layer:not(:last-child)", { yPercent: -90, opacity: 0, ease: Power3.easeOut, stagger: 0.5, scrollTrigger: { trigger: ".transformation-wrapper", start: "top top", end: "bottom 20%", markers: true, scrub: 1, pin: true }, }); So, right now every layer is visible because there is no background, and I need it to be like that. So my question is how I should put the visibility from 0(start) then 1(meanwhile scroll trigger acts) and then to 0(when the scroll of the layer ends). Or having this visibility: hidden in the css as a starter state. Then when I scroll to the layer it appears on the beginning and hiddens again on the end. Wanna know if I'm explaining myself correctly. Thanks in advance
×
×
  • Create New...