mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-22 06:49:26 +01:00
add auto theme
switches between white and dark, based on browser's theme
This commit is contained in:
parent
1f296ec3aa
commit
9ee2deb460
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title about - teddit
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
.container
|
||||
.content
|
||||
|
@ -1,3 +1,5 @@
|
||||
if(user_preferences.theme === 'auto')
|
||||
link(rel="stylesheet", type="text/css", href="/css/dark.css", media="(prefers-color-scheme: dark)")
|
||||
if(user_preferences.theme === 'dark')
|
||||
link(rel="stylesheet", type="text/css", href="/css/dark.css")
|
||||
if(user_preferences.theme === 'sepia')
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title teddit
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
if json === null
|
||||
h2 error
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title #{cleanTitle(post.title)} : #{subreddit}
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
if post === null
|
||||
h1 Error occured
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title preferences - teddit
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
.container
|
||||
.content
|
||||
@ -14,17 +14,25 @@ html
|
||||
label(for="theme") Theme:
|
||||
select(id="theme", name="theme")
|
||||
if(!user_preferences.theme || user_preferences.theme == '')
|
||||
option(value="auto") Auto
|
||||
option(value="", selected="selected") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
if(user_preferences.theme === 'dark')
|
||||
option(value="auto") Auto
|
||||
option(value="") White
|
||||
option(value="dark", selected="selected") Dark
|
||||
option(value="sepia") Sepia
|
||||
if(user_preferences.theme === 'sepia')
|
||||
option(value="auto") Auto
|
||||
option(value="") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia", selected="selected") Sepia
|
||||
if(user_preferences.theme === 'auto')
|
||||
option(value="auto", selected="selected") Auto
|
||||
option(value="") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
.setting
|
||||
label(for="flairs") Show flairs:
|
||||
if(!user_preferences.flairs || user_preferences.flairs == 'true')
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title privacy policy - teddit
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
.container
|
||||
.content
|
||||
|
@ -6,7 +6,7 @@ html
|
||||
else
|
||||
title search results for #{q}
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
#search.sr.search-page
|
||||
form(action="/r/" + subreddit + "/search", method="GET")
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title /r/#{subreddit}
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
-
|
||||
let show_nsfw_warning = false;
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title subreddits - explore
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
if json === null
|
||||
h1 Error occured
|
||||
|
@ -3,7 +3,7 @@ html
|
||||
head
|
||||
title overview for #{data.username}
|
||||
include includes/head.pug
|
||||
body(class=""+ user_preferences.theme +"")
|
||||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||||
include includes/topbar.pug
|
||||
if user === null
|
||||
h1 Error occured
|
||||
|
Loading…
Reference in New Issue
Block a user