How to use the css-animator/builder.AnimationBuilder function in css-animator

To help you get started, we’ve selected a few css-animator 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 fabiandev / css-animator / docs / builder.main.ts View on Github external
import { AnimationBuilder } from 'css-animator/builder';

const element = document.getElementById('animate');
const showButton = document.getElementById('showButton');
const shakeButton = document.getElementById('shakeButton');
const hideButton = document.getElementById('hideButton');

const animator = new AnimationBuilder();

animator
  .setType('fadeInUp')
  .setDelay(100)
  .show(element);

showButton.onclick = () => {
  showButton.setAttribute('disabled', '');

  animator
    .setType('fadeInUp')
    .setDuration(1000)
    .show(element)
    .then(() => {
      hideButton.removeAttribute('disabled');
      shakeButton.removeAttribute('disabled');

css-animator

Animate elements using CSS classes with support for Angular 2+

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis