FriendsOfFlarum / nightmode

๐ŸŒ™ Turn off the lights!
https://discuss.flarum.org/d/21492-friendsofflarum-night-mode
MIT License
33 stars 22 forks source link
dark extension flarum flarum-extension forum friendsofflarum hacktoberfest light lights night-mode

Night Mode by FriendsOfFlarum

GitHub license Latest Stable Version Total Downloads

A Flarum extension. Add a Night Mode ๐ŸŒ™ for your users to use on your Flarum forum! (THE LIGHT ๐ŸŒž, IT BUUUURNSSS!!!)

Install manually with composer:

composer require fof/nightmode:"*"

Updating

composer update fof/nightmode

Integrating with fof/nightmode from another extension

Each time the mode is switched from day to night (and vice versa), a fofnightmodechange event is dispatched. An extension can then listen to this event to react to this change, like so:

if (flarum.extensions['fof-nightmode']) {
  document.addEventListener('fofnightmodechange', (event) => {
    if (event.detail == 'day') {
      console.log('day mode');
    } else {
      console.log('night mode');
    }
  });
}

Links

An extension by FriendsOfFlarum.