feat: added login page

no functionality tho
This commit is contained in:
Itsigo
2024-04-12 16:33:37 +02:00
parent 98301fa904
commit 96ec48483a
4 changed files with 54 additions and 10 deletions

10
handler/login.go Normal file
View File

@@ -0,0 +1,10 @@
package handler
import (
"github.com/gofiber/fiber/v3"
"github.com/itsig0/tallytome/view/login"
)
func Login(c fiber.Ctx) error {
return render(c, login.Show())
}

View File

@@ -39,6 +39,7 @@ func main() {
// app.Get("/*", func(c *fiber.Ctx) error { // app.Get("/*", func(c *fiber.Ctx) error {
// return c.SendString("Hello, World!") // return c.SendString("Hello, World!")
// }) // })
app.Get("/login", handler.Login)
app.Listen(fmt.Sprint(":", port)) app.Listen(fmt.Sprint(":", port))
} }

25
view/login/login.templ Normal file
View File

@@ -0,0 +1,25 @@
package login
templ Show() {
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/tallytome.css"/>
<script src="/scripts/htmx.js"></script>
<script src="/scripts/tallytome.js"></script>
<title>Anmelden | Tallytome</title>
</head>
<body>
<main id="loginContainer" class="container">
<h1>Anmelden</h1>
<form>
<input type="text" placeholder="Login"/>
<input type="password" placeholder="Passwort"/>
<button type="submit">Anmelden</button>
</form>
</main>
</body>
</html>
}

View File

@@ -259,6 +259,14 @@ progress{
margin-bottom: var(--pico-spacing); margin-bottom: var(--pico-spacing);
} }
#loginContainer {
height: 100vh;
max-width: 510px;
display: flex;
flex-direction: column;
justify-content: center;
}
// form elements // form elements
// form{ // form{