From 0acf1a95afc50fc03d3ebfa18e565aa8c76b0fcf Mon Sep 17 00:00:00 2001 From: Zhi Wang Date: Thu, 20 Jan 2022 16:40:32 -0500 Subject: [PATCH] WIP --- assets/signin.css | 39 +++++++++++++++++++++++++++++++++++++ assets/template/signin.html | 39 +++++++++++++++++++++++++++++++++++++ main.go | 12 +++++------- 3 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 assets/signin.css create mode 100644 assets/template/signin.html diff --git a/assets/signin.css b/assets/signin.css new file mode 100644 index 0000000..4be8852 --- /dev/null +++ b/assets/signin.css @@ -0,0 +1,39 @@ +html, +body { + height: 100%; +} + +body { + display: flex; + align-items: center; + padding-top: 40px; + padding-bottom: 40px; + background-color: #f5f5f5; +} + +.form-signin { + width: 100%; + max-width: 330px; + padding: 15px; + margin: auto; +} + +.form-signin .checkbox { + font-weight: 400; +} + +.form-signin .form-floating:focus-within { + z-index: 2; +} + +.form-signin input[type="text"] { + margin-bottom: -1px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-signin input[type="password"] { + margin-bottom: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} \ No newline at end of file diff --git a/assets/template/signin.html b/assets/template/signin.html new file mode 100644 index 0000000..14b5e84 --- /dev/null +++ b/assets/template/signin.html @@ -0,0 +1,39 @@ + + + + + + + + + + WiTTY Login + + + + + + +
+
+ + +
+ + +
+
+ + +
+ +
+ +
+ +

WiTTY: Web-based Interactive TTY

+
+
+ + + \ No newline at end of file diff --git a/main.go b/main.go index f14a829..98f544d 100644 --- a/main.go +++ b/main.go @@ -147,13 +147,12 @@ func main() { // Fill in the index page rt.GET("/", func(c *gin.Context) { host = &c.Request.Host - players, records := collectTabData(c) - c.HTML(http.StatusOK, "index.html", gin.H{ - "title": "interactive terminal", - "players": players, - "records": records, - }) + c.HTML(http.StatusOK, "index.html", gin.H{}) + }) + + rt.GET("/sign-in", func(c *gin.Context) { + c.HTML(http.StatusOK, "signin.html", gin.H{}) }) rt.GET("/favicon.ico", func(c *gin.Context) { @@ -175,7 +174,6 @@ func main() { active1 = "active" } - host = &c.Request.Host players, records := collectTabData(c) c.HTML(http.StatusOK, "tab.html", gin.H{