From a887b07a021540fdbb931693d6fb07edd113e31a 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/post.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layout/post.ejs') diff --git a/layout/post.ejs b/layout/post.ejs index 9befb97..3428ddf 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -63,7 +63,7 @@ const player = new Shikwasa({ container: () => document.querySelector('.post-podcast-player'), - audio: { + audio: { title: "<%= page.title %>", artist: "<%= page.podcast.authors %>", cover: "<%= page.podcast.cover %>", @@ -82,7 +82,7 @@ window.player = player; }, false); - <% } %> + <% } %>
<%- page.content %>
-- cgit v1.2.3