This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

dark / light mode
#4
Add this to Custom JavaScript:
Code:
$(function(){
  if (window.Storage) {
    var dark = !!Storage.get('darkmode', '');

    $('body').toggleClass('dark', dark);
    
    $('.toggle-dark-mode').off('vclick').on('vclick', function() {
      dark = !dark;
      Storage.set('darkmode', dark ? 'y' : '');
      
      $('body').toggleClass('dark', dark);
    });
  }
});

Create a dummy object and attach a visualization element to it. Set Additional classes to toggle-dark-mode
Clicking this element will toggle between light/dark mode. This setting is stored in browser's local storage.
Reply


Messages In This Thread
dark / light mode - by hocine - 08.03.2024, 07:36
RE: dark / light mode - by admin - 08.03.2024, 07:43
RE: dark / light mode - by hocine - 08.03.2024, 08:56
RE: dark / light mode - by admin - 08.03.2024, 09:18
RE: dark / light mode - by hocine - 08.03.2024, 09:30
RE: dark / light mode - by hocine - 08.03.2024, 13:38
RE: dark / light mode - by admin - 11.03.2024, 12:55

Forum Jump: