add dark theme and preferences

This commit is contained in:
teddit
2020-11-21 13:50:12 +01:00
parent 3edde76303
commit 5e52297481
17 changed files with 872 additions and 76 deletions

View File

@@ -3,9 +3,21 @@ html
head
title preferences - teddit
include includes/head.pug
body
body(class=""+ user_preferences.theme +"")
include includes/topbar.pug
.container
.content
h1 Preferences
p nothing here yet
form(action="/saveprefs", method="POST")
legend Display
label(for="theme") Theme:
select(id="theme", name="theme")
if(!user_preferences.theme || user_preferences.theme == '')
option(value="", selected="selected") White
option(value="dark") Dark
if(user_preferences.theme === 'dark')
option(value="") White
option(value="dark", selected="selected") Dark
p(class="notice") Preferences are stored client-side using cookies without any personal information.
input(type="submit", value="Save preferences")
a(href="/resetprefs", class="btn") Reset preferences