lumin-mystic
v2.0.1
Published
Ambient management in JS
Readme
Lumin Mystic
Important: from versión 2 there is no backwards compatibility with previous versions.
Init LuminMystic:
import { LuminMystic } from 'lumin-mystic';
const myAmbientHandler = new LuminMystic({
storageContext: 'local', // local | session
classDark: 'is-dark', // dark ambient class
eventFn: () => true // function for change ambient event
});
myAmbientHandler.init(); // init ambient handlerGet constants:
myAmbientHandler.AMBIENT_SELECTED // get current selected ambient
myAmbientHandler.AMBIENT_LIGHT // light ambient constant
myAmbientHandler.AMBIENT_DARK // dark ambient constant
myAmbientHandler.AMBIENT_AUTO // auto ambient constantSet ambient:
myAmbientHandler.setAmbient({ ambient: myAmbientHandler.AMBIENT_DARK }); // set ambient
