diff --git a/.gitignore b/.gitignore index 9dca485..6a7aed8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ !.gitignore !*.go +!*.templ !*.sql !go.sum !go.mod diff --git a/features/auth/pages/login.templ b/features/auth/pages/login.templ new file mode 100644 index 0000000..3a4bcae --- /dev/null +++ b/features/auth/pages/login.templ @@ -0,0 +1,48 @@ +package pages + +import ( + "github.com/ryanhamamura/c4/features/common/layouts" + "github.com/starfederation/datastar-go/datastar" +) + +templ LoginPage() { + @layouts.Base("Login") { +
+

Login

+

Sign in to your account

+
+
+
+ + + + +
+ +
+

+ Don't have an account? Register +

+
+ } +} diff --git a/features/auth/pages/login_templ.go b/features/auth/pages/login_templ.go index 5d0cec4..55ae981 100644 --- a/features/auth/pages/login_templ.go +++ b/features/auth/pages/login_templ.go @@ -46,33 +46,46 @@ func LoginPage() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

Login

Sign in to your account

Login

Sign in to your account

Don't have an account? Register

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">

Don't have an account? Register

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/features/auth/pages/register.templ b/features/auth/pages/register.templ new file mode 100644 index 0000000..00ef50a --- /dev/null +++ b/features/auth/pages/register.templ @@ -0,0 +1,57 @@ +package pages + +import ( + "github.com/ryanhamamura/c4/features/common/layouts" + "github.com/starfederation/datastar-go/datastar" +) + +templ RegisterPage() { + @layouts.Base("Register") { +
+

Register

+

Create a new account

+
+
+
+ + + + + + +
+ +
+

+ Already have an account? Login +

+
+ } +} diff --git a/features/auth/pages/register_templ.go b/features/auth/pages/register_templ.go index 7486adb..c7961d5 100644 --- a/features/auth/pages/register_templ.go +++ b/features/auth/pages/register_templ.go @@ -46,33 +46,59 @@ func RegisterPage() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

Register

Create a new account

Register

Create a new account

Already have an account? Login

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">

Already have an account? Login

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/features/common/components/shared.templ b/features/common/components/shared.templ new file mode 100644 index 0000000..7d0b631 --- /dev/null +++ b/features/common/components/shared.templ @@ -0,0 +1,60 @@ +package components + +import "github.com/starfederation/datastar-go/datastar" + +templ BackToLobby() { + ← Back +} + +templ StealthTitle(class string) { + + + + + + +} + +templ NicknamePrompt(returnPath string) { +
+

Join Game

+

Enter your nickname to join the game.

+
+
+ + +
+ +
+
+} + +templ GameJoinPrompt(loginURL string, registerURL string, gamePath string) { +
+

Join Game

+

Log in to track your game history, or continue as a guest.

+
+ Login + Continue as Guest +
+

+ Don't have an account? + Register +

+
+} diff --git a/features/common/components/shared_templ.go b/features/common/components/shared_templ.go index 9c74d6c..7341d8c 100644 --- a/features/common/components/shared_templ.go +++ b/features/common/components/shared_templ.go @@ -107,20 +107,33 @@ func NicknamePrompt(returnPath string) templ.Component { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "

Join Game

Enter your nickname to join the game.

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" required autofocus>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -144,51 +157,51 @@ func GameJoinPrompt(loginURL string, registerURL string, gamePath string) templ. }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "

Join Game

Log in to track your game history, or continue as a guest.

Login

Join Game

Log in to track your game history, or continue as a guest.

Don't have an account? Login Register

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\">Continue as Guest

Don't have an account? Register

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }