diff --git a/knockoutwhistweb/app/assets/stylesheets/dark-mode.less b/knockoutwhistweb/app/assets/stylesheets/dark-mode.less index 6249ca9..17b7f1a 100644 --- a/knockoutwhistweb/app/assets/stylesheets/dark-mode.less +++ b/knockoutwhistweb/app/assets/stylesheets/dark-mode.less @@ -1,6 +1,13 @@ @media (prefers-color-scheme: dark) { :root { --background-image: url('/assets/images/background.png'); - --color: white; + --color: #f8f9fa; /* Light text on dark bg */ + + /* Bootstrap variable overrides for dark mode */ + --bs-body-color: var(--color); + --bs-link-color: #66b2ff; + --bs-link-hover-color: #99ccff; + --bs-border-color: rgba(255, 255, 255, 0.2); + --bs-heading-color: var(--color); } } diff --git a/knockoutwhistweb/app/assets/stylesheets/main.less b/knockoutwhistweb/app/assets/stylesheets/main.less index 8bc3b69..d43ad95 100644 --- a/knockoutwhistweb/app/assets/stylesheets/main.less +++ b/knockoutwhistweb/app/assets/stylesheets/main.less @@ -2,6 +2,19 @@ @import "dark-mode.less"; @import "login.less"; +/* Provide default (light) variables so the site works even if light-mode.less fails */ +:root { + --background-image: url('/assets/images/img.png'); + --color: #212529; /* Bootstrap body text default */ + + /* Bootstrap variable overrides for light mode */ + --bs-body-color: var(--color) !important; + --bs-link-color: #0d6efd !important; + --bs-link-hover-color: #0a58ca !important; + --bs-border-color: rgba(0, 0, 0, 0.125) !important; + --bs-heading-color: var(--color) !important; +} + @background-image: var(--background-image); @color: var(--color); @keyframes slideIn { @@ -10,8 +23,33 @@ } .game-field-background { background-image: @background-image; - background-size: 100vw 100vh; + background-size: cover; + background-position: center center; background-repeat: no-repeat; + background-attachment: fixed; +} + +.navbar-header{ + text-align:center; +} + +.navbar-toggle { + float: none; + margin-right:0; +} + +/* Ensure body text color follows theme variable and works with Bootstrap */ +body { + color: @color; +} + +.footer { + width: 100%; + text-align: center; + font-size: 12px; + color: @color; + padding: 0.5rem 0; + flex-grow: 1; /* fill remaining vertical space as visual footer background */ } .game-field { @@ -19,6 +57,7 @@ inset: 0; overflow: auto; } + #sessions { display: flex; flex-direction: column; diff --git a/knockoutwhistweb/app/controllers/MainMenuController.scala b/knockoutwhistweb/app/controllers/MainMenuController.scala index 60b0081..55c4a1b 100644 --- a/knockoutwhistweb/app/controllers/MainMenuController.scala +++ b/knockoutwhistweb/app/controllers/MainMenuController.scala @@ -61,9 +61,7 @@ class MainMenuController @Inject()( } } - def rules(): Action[AnyContent] = { - Action { implicit request => - Ok(views.html.mainmenu.rules()) - } + def rules(): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] => + Ok(views.html.mainmenu.rules(Some(request.user))) } } \ No newline at end of file diff --git a/knockoutwhistweb/app/logic/user/impl/StubUserManager.scala b/knockoutwhistweb/app/logic/user/impl/StubUserManager.scala index 44f71ee..398a908 100644 --- a/knockoutwhistweb/app/logic/user/impl/StubUserManager.scala +++ b/knockoutwhistweb/app/logic/user/impl/StubUserManager.scala @@ -22,6 +22,12 @@ class StubUserManager @Inject()(val config: Config) extends UserManager { id = java.util.UUID.fromString("223e4567-e89b-12d3-a456-426614174000"), name = "Leon", passwordHash = UserHash.hashPW("password123") + ), + "Jakob" -> User( + internalId = 2L, + id = java.util.UUID.fromString("323e4567-e89b-12d3-a456-426614174000"), + name = "Jakob", + passwordHash = UserHash.hashPW("password123") ) ) diff --git a/knockoutwhistweb/app/views/ingame/ingame.scala.html b/knockoutwhistweb/app/views/ingame/ingame.scala.html index 28b8550..dc35d77 100644 --- a/knockoutwhistweb/app/views/ingame/ingame.scala.html +++ b/knockoutwhistweb/app/views/ingame/ingame.scala.html @@ -56,16 +56,16 @@
- @for(i <- player.currentHand().get.cards.indices) { -
-
- - -
-
- } + @for(i <- player.currentHand().get.cards.indices) { +
+
+ + +
+
+ }
} diff --git a/knockoutwhistweb/app/views/login/login.scala.html b/knockoutwhistweb/app/views/login/login.scala.html index 219707e..60aa0e4 100644 --- a/knockoutwhistweb/app/views/login/login.scala.html +++ b/knockoutwhistweb/app/views/login/login.scala.html @@ -1,20 +1,21 @@ @() @main("Login") { +
-

Login

+

Login

- - + +
- - + +
@@ -34,6 +35,11 @@
+
+ + @* Here's where we render the page title `String`. *@ @title - - - @* And here's where we render the `Html` object containing - * the page content. *@ - @content + +
+ @* And here's where we render the `Html` object containing + * the page content. *@ + @content +
+ +
+
diff --git a/knockoutwhistweb/app/views/mainmenu/creategame.scala.html b/knockoutwhistweb/app/views/mainmenu/creategame.scala.html index 372449b..1e5905c 100644 --- a/knockoutwhistweb/app/views/mainmenu/creategame.scala.html +++ b/knockoutwhistweb/app/views/mainmenu/creategame.scala.html @@ -2,7 +2,7 @@ @main("Create Game") { @navbar(user) - +
@@ -14,7 +14,7 @@
- +
2 3 diff --git a/knockoutwhistweb/app/views/mainmenu/navbar.scala.html b/knockoutwhistweb/app/views/mainmenu/navbar.scala.html index 99d5c83..3008b6d 100644 --- a/knockoutwhistweb/app/views/mainmenu/navbar.scala.html +++ b/knockoutwhistweb/app/views/mainmenu/navbar.scala.html @@ -1,16 +1,16 @@ @(user: Option[model.users.User])