Giter Site home page Giter Site logo

wiggle.js's Introduction

wiggle.js

Random moving, configurable snakes that can be placed inside any container you wish, just please ensure they have enough space or I'll have no choice but to contact animal control!

DEMO

An example of this project can be found at http://dev.lucasbowers.com/wiggle/ Live demo page (The above image is a GIF. Click it for a full quality example)

Usage

You will need the wiggle.js file downloaded into your project folder, as well as a JSON config file. Import this file into your HTML as follows...

<script src="path/to/wiggle.js"></script>

To initialize the particles, you will need to call the main wiggle() JS function like so...

wiggle("path/to/wiggle.json", "<id of container>", function(wiggleInstanceID){
  console.log("Wiggle initiliazed with ID #" + wiggleInstanceID);
});

Options

To customise the particles, you must create a JSON configuration file, an example of which can be found in the project files bParticles.json. The following options are set within this file...

Key Type Notes
gridSize integer The width of each background grid cell, and so the length of each section of a snake.
fps integer 30fps is perfectly acceptable in terms of smoothness and CPU stress.
snakes.amount integer Nmber of snakes wiggling around at once.
snakes.length integer Number of body sections that make up each snake.
snakes.width integer Width of the snakes body sections.
bground string CSS Color String to specify the container background color.

wiggle.js's People

Contributors

lb-digital 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.