From 762bdc4aae407afe1c00ae1e9b438e0e5807f1cd Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Sun, 29 May 2022 17:18:06 +0800 Subject: feat: add #btn-toggle-dark botton to toggle dark mode - Switch dark theme to bulmaswatch/darkly, since bulma-prefers-dark highly relies on `@media: (prefers-color-scheme: dark)` tag - Add a playerman handler to toggle shikwasa theme[1] - Use localstorage to store user's preference[2] - Fix a typo: SystemDarkmodePrefrence => SystemDarkmodePreference [1]: Modified from https://github.com/jessuni/shikwasa/blob/main/pages/public/index.js#L208 [2]: Took inspiration from https://blog.skk.moe/post/hello-darkmode-my-old-friend --- layout/_partial/head.ejs | 4 ++-- layout/_partial/header.ejs | 3 +++ layout/_partial/scripts.ejs | 3 ++- layout/post.ejs | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'layout') diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 135d822..ed4f8d7 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -33,6 +33,6 @@ <%- css('css/style.min.css') %> - - + + \ No newline at end of file diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index b32edbb..6c423a0 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -18,6 +18,9 @@