From c3ce0587095b85a7e1eac0946acccf6107ecac3c Mon Sep 17 00:00:00 2001 From: Benjamin <8467845+import-benjamin@users.noreply.github.com> Date: Thu, 8 May 2025 20:50:37 +0200 Subject: [PATCH 1/2] feat: add basic css style --- internal/adapter/http/http.go | 3 +-- static/css/style.css | 20 ++++++++++++++++++++ templates/index.html.tpl | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 static/css/style.css diff --git a/internal/adapter/http/http.go b/internal/adapter/http/http.go index 08dff3c..6727d6a 100644 --- a/internal/adapter/http/http.go +++ b/internal/adapter/http/http.go @@ -27,7 +27,6 @@ func Recovery(next http.Handler) http.Handler { } func Server(addr string) { - fmt.Println("here") router := http.NewServeMux() router.HandleFunc("/", httpRoutes.Homepage) @@ -35,8 +34,8 @@ func Server(addr string) { router.HandleFunc("GET /cameras/status", httpRoutes.StreamStatus) router.HandleFunc("DELETE /cameras", httpRoutes.DeleteCamera) router.HandleFunc("GET /cameras", httpRoutes.StreamVideo) + router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) - fmt.Println("hore") server_config := &http.Server{ Addr: addr, Handler: logger.LoggingHandler( diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..32bc854 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,20 @@ +*,:after,:before{background:none;border:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:initial;font-size:100%;font-style:normal;font-weight:400;margin:0;padding:0;vertical-align:baseline}button,select{-webkit-appearance:none;-moz-appearance:none;appearance:none}body{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;line-height:1.5;min-height:100vh;width:100%}a,button,details,input[type=button],input[type=checkbox],input[type=file],input[type=image],input[type=radio],input[type=range],input[type=reset],input[type=submit],label,select{cursor:pointer}article,aside,audio,canvas,details,figcaption,figure,footer,header,main,nav,rt,ruby,section,summary{display:block}bdi,mark,meter,output,progress,time{display:inline-block}[hidden],datalist,dialog:not([open]),rp{display:none}a{text-decoration:none}ol,ul{list-style:none}embed,iframe,img,object,picture,svg,video{display:block;height:auto;max-width:100%}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:none}strong{font-weight:700}em{font-style:italic}code,kbd,pre,samp{font-family:monospace}sub{vertical-align:sub}sup{vertical-align:super}small{font-size:small}table{border-collapse:collapse} + +body { + background-color: #0d1321; +} + +nav a { + color: #e0e1dd; + font-size: 2rem; + font-family: sans-serif; +} + +button { + background-color: #1d2d44; + border: 2px solid #3e5c76; + margin: 0.2rem; + padding: 1rem; + border-radius: 3px; + color: #e0e1dd; +} diff --git a/templates/index.html.tpl b/templates/index.html.tpl index c50d8b8..4a6b36e 100644 --- a/templates/index.html.tpl +++ b/templates/index.html.tpl @@ -4,6 +4,7 @@ Phantom dashboard +
- +