0.1.0 • Published 7 years ago

flux.js v0.1.0

Weekly downloads
5
License
BSD-3-Clause
Repository
github
Last release
7 years ago

Flux.js

Bring color temeperature management to the web. Adjust website color palette according to how light or dark it is
outside for the user. When night comes it is much better if screen is adjusted to a warmer color temperature so it
wouldn't be blindingly bright at 11PM.

Example

View live example here.

GIF demo

How to use

Install library either via npm npm install flux.js and load it via var Flux = require('flux.js');.

Download minified library from github and inject it into your page. Injected script will make Flux library available as a global class.

<script src="flux.min.js"></script>

Initialize and immediately adjust color temperature of the page.

var flux = new Flux().adjustTemperature();

Live color adjustment. Every minute Flux will try to detect change in day lighting - if that happens it will adjust
page color temperature accordingly.

var flux = new Flux();
setInterval(function() {
  flux.adjustTemperature();
}, 60000);