From 24fac49928489992e4fade16a17ad60c0f0f55d7 Mon Sep 17 00:00:00 2001 From: alexy-os Date: Thu, 28 Nov 2024 15:34:48 +0300 Subject: [PATCH] upd darkMode --- index.html | 3 +++ public/buildy/index.html | 28 +++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 7699254..fb8d82e 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,9 @@ (function() { const theme = localStorage.getItem('darkMode'); const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches; + if (!theme && systemTheme) { + localStorage.setItem('darkMode', 'true'); + } if (theme === 'true' || (!theme && systemTheme)) { document.documentElement.classList.add('dark'); } diff --git a/public/buildy/index.html b/public/buildy/index.html index 869ed04..b7903e2 100644 --- a/public/buildy/index.html +++ b/public/buildy/index.html @@ -18,12 +18,30 @@