From f2fea7f3cd5a131f994ad9bc1d2b4833865dd165 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 20 Apr 2018 03:41:24 +0900 Subject: [wip] darkmode --- src/client/app/boot.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/app/boot.js') diff --git a/src/client/app/boot.js b/src/client/app/boot.js index a0709842b9..ac90fda05f 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -62,6 +62,14 @@ app = isMobile ? 'mobile' : 'desktop'; } + // Dark/Light + const me = JSON.parse(localStorage.getItem('me') || null); + if (me && me.clientSettings) { + if ((app == 'desktop' && me.clientSettings.dark) || (app == 'mobile' && me.clientSettings.darkMobile)) { + document.documentElement.setAttribute('data-darkmode', 'true'); + } + } + // Script version const ver = localStorage.getItem('v') || VERSION; -- cgit v1.3.1-freya