Giter VIP home page Giter VIP logo

pendulum's Introduction

There are three things in life that people like to stare at: a flowing stream, a crackling fire and a swinging pendulum.

The chaotic-yet-patterny effect created by attaching 20 pendulums together is now available for you to embed using a single line of code!

Demo here

  • Highly customizable!
  • Very modern!
  • Pretty and nice!

Installing

npm install pendulumjs

Or download the minified package and insert a <script> tag that points to it.

Usage

var pendulum = new Pendulum({
    numBalls    : 40,           // # balls (>0)
    ballHeight  : 40,           // Canvas height (>0)
    ballRadius  : 5,            // Ball's radius (>0)
    color0      : '#FFFFFF',    // Ball's color when far from center (string)
    color1      : '#000000',    // Ball's color when close to center (string)
    fadeout     : 1.0           // Ball's fadeout speed (0.0 - 1.0)
});
document.querySelector('body').appendChild(pendulum.canvas);
Methods
  • play() - Start animation
  • pause() - Pause animation
  • step(num) - Go to frame # num

Credits

Based on a a post I saw on reddit (specifically, on this guy's comment)

Support

Pendulum doesn't and will never ever support IE8. In fact, when running on IE8, Pendulum will display a message box asking the user to upgrade his browser. (This can be controlled by setting the dontDisplayHorrendousMessageBoxOnIE8EvenThoughItsAShittyBrowserNobodyShouldNeverEverUse to true.)

License

MIT

pendulum's People

Contributors

dutzi avatar

Stargazers

Shule Hsiung avatar  avatar Nitish avatar Sibelius Seraphini avatar Kҽʋιɳ Sҽɾɾαɳσ avatar Justin Cano avatar De'Yonte W. avatar Jack Brown avatar Will Franzen avatar Sean O avatar Florent BEAUCHAMP avatar John Sullivan avatar Brian avatar M.Yasoob Ullah Khalid ☺ avatar Jack Roscoe avatar

Watchers

James Cloos avatar

Forkers

abdul0010

pendulum's Issues

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.