fof/nightmode

Add a Night Mode option for your users to use on your Flarum forum

Fund package maintenance!
Website

Installs: 32 694

Dependents: 3

Suggesters: 2

Security: 0

Stars: 33

Watchers: 8

Forks: 20

Open Issues: 3

Type:flarum-extension

1.5.3 2023-08-28 18:26 UTC

README

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!!!)

  • A new "Night Mode" menu option will appear in your user options when you click on your avatar next to the notifications icon. Night Mode Option
  • A "Day Mode" option has been added as well to make the light appear again! (BEGONE, DANKESS!) Day Mode Option

Installation

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

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f666f662f646f6e6174652f627574746f6e4032782e706e673f636f6c6f723d626c7565

An extension by FriendsOfFlarum.