mirror of
https://github.com/1f349/lavender.git
synced 2024-12-22 15:44:07 +00:00
Add dark mode to UIs
This commit is contained in:
parent
03df1556e7
commit
78e144891a
@ -2,6 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
<script>
|
<script>
|
||||||
let loginData = {
|
let loginData = {
|
||||||
target:{{.TargetOrigin}},
|
target:{{.TargetOrigin}},
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/1f349/cache"
|
"github.com/1f349/cache"
|
||||||
"github.com/1f349/lavender/issuer"
|
"github.com/1f349/lavender/issuer"
|
||||||
|
"github.com/1f349/lavender/theme"
|
||||||
"github.com/1f349/mjwt"
|
"github.com/1f349/mjwt"
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
"github.com/rs/cors"
|
"github.com/rs/cors"
|
||||||
@ -68,6 +70,10 @@ func NewHttpServer(conf Conf, signer mjwt.Signer) *HttpServer {
|
|||||||
r.POST("/popup", hs.flowPopupPost)
|
r.POST("/popup", hs.flowPopupPost)
|
||||||
r.GET("/callback", hs.flowCallback)
|
r.GET("/callback", hs.flowCallback)
|
||||||
|
|
||||||
|
r.GET("/theme/style.css", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||||
|
http.ServeContent(rw, req, "style.css", time.Now(), bytes.NewReader(theme.DefaultThemeCss))
|
||||||
|
})
|
||||||
|
|
||||||
// setup CORS options for `/verify` and `/refresh` endpoints
|
// setup CORS options for `/verify` and `/refresh` endpoints
|
||||||
var corsAccessControl = cors.New(cors.Options{
|
var corsAccessControl = cors.New(cors.Options{
|
||||||
AllowOriginFunc: func(origin string) bool {
|
AllowOriginFunc: func(origin string) bool {
|
||||||
|
3
theme/style.css
Normal file
3
theme/style.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
html, body {
|
||||||
|
color-scheme: light dark;
|
||||||
|
}
|
6
theme/theme.go
Normal file
6
theme/theme.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package theme
|
||||||
|
|
||||||
|
import _ "embed"
|
||||||
|
|
||||||
|
//go:embed style.css
|
||||||
|
var DefaultThemeCss []byte
|
Loading…
Reference in New Issue
Block a user