Compare commits

..

No commits in common. "317834e446e4fbf9bdcc010e875de87b41a9302d" and "c9fe62e7fd2c15b0cdb04a7241eecb1db034c827" have entirely different histories.

11 changed files with 72 additions and 236 deletions

View File

@ -5,7 +5,6 @@ import (
"flag" "flag"
"fmt" "fmt"
"net/http" "net/http"
"path"
"github.com/Cameron-Reed1/todo-web/api" "github.com/Cameron-Reed1/todo-web/api"
"github.com/Cameron-Reed1/todo-web/db" "github.com/Cameron-Reed1/todo-web/db"
@ -57,7 +56,6 @@ func addFrontendEndpoints(mux *http.ServeMux, static_path string) {
mux.HandleFunc("/upcoming", pages.UpcomingFragment) mux.HandleFunc("/upcoming", pages.UpcomingFragment)
mux.HandleFunc("/login", pages.Login) mux.HandleFunc("/login", pages.Login)
mux.HandleFunc("/create-account", pages.CreateAccount) mux.HandleFunc("/create-account", pages.CreateAccount)
// mux.HandleFunc("/account", pages.AccountPage)
mux.HandleFunc("POST /logout", pages.Logout) mux.HandleFunc("POST /logout", pages.Logout)
mux.HandleFunc("DELETE /delete/{id}", pages.DeleteItem) mux.HandleFunc("DELETE /delete/{id}", pages.DeleteItem)
mux.HandleFunc("PATCH /set/{id}", pages.SetItemCompleted) mux.HandleFunc("PATCH /set/{id}", pages.SetItemCompleted)
@ -67,9 +65,6 @@ func addFrontendEndpoints(mux *http.ServeMux, static_path string) {
fileServer := http.FileServer(http.Dir(static_path)) fileServer := http.FileServer(http.Dir(static_path))
mux.Handle("/css/", fileServer) mux.Handle("/css/", fileServer)
mux.Handle("/js/", fileServer) mux.Handle("/js/", fileServer)
mux.Handle("/img/", fileServer)
mux.HandleFunc("/img/login.jpg", func(w http.ResponseWriter, r *http.Request) { pages.RandomImage(w, r, path.Join(static_path, "img/login/")) })
mux.HandleFunc("/img/login/", Error404)
} }
func addBackendEndpoints(mux *http.ServeMux) { func addBackendEndpoints(mux *http.ServeMux) {

View File

@ -14,7 +14,7 @@ func Login(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Location", "/") w.Header().Add("Location", "/")
w.WriteHeader(http.StatusSeeOther) w.WriteHeader(http.StatusSeeOther)
} else { } else {
templates.LoginPage(r.URL.Query().Has("basic")).Render(r.Context(), w) templates.LoginPage().Render(r.Context(), w)
} }
return return
} }
@ -53,7 +53,7 @@ func CreateAccount(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Location", "/") w.Header().Add("Location", "/")
w.WriteHeader(http.StatusSeeOther) w.WriteHeader(http.StatusSeeOther)
} else { } else {
templates.CreateAccountBox(false).Render(r.Context(), w) templates.CreateAccountBox().Render(r.Context(), w)
} }
return return
} }

View File

@ -1,27 +0,0 @@
package pages
import (
"math/rand/v2"
"net/http"
"os"
"path"
)
func RandomImage(w http.ResponseWriter, r *http.Request, basePath string) {
file, err := os.Open(basePath)
if err != nil {
return
}
defer file.Close()
files, err := file.Readdir(-1)
if err != nil {
return
}
idx := rand.UintN(uint(len(files)))
w.Header().Add("Cache-Control", "max-age=300")
http.ServeFile(w, r, path.Join(basePath, files[idx].Name()))
}

View File

@ -14,5 +14,5 @@ func RootPage(w http.ResponseWriter, r *http.Request) {
return return
} }
templates.RootPage(username, false).Render(r.Context(), w) templates.RootPage(username).Render(r.Context(), w)
} }

View File

@ -1,6 +1,6 @@
package templates package templates
templ loginSkeleton(basic_css bool) { templ loginSkeleton() {
<!Doctype HTML> <!Doctype HTML>
<html lang="en-US"> <html lang="en-US">
<head> <head>
@ -8,11 +8,7 @@ templ loginSkeleton(basic_css bool) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
if basic_css { <link rel="stylesheet" href="/css/login.css"/>
<link rel="stylesheet" href="/css/login_basic.css"/>
} else {
<link rel="stylesheet" href="/css/login.css"/>
}
<script src="/js/login.js"></script> <script src="/js/login.js"></script>
<script src="/js/lib/htmx.min.js"></script> <script src="/js/lib/htmx.min.js"></script>
@ -24,34 +20,32 @@ templ loginSkeleton(basic_css bool) {
</html> </html>
} }
templ LoginPage(basic_css bool) { templ LoginPage() {
@loginSkeleton(basic_css) { @loginSkeleton() {
<form id="login-box" hx-post="/login" hx-swap="none"> <form id="login-box" hx-post="/login" hx-swap="none">
<h1>Welcome</h1> <h1>Login</h1>
<div class="credentials-wrapper"> <div>
<label for="username">Username</label> <label for="username">Username</label><br/>
<input id="username" class="credentials" name="username" type="text" placeholder="Username" required/> <input id="username" name="username" type="text" required/>
<div class="gap"></div> <div style="margin: 20px"></div>
<label for="password">Password</label> <label for="password">Password</label><br/>
<input id="password" class="credentials" name="password" type="password" placeholder="Password" required/> <input id="password" name="password" type="password" required/>
<div> <label for="stay-logged-in">Keep me logged in</label>
<label class="normal-text" for="stay-logged-in">Keep me logged in</label> <input id="stay-logged-in" name="stay-logged-in" type="checkbox"/><br/>
<input id="stay-logged-in" name="stay-logged-in" type="checkbox"/>
</div>
<button type="submit" class="login-btn">Log in</button> <button type="submit">Log in</button>
<a href="/create-account">No Account? Create one!</a> <a href="/create-account">Create Account</a>
</div> </div>
</form> </form>
} }
} }
templ CreateAccountBox(basic_css bool) { templ CreateAccountBox() {
@loginSkeleton(basic_css) { @loginSkeleton() {
<form id="login-box" hx-post="/create-account"> <form id="login-box" hx-post="/create-account">
<h1>Create Account</h1> <h1>Create Account</h1>

View File

@ -8,7 +8,7 @@ package templates
import "github.com/a-h/templ" import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime" import templruntime "github.com/a-h/templ/runtime"
func loginSkeleton(basic_css bool) templ.Component { func loginSkeleton() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
@ -26,22 +26,7 @@ func loginSkeleton(basic_css bool) templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent templ_7745c5c3_Var1 = templ.NopComponent
} }
ctx = templ.ClearChildren(ctx) ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype HTML><html lang=\"en-US\"><head><title>Todo login</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">") _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype HTML><html lang=\"en-US\"><head><title>Todo login</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><link rel=\"stylesheet\" href=\"/css/login.css\"><script src=\"/js/login.js\"></script><script src=\"/js/lib/htmx.min.js\"></script></head><body>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if basic_css {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"/css/login_basic.css\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"/css/login.css\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"/js/login.js\"></script><script src=\"/js/lib/htmx.min.js\"></script></head><body>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -57,7 +42,7 @@ func loginSkeleton(basic_css bool) templ.Component {
}) })
} }
func LoginPage(basic_css bool) templ.Component { func LoginPage() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
@ -87,13 +72,13 @@ func LoginPage(basic_css bool) templ.Component {
}() }()
} }
ctx = templ.InitializeContext(ctx) ctx = templ.InitializeContext(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"login-box\" hx-post=\"/login\" hx-swap=\"none\"><h1>Welcome</h1><div class=\"credentials-wrapper\"><label for=\"username\">Username</label> <input id=\"username\" class=\"credentials\" name=\"username\" type=\"text\" placeholder=\"Username\" required><div class=\"gap\"></div><label for=\"password\">Password</label> <input id=\"password\" class=\"credentials\" name=\"password\" type=\"password\" placeholder=\"Password\" required><div><label class=\"normal-text\" for=\"stay-logged-in\">Keep me logged in</label> <input id=\"stay-logged-in\" name=\"stay-logged-in\" type=\"checkbox\"></div><button type=\"submit\" class=\"login-btn\">Log in</button> <a href=\"/create-account\">No Account? Create one!</a></div></form>") _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"login-box\" hx-post=\"/login\" hx-swap=\"none\"><h1>Login</h1><div><label for=\"username\">Username</label><br><input id=\"username\" name=\"username\" type=\"text\" required><div style=\"margin: 20px\"></div><label for=\"password\">Password</label><br><input id=\"password\" name=\"password\" type=\"password\" required> <label for=\"stay-logged-in\">Keep me logged in</label> <input id=\"stay-logged-in\" name=\"stay-logged-in\" type=\"checkbox\"><br><button type=\"submit\">Log in</button> <a href=\"/create-account\">Create Account</a></div></form>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
return templ_7745c5c3_Err return templ_7745c5c3_Err
}) })
templ_7745c5c3_Err = loginSkeleton(basic_css).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) templ_7745c5c3_Err = loginSkeleton().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@ -101,7 +86,7 @@ func LoginPage(basic_css bool) templ.Component {
}) })
} }
func CreateAccountBox(basic_css bool) templ.Component { func CreateAccountBox() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
@ -137,7 +122,7 @@ func CreateAccountBox(basic_css bool) templ.Component {
} }
return templ_7745c5c3_Err return templ_7745c5c3_Err
}) })
templ_7745c5c3_Err = loginSkeleton(basic_css).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) templ_7745c5c3_Err = loginSkeleton().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@ -6,7 +6,7 @@ import (
"github.com/Cameron-Reed1/todo-web/types" "github.com/Cameron-Reed1/todo-web/types"
) )
templ RootPage(username string, basic_css bool) { templ RootPage(username string) {
<!Doctype HTML> <!Doctype HTML>
<html lang="en-US" data-show-completed="false"> <html lang="en-US" data-show-completed="false">
<head> <head>
@ -14,11 +14,7 @@ templ RootPage(username string, basic_css bool) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
if basic_css { <link rel="stylesheet" href="/css/styles.css"/>
<link rel="stylesheet" href="/css/basic.css"/>
} else {
<link rel="stylesheet" href="/css/styles.css"/>
}
<script src="/js/script.js"></script> <script src="/js/script.js"></script>
<script src="/js/lib/htmx.min.js"></script> <script src="/js/lib/htmx.min.js"></script>

View File

@ -14,7 +14,7 @@ import (
"github.com/Cameron-Reed1/todo-web/types" "github.com/Cameron-Reed1/todo-web/types"
) )
func RootPage(username string, basic_css bool) templ.Component { func RootPage(username string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
@ -32,29 +32,14 @@ func RootPage(username string, basic_css bool) templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent templ_7745c5c3_Var1 = templ.NopComponent
} }
ctx = templ.ClearChildren(ctx) ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype HTML><html lang=\"en-US\" data-show-completed=\"false\"><head><title>Todo</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">") _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype HTML><html lang=\"en-US\" data-show-completed=\"false\"><head><title>Todo</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><link rel=\"stylesheet\" href=\"/css/styles.css\"><script src=\"/js/script.js\"></script><script src=\"/js/lib/htmx.min.js\"></script><!-- Font Awesome --><script src=\"https://kit.fontawesome.com/469cdddb31.js\" crossorigin=\"anonymous\"></script></head><body><nav><div id=\"nav-container\"><div id=\"nav-left\" class=\"nav-section\"><a id=\"new-button\" class=\"focus-highlight\" href=\"#create-item\">New</a></div><div id=\"nav-center\" class=\"nav-section\"></div><div id=\"nav-right\" class=\"nav-section\"><div><label for=\"show-completed\">Show completed</label> <input id=\"show-completed\" type=\"checkbox\" name=\"show-completed\"></div><div id=\"profile\"><div id=\"profile-icon\" class=\"focus-highlight\"><i class=\"fa-solid fa-user\"></i> <i class=\"fa-solid fa-caret-down\"></i></div><div id=\"profile-dropdown\"><div id=\"profile-name\" class=\"focus-highlight\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if basic_css {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"/css/basic.css\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"/css/styles.css\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"/js/script.js\"></script><script src=\"/js/lib/htmx.min.js\"></script><!-- Font Awesome --><script src=\"https://kit.fontawesome.com/469cdddb31.js\" crossorigin=\"anonymous\"></script></head><body><nav><div id=\"nav-container\"><div id=\"nav-left\" class=\"nav-section\"><a id=\"new-button\" class=\"focus-highlight\" href=\"#create-item\">New</a></div><div id=\"nav-center\" class=\"nav-section\"></div><div id=\"nav-right\" class=\"nav-section\"><div><label for=\"show-completed\">Show completed</label> <input id=\"show-completed\" type=\"checkbox\" name=\"show-completed\"></div><div id=\"profile\"><div id=\"profile-icon\" class=\"focus-highlight\"><i class=\"fa-solid fa-user\"></i> <i class=\"fa-solid fa-caret-down\"></i></div><div id=\"profile-dropdown\"><div id=\"profile-name\" class=\"focus-highlight\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var2 string var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(username) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(username)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 48, Col: 85} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 44, Col: 85}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -103,7 +88,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("item-%d", item.Id)) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("item-%d", item.Id))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 132, Col: 45} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 128, Col: 45}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -116,7 +101,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var5 string var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Id)) templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Id))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 132, Col: 105} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 128, Col: 105}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -129,7 +114,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var6 string var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Start)) templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Start))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 132, Col: 150} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 128, Col: 150}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -142,7 +127,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var7 string var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Due)) templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", item.Due))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 132, Col: 191} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 128, Col: 191}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -165,7 +150,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var8 string var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(string(templ.URL(fmt.Sprintf("/set/%d", item.Id)))) templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(string(templ.URL(fmt.Sprintf("/set/%d", item.Id))))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 133, Col: 137} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 129, Col: 137}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -178,7 +163,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var9 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(item.Text) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(item.Text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 134, Col: 42} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 130, Col: 42}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -191,7 +176,7 @@ func TodoItem(item types.Todo) templ.Component {
var templ_7745c5c3_Var10 string var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("/delete/%d", item.Id)) templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("/delete/%d", item.Id))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 137, Col: 101} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 133, Col: 101}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -230,7 +215,7 @@ func OobTodoItem(targetSelector string, item types.Todo) templ.Component {
var templ_7745c5c3_Var12 string var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s:%s", "afterend", targetSelector)) templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s:%s", "afterend", targetSelector))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 143, Col: 71} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 139, Col: 71}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -277,7 +262,7 @@ func TodoList(fillerText string, items []types.Todo) templ.Component {
var templ_7745c5c3_Var14 string var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(items))) templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(items)))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 149, Col: 80} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 145, Col: 80}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -290,7 +275,7 @@ func TodoList(fillerText string, items []types.Todo) templ.Component {
var templ_7745c5c3_Var15 string var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fillerText) templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fillerText)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 150, Col: 45} return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/templates/root.templ`, Line: 146, Col: 45}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -9,75 +9,48 @@ body {
align-items: center; align-items: center;
font-family: sans-serif; font-family: sans-serif;
background-image: url(/img/login.jpg);
background-size: cover;
background-position: center;
} }
#login-box { #login-box {
backdrop-filter: blur(10px); padding: 0 10px;
border: none; width: 275px;
border-radius: 25px; height: min(calc(100lvh - 110px), 450px);
background-color: #27272750; border: 4px solid black;
padding: 25px; border-radius: 12px;
width: 750px;
height: 500px;
box-shadow: 0px 10px 50px 2px rgba(0,0,0,0.95);
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-evenly; justify-content: space-evenly;
} }
h1 { label {
text-align: center; margin-left: 4px;
color: white;
}
a {
display: block;
font-size: .85rem;
}
p, a, .normal-text {
color: white;
text-decoration: none;
}
.credentials {
border: none;
padding: 10px;
border-radius: 10px;
margin: 20px;
background-color: #27272750;
color: white;
}
.login-btn {
padding: 10px 20px;
text-decoration: none;
border-radius: 6px;
font-size: 1rem;
cursor: pointer;
margin: 35px 0 25px 0;
background-color: green;
color: white;
border: none;
}
.credentials-wrapper {
display: grid;
justify-items: center;
}
.credentials-wrapper > label {
display: none;
} }
input[type="text"], input[type="text"],
input[type="password"] { input[type="password"] {
width: 267px; width: 267px;
} }
button {
padding: 10px 20px;
text-decoration: none;
border: 2px solid;
border-radius: 6px;
box-shadow: black 2px 2px 3px 0;
background-color: white;
font-size: 1rem;
cursor: pointer;
margin: 35px 0 25px 0;
color: blue;
}
a {
display: block;
font-size: .85rem;
text-decoration: none;
}
h1 {
text-align: center;
}

View File

@ -1,64 +0,0 @@
body {
margin: 0;
padding: 0;
height: 100vh;
height: 100lvh;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-family: sans-serif;
}
#login-box {
padding: 0 10px;
width: 275px;
height: min(calc(100lvh - 110px), 450px);
border: 4px solid black;
border-radius: 12px;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-evenly;
}
label {
margin-left: 4px;
}
input[type="text"],
input[type="password"] {
width: 267px;
}
input::placeholder {
color: transparent;
}
button {
padding: 10px 20px;
text-decoration: none;
border: 2px solid;
border-radius: 6px;
box-shadow: black 2px 2px 3px 0;
background-color: white;
font-size: 1rem;
cursor: pointer;
margin: 35px 0 25px 0;
color: blue;
}
a {
display: block;
font-size: .85rem;
text-decoration: none;
}
h1 {
text-align: center;
}
.gap {
height: 20px;
}

View File

@ -1 +0,0 @@
*.jpg