Coder Social home page Coder Social logo

fire.js's Introduction

fire.js

The History

I started fire.js because I offered my friend a new background for his website. I'm now working on it more often, and hopefully it could become an alternative to particles.js.

Installation

Download and npm install. Build by running npm run build Then, have a <script src="fire.js"></script> in your index.html. If you have scripts that override window.onresize or window.onload make sure to put them BEFORE fire.js. fire.js will add its code to those functions, not override them.

NPM scripts

  • Start a dev server: npm run dev.
  • Build the files into build/fire.js: npm run build

JSON config

fire.json should be kept in the same directory as fire.js. If that cannot be done, simply edit the fetch request in the getConfig method.

Field Type Description
id string The id of the canvas to draw in
tiles.(width/height) number the dimensions of the tiles
colors.*.initial number the starting value for any color
colors.*.multiplier number the value multiplied by the perlin noise
noiseResolution number how blocky or smooth the appearance is. Lower is blockier.
speed number the speed at which the animation changes. Lower is faster.

The Gradient Directory

This is something I threw together quickly to allow for a different way to configure fire.js. How it works is you select 2 colors and it will preview a gradient that fire.js will look like, and also provide the configuration needed to do it. It's not implemented with a fire preview, but it will in the future.

What's "initial" and "multiplier"?

The function for the r, g, and b values is initial + noiseValue * multiplier. noiseValue is always between 0 and 1, so this effectively means that the minimum value is initial and the maximum is multiplier + initial.

fire.js's People

Contributors

micahsgilbert avatar

Watchers

James Cloos 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.