How to use the gsap.TweenMax.to function in gsap

To help you get started, we’ve selected a few gsap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elifitch / am-i-a-real-developer / src / components / confetti / confetti.js View on Github external
tweenConfettiParticle(id) {
		const minAngle = this.confettiSprites[id].angle - SPREAD / 2;
		const maxAngle = this.confettiSprites[id].angle + SPREAD / 2;
		
		const minVelocity = this.confettiSprites[id].velocity / 4;
		const maxVelocity = this.confettiSprites[id].velocity;

		// Physics Props
		const velocity = loRandom(minVelocity, maxVelocity);
		const angle = loRandom(minAngle, maxAngle);
		const gravity = GRAVITY;
		// const friction = loRandom(0.1, 0.25);
		const friction = loRandom(0.01, 0.05);
		const d = 0;

		TweenMax.to(this.confettiSprites[id], DECAY, {
			physics2D: {
				velocity,
				angle,
				gravity,
				friction,
			},
			d,
			ease: Power4.easeIn,
			onComplete: () => {
				// remove confetti sprite and id
				loPull(this.confettiSpriteIds, id);
				delete this.confettiSprites[id];
			},
		});
	}
github conversationai / perspectiveapi-authorship-demo / src / app / modules / convai-checker / perspective-status.component.ts View on Github external
private getFadeAndShrinkAnimation(timeSeconds: number, repeat: boolean) {
    return TweenMax.to(this.widgetElement, timeSeconds, {
      repeat: repeat ? 1 : 0,
      backgroundColor: 'rgba(227,229,230,0.54)',
      scaleX: 0.5,
      scaleY: 0.5,
      yoyo: repeat,
      onStart: () => {
        console.debug('Loading animation: fade in and out start');
      },
      onComplete: () => {
        console.debug('Loading animation: fade in and out complete');
      },
    });
  }
github nersent / nersent-ui / src / components / dialog.js View on Github external
show = () => {
        if (!this.active) {
            this.refs.dark.style.display = 'block';
            TweenMax.to(this.refs.dark, this.props.showAnimationTime, {
                css: {
                    opacity: 0.7
                }
            });
            this.refs.dialog.style.display = 'block';
            TweenMax.to(this.refs.dialog, this.props.showAnimationTime, {
                css: {
                    opacity: 1,
                    marginTop: 0
                }
            });
            this.active = true;
        }
    }
github Tian-Hun / biger-music / src / app / shared / components / mini-player / mini-player.component.ts View on Github external
export function buildToggleAnimation(original: Element, target: Element): void {
    TweenMax.to(original, 0.2, {x: 20, opacity: 0, display: 'none', scale: 0.3, ease: Power2.easeInOut});
    TweenMax.fromTo(target, 0.2,
        {x: -20, opacity: 0, scale: 0.3, display: 'none'},
        {x: 0, opacity: 1, display: 'block', scale: 1, ease: Power2.easeInOut}
    );
}
github EvanBacon / Expo-Crossy-Road / src / CrossyGame.js View on Github external
rumble = () => {
    Vibration.vibrate();

    TweenMax.to(this.position, 0.2, {
      x: 0,
      y: 0,
      z: 1,
    });
    TweenMax.to(this.position, 0.2, {
      x: 0,
      y: 0,
      z: 0,
      delay: 0.2,
    });
  };
}
github iondrimba / threejs-audio-visualizer-two / src / scripts / app.js View on Github external
drawWave() {
    if (this.playing) {

      this.analyser.getByteFrequencyData(this.frequencyData);

      for (var i = 0; i < 140; i++) {
        var p = this.frequencyData[i];
        var s = this.objects[i];
        var z = s.position;

        TweenMax.to(z, .2, {
          y: p / 20
        });

      }
    }
  }
github ramsaylanier / WordExpress / app / components / posts / PostContent.js View on Github external
anchor.addEventListener('click', (e)=>{
          e.preventDefault()
          browserHistory.push(target)
          TweenMax.to(window, 0.5, {
            scrollTo: {
              y: 0
            },
            ease: Power4.easeInOut
          })
        })
      }
github simonaco / page-transitions-travelapp / src / app / navigation / navigation.component.ts View on Github external
openMenu() {
    TweenMax.to(this.threeDots.first.nativeElement, 0.2, {
      x: 18,
      ease: Sine.easeOut
    });
    TweenMax.to(this.threeDots.last.nativeElement, 0.2, {
      x: -18,
      ease: Sine.easeOut
    });
    TweenMax.staggerTo(
      [
        this.threeDots.first.nativeElement,
        this.threeDots.middle.nativeElement,
        this.threeDots.last.nativeElement
      ],
      0.2,
      {
        fill: '#7eebe6',

gsap

GSAP is a framework-agnostic JavaScript animation library that turns developers into animation superheroes. Build high-performance animations that work in **every** major browser. Animate CSS, SVG, canvas, React, Vue, WebGL, colors, strings, motion paths,

Standard 'no charge' license:…
Latest version published 4 months ago

Package Health Score

69 / 100
Full package analysis