Giter Site home page Giter Site logo

integration-gsap's Introduction

GSAP Help

Création d'une animation :

De base, une animation se lance directement au chargement de la page.

  let container = document.querySelectorAll('.background');
  gsap.from(".circle", {duration: 0.5, y:100, ease:"back", stagger:0.1});
  gsap.to(container, {opacity: 0, x: 500});

from()/to correspond au départ ou à la finalité de l'animation
".circle" sélecteur de l'objet à animer
duration/opacity/ease/... les différents attributs de l'animation

Il est possible de déclarer des fonctions dans les attributs.

  gsap.from(".circle", {duration: 1, y: () => Math.random()*400 - 200});

Création d'une timeline :

La timeline permet d'organiser de manière réactive le déclenchement des animations.

  let tl = gsap.timeline({reapeat: -1, yoyo: true});
  tl.addLabel("timer", "+=3");
  tl.from(circle, {duration: 1, y: 100, opacity: 0, stagger: 0.5, ease: 'elastic'}, "-=1");
  tl.to(background, {duration: 2, rotation: 360, ease: 'elastic'}, "timer");

tl.addLabel Permet de définir une variable de temps.
"-=1" Permet de définir le départ de l'animation par rapport à l'animation qui la précède.

integration-gsap's People

Contributors

eliooooooo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.