Basic frontend login ui

This commit is contained in:
2023-07-17 16:52:39 +01:00
parent af171b3344
commit f5f19f6dd4
5 changed files with 26 additions and 12 deletions

0
frontend/index.css Normal file
View File

24
frontend/index.html Normal file
View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GiacPoints</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/picnic">
<link rel="stylesheet" href="/index.css">
</head>
<body>
<div id="login">
<article class="card">
<label for="name">Name</label> <br>
<input type="text" id="name"> <br>
<label for="password">Password</label> <br>
<input type="password" id="password"> <br>
<input type="submit" value="Login"> <br>
</article>
</div>
<div id="mainPage" style="display: none;">
<p>Main Page</p>
</div>
</body>
</html>

View File

@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GiacPoints</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<p>Hello web</p>
</body>
</html>

BIN
main

Binary file not shown.

View File

@@ -170,10 +170,11 @@ func main() {
router.GET("/getHistory", getHistory) router.GET("/getHistory", getHistory)
// page routes // page routes
router.LoadHTMLGlob("html/*") router.LoadHTMLGlob("frontend/*")
router.GET("/", func(c *gin.Context) { router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", gin.H{}) c.HTML(http.StatusOK, "index.html", gin.H{})
}) })
router.Static("/", "./frontend")
// asset routes // asset routes
router.Static("/scripts", "./scripts") router.Static("/scripts", "./scripts")