Skip to content

andreipfeiffer/oxigen-animation

Repository files navigation

oxigen-animation

Animation for the Oxigen for Timisoara website.


Setup

npm install git+https://github.com/andreipfeiffer/oxigen-animation.git

or simply download it.


Usage

import * as oxigen_animation from "oxygen-animation";

.init()

Should be called when you want to initialize the package:

oxigen_animation.init({
  // the container for the animation
  element: document.querySelector("#animation-scene"),
  total_necesar: 250000000,
});

.update()

oxigen_animation.update({
  total_strans: 1100000,
  donatori: 146,
});

.animate()

// you can pass an object:
oxigen_animation.animate({
  nume: "Andrei P.",
  suma: 200,
});

// or an Array
oxigen_animation.animate([
  { nume: "Andrei", suma: 100 },
  { nume: "Pfeiffer", suma: 200 },
  // ...
]);

.stop()

// stops the loop animation
oxigen_animation.stop();

Development

// start build system (TS compiler) in watch mode
npm run watch

Open /docs/index.html in your browser, preferably with a Live Server.