How to use the gsap.TimelineLite 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 Jeremboo / scribble-lab / modules / AnimatedText3D.js View on Github external
opacity: 0,
          transparent: true,
        });
        const mesh = new Mesh(geom, mat);

        mesh.position.x = this.basePosition;
        this.basePosition += geom.boundingBox.max.x + letterSpacing;
        this.add(mesh);
      }
    });

    this.show = this.show.bind(this);
    this.hide = this.hide.bind(this);

    // Timeline
    this.tm = new TimelineLite({ paused: true });
    this.tm.set({}, {}, `+=${duration * 1.1}`)
    this.children.forEach((letter) => {
      const data = {
        opacity: 0,
        position: -0.5,
      };
      this.tm.to(data, duration, { opacity: 1, position: 0, ease: Back.easeOut.config(2), onUpdate: () => {
        letter.material.opacity = data.opacity;
        letter.position.y = data.position;
        letter.position.z = data.position * 2;
        letter.rotation.x = data.position * 2;
      } }, `-=${duration - 0.03}`);
    });
  }
github ics-creative / 170330_webpack / tutorial-typescript-gsap / src / index.ts View on Github external
import { TweenLite, TimelineLite, Bounce } from 'gsap';

// 適当に要素をたくさん用意する
const rects = [];
for (let i = 0; i < 50; i++) {
  const rect = document.createElement('div');
  rect.className = 'rect';
  rect.style.left = `calc(100vw * ${Math.random()})`;
  rect.style.top = `-100px`;
  rect.style.transform = `rotateZ(${Math.random() * 360}deg)`;
  document.body.appendChild(rect);
  rects.push(rect);
}

// タイムラインを作成する
const tl = new TimelineLite({ repeat: -1, yoyo: true });
rects.forEach((rect, index) => {
  // トゥイーンインスタンスを追加する
  tl.add(TweenLite.to(rect, 3, {
    y: window.innerHeight * 3 / 4,
    rotationZ: 0,
    ease: Bounce.easeOut,
    delay: index * 0.02
  }), 0);
});
github elifitch / am-i-a-real-developer / src / components / slides / final-slide.js View on Github external
componentWillMount() {
		// dunno why can't pass element as ref to anim, need get hacky w/ ids
		this.TL = new TimelineLite();
	}
	componentDidUpdate() {
github 01fade / me-and-my-fb-data / src / Pages / Messages.js View on Github external
animationTL(currentData) {
    this.tl = new TimelineLite();
    for (var m = 0; m < currentData.length; m++) {
      const el = $(".bar");
      this.tl.to(el[m], 0.3, {
        width: currentData[m].value
      }, "-=0")
      .to($(el[m]).next(), 0.2, {
        opacity: 1,
        width: "auto"
      })
      .to($(el[m]).next().next(), 0.2, {
        opacity: 1,
        display: "inline-block"
      }, "-=0.1")
      .to($(".plus")[m], 0.2, {
        opacity: 1
      })
github jannisborn / covid19_pocus_ultrasound / pocovidscreen / resources / js / Frame.js View on Github external
const Frame = () => {
    const context = useContext(AppContext);

    document.documentElement.className = context.themeMode === 'light' ? 'light' : 'dark';

    let app = useRef(null);
    let headerItems = useRef(null);
    let masterTl = new TimelineLite();

    useEffect(() => {
        TweenMax.to(app, 0, {css: {visibility: 'visible'}});
        if (localStorage.getItem('animated-once') === null) {
            masterTl.from(headerItems.children[0], 1, {opacity: 0, delay: .8, ease: Power3.easeOut}, 'Start master')
                .from(headerItems.children[1], 1, {opacity: 0, delay: .8, ease: Power3.easeOut}, .3)
                .from(headerItems.children[2], 1, {opacity: 0, delay: .8, ease: Power3.easeOut}, .3);

            localStorage.setItem('animated-once', 'true');
        }
    });

    const ScrollToTop = () => {
        const { pathname } = useLocation();

        useEffect(() => {
github lennerd / git-for-beginners / src / components / Tutorial / chapters / VersioningOfFiles.js View on Github external
constructor(font, fontBold) {
    super({ half: true });

    this.add(ACTION_ADD_FIRST_FILE, this.addFirstFile);
    this.add(ACTION_COPY_LAST_FILE, this.copyLastFile);
    this.add(ACTION_LOOP, this.loop);
    this.add(ACTION_ADD_FILENAMES, this.addFileNames);
    this.add(ACTION_ADD_VERSION_DATABASE, this.addVersionDatabase);
    this.add(ACTION_NEXT);

    this.fileLabelFont = font;
    this.fontBold = letterSpacing(fontBold, 1.2);
    this.sectionLabelFont = letterSpacing(font, 1.2);

    this.copyTimeline = new TimelineLite({
      paused: true,
      onComplete() {
        this.restart();
      }
    });

    this.copyTimeline.add(this.copyLastFile, '+=1.5');
  }
github ueno-llc / gsap-tools / src / components / hero / Circles.js View on Github external
get timelineEnter() {
    const t = new TimelineLite();
    const t1 = new TimelineLite();
    const t2 = new TimelineLite();
    const ease = 'Linear.easeNone';
    const circle = this.circles.childNodes;
    const greyCircle = this.secondaryCircles.childNodes;

    t.addLabel('start').set([greyCircle, circle], { autoAlpha: 0, scale: 0.2, y: '-150%', transformOrigin: 'center' });

    t1.addLabel('start')
      .to(circle, 0.3, { autoAlpha: 1, ease }, 'start')
      .to(circle, 0.5, { scale: 1, ease }, 'start')
      .to(circle, 4.5, { y: '0%', ease: 'Power4.easeOut' }, 'start+=0.25')
      .to(circle, 0.25, { scale: 0.85, ease }, 'start+=0.5')
      .to(circle, 0.5, { scale: 1 }, 'start+=0.75');

    t2.addLabel('start')
github imshubhamsingh / FarmerChain / src / components / sidebar / Main.js View on Github external
(function($) {
				let img = $('.wrapper').children(),
					name = $('#name'),
					accountNo = $('#accountNo'),
					details = $('.menu ul>li'),
					logout = $('.logOut');
				let serviceList = [ ...name, ...accountNo, ...details, ...logout ];
				let t1Loader = new TimelineLite({ delay: 0.5 });

				t1Loader
					.staggerFromTo(
						serviceList,
						0.25,
						{ y: +20, autoAlpha: 0 },
						{ y: 0, autoAlpha: 1, ease: Elastic.SlowMo },
						0.15
					)
					.fromTo(img, 0.5, { y: 50, autoAlpha: 0 }, { y: 0, autoAlpha: 1, ease: Elastic.SlowMo }, '-=1.25');
			})(jQuery);
		});
github redacademy / star-wars-crawl-greensock / src / App.js View on Github external
componentDidMount() {
    const tl = new TimelineLite();

    tl
      .to(this.intro.current, 4.5, { opacity: 1, delay: 1 })
      .to(this.intro.current, 1.5, {
        opacity: 0,
        onComplete: () => {
          this.audio.current.play();
        }
      })
      .set(this.logo.current, {
        opacity: 1,
        scale: 2.75,
        delay: 0.5
      })
      .to(this.logo.current, 8, { scale: 0.05, ease: Power2.easeOut })
      .to(this.logo.current, 1.5, { opacity: 0 }, "-=1.5")

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 11 months ago

Package Health Score

74 / 100
Full package analysis