Jump to content
Search Community

uarreghini

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by uarreghini

  1. Please look at this example:

    See the Pen YzZyKwZ by arreumb (@arreumb) on CodePen

    , what I try to achieve is:  draw the outline of the first letter and then fill it with a color before starting to draw the outline of the second letter and repeat this for all the letters. Using  stagger: {each:1, onComplete: onComplete} is extremely slow so I was searching a way  to pass to an external function the svg path to fill. I could do that in gsap 2 using  ["{self}"] but now it seems I only have an array with all the paths but no information on what is the current path to fill. 

  2. In gsap 2 I had a  timeline to first draw the stroke of each letter of a svg text and then fill it with a color after the stroke is complete but now in gsap 3 I can't figure how to pass the correct argument to the fillLetter function. 

     

    tl.staggerFromTo($('#layer1 path'), 0.5, {'drawSVG': "0%", 'visibility': "visible"}, {'drawSVG': "100%", 'onUpdate': fillLetter, 'onUpdateParams': ["{self}"], 'ease': Linear.easeInOut}, 0.20);

     

    function fillLetter(istance) {
        setTimeout(function () {
            istance.target.style.fill = "#0d47a1";
        }, 200);
    }

×
×
  • Create New...