diff --git a/frontend/assets/css/style.css b/frontend/assets/css/style.css new file mode 100644 index 0000000..c565dc3 --- /dev/null +++ b/frontend/assets/css/style.css @@ -0,0 +1,110 @@ +:root { + --bg: #111827; + --card: #1f2937; + --border: #374151; + --text: #f9fafb; + --accent: #3b82f6; +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + background: var(--bg); + color: var(--text); + font-family: system-ui; +} + +nav { + display: flex; + gap: 1rem; + + padding: 1rem; + + border-bottom: 1px solid var(--border); +} + +nav a { + color: white; + text-decoration: none; +} + +main { + max-width: 1400px; + + margin: auto; + + padding: 2rem; +} + +.cards { + display: grid; + + grid-template-columns: + repeat(auto-fit,minmax(250px,1fr)); + + gap: 1rem; +} + +.card { + background: var(--card); + + border: 1px solid var(--border); + + border-radius: 12px; + + padding: 1rem; +} + +table { + width: 100%; + border-collapse: collapse; +} + +th, +td { + padding: 1rem; + text-align: left; +} + +tr { + border-bottom: 1px solid var(--border); +} + +input, +select, +button { + + background: #1f2937; + + color: white; + + border: 1px solid var(--border); + + border-radius: 8px; + + padding: .8rem; +} + +button { + cursor: pointer; +} + +button:hover { + background: var(--accent); +} + +@media(max-width:768px){ + + nav{ + flex-wrap:wrap; + } + + table{ + display:block; + overflow:auto; + } + +} \ No newline at end of file diff --git a/frontend/handler.go b/frontend/handler.go index a26a3a0..4c731de 100644 --- a/frontend/handler.go +++ b/frontend/handler.go @@ -5,10 +5,14 @@ import ( "net/http" ) +var dashbaord = template.Must(template.ParseFiles( + "frontend/htmx/contents/dash/base.html", + "frontend/htmx/contents/dash/dashboard.html")) +var home = template.Must(template.ParseFiles("frontend/htmx/home.html")) + func Home(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") - var tmpl = template.Must(template.ParseFiles("frontend/htmx/home.html")) - err := tmpl.Execute(w, struct { + err := home.Execute(w, struct { Name string }{ Name: "Miau", @@ -17,3 +21,15 @@ func Home(w http.ResponseWriter, r *http.Request) { return } } + +func Dashboard(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html") + err := dashbaord.Execute(w, struct { + Title string + }{ + Title: "Miau", + }) + if err != nil { + return + } +} diff --git a/frontend/htmx/contents/dash/base.html b/frontend/htmx/contents/dash/base.html new file mode 100644 index 0000000..0e4adac --- /dev/null +++ b/frontend/htmx/contents/dash/base.html @@ -0,0 +1,27 @@ + + +
+ + +Items
+Projekte
+Orte
+| Name | +Kategorie | +Gesamt | +Frei | +
|---|---|---|---|
| {{ .Name }} | + +{{ .Category }} | + +{{ .TotalQuantity }} | + +{{ .FreeQuantity }} | + +