diff options
author | 135e2 <[email protected]> | 2022-05-29 17:18:06 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-06-01 23:13:27 +0800 |
commit | a887b07a021540fdbb931693d6fb07edd113e31a (patch) | |
tree | d6f2c3effa2bdb7b6b924ae2d6b87151e8106383 /layout/post.ejs | |
parent | 02d3b312a452b79126616d9308dc98ab68701be7 (diff) | |
download | chromate-a887b07a021540fdbb931693d6fb07edd113e31a.tar.gz chromate-a887b07a021540fdbb931693d6fb07edd113e31a.tar.bz2 chromate-a887b07a021540fdbb931693d6fb07edd113e31a.zip |
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
Diffstat (limited to 'layout/post.ejs')
-rw-r--r-- | layout/post.ejs | 4 |
1 files changed, 2 insertions, 2 deletions
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); </script> - <% } %> + <% } %> <section class="content is-size-6"> <%- page.content %> </section> |