Jump to content
Search Community

buster808

Members
  • Posts

    51
  • Joined

  • Last visited

Posts posted by buster808

  1. After browser resize the snowboarder position goes off screen and most of the time stops moving on scroll,  everything else works fine, works again if I refresh the browser.

     

    Think I might add refresh browser on resize script and stop on ipad/mobile.

  2. Hi, I have animation here https://xtracreative.co.uk/snow/

    I tried putting on codepen but wouldn't work but will try again zzzzzzzz at mo.

     

    The  snowboarder stops working on browser resize.

     

    I used ScrollTrigger.scrollerProxy() with native maybe this is the issue.

     

    How can i get round this.

     

    I have used two svgs and scrolltriggers for the animation. I couldn't get it too work using one SVG.

     

    Thanks

    See the Pen mdWVKYq by buster808 (@buster808) on CodePen

  3. Yes thats right Rodrigo Ill try your method thanks.

     

    I see this on direction

     

    ScrollTrigger.create({
      trigger: ".trigger",
      start: "top center",
      end: "+=500",
      onUpdate: self => console.log("direction:", self.direction)
    });

     

    Reflects the moment-by-moment direction of scrolling where 1 is forward and -1 is backward.

     

    Just dont know how to code the onUpdate.

     

    My javascript is basic.
     

  4. Hi, its for scrolltrigger - change start and end when scrubbing upwards. As my hero goes off screen when scrubbing upwards. Ill do a pen if this doesnt help

     

    gsap.timeline({
      scrollTrigger:{
      ease: "none",
      trigger: "#demo",
        start: "top +35%",
        end: "bottom +60%",
      scrub: 0.4,

     

    Thanks

  5. Ive got this working mostly but it doesn't work on-load like css media queries. 


    function addMQListener(mq, callback) {
      if (mq.addEventListener) {
        mq.addEventListener("change", callback);
      } else {
        mq.addListener(callback);
      }
    }

    addMQListener(window.matchMedia("(min-width: 768px)"),
      event => {
        if (event.matches) {
            
            gsap.timeline()
            
                .from("#main-hero", {x:50, duration:1, opacity:0, ease:"circ.out", delay:0.5})
                .from("#inspired", {x:100, duration:1, opacity:0, ease:"circ.out"})

        
        } else {
                .from("#main-hero", {y:50, duration:1, opacity:0, ease:"circ.out", delay:0.5})
                .from("#inspired", {y:100, duration:1, opacity:0, ease:"circ.out"})
        }
      }
    );

  6. Hi, Ive gone through previous threads but cant get this to work.

    I want to change timeline settings if on mobile.

    Do I need to kill one timeline then start another?

     

    gsap.timeline()

        .from("#main-hero", {x:50, duration:1, opacity:0, ease:"circ.out", delay:0.5})
        .from("#inspired", {x:100, duration:1, opacity:0, ease:"circ.out"})
        .from("#digital", {x:-100, duration:1, opacity:0, ease:"circ.out"}, "-=0.8")
        .from("#design", {x:100, duration:1, opacity:0, ease:"circ.out"}, "-=0.8")

     

    Thanks for any help

  7. Hi, If Im using an html img like below Scrolltrigger works fine while targeting fred:
    <img class="fred" src='images/fred.svg'>

     

    But what I want to do is for scrolltrigger to work on a group that has a clippath while targeting shutter (This doesn't work).

        <g id="clipPathReveal" clip-path="url(#theClipPath)">
        <g class="Shutter">
        </g>

     

    Thanks

×
×
  • Create New...