Skip to content

Commit

Permalink
wip(setupview): add labels
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-borriello00 authored and manuandru committed Sep 6, 2023
1 parent 3c1d73d commit cf6568e
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/main/scala/scatan/views/setup/ScalaJsSetUpView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,41 @@ class ScalaJsSetUpView(requirements: View.Requirements[SetUpController], contain
extends SetUpView
with View.Dependencies(requirements)
with ScalaJSView(container):
val users: Int = 4

def start(): Unit =
print("Hello, world!")

override def element: Element =
// menu with 4 textbox for the players username and 4 dropdown for the players color and a button to start
/*
in this div, there are 4 textbox, one for each user name, and one button to start the game
*/
div(
cls := "setup-view",
// Title
div(
cls := "setup-title"
cls := "setup-title",
"Setup your game"
),
// Menu view with 3 buttons, play, settings and about, dispose them vertically
div(
cls := "setup-menu",
button(
cls := "setup-menu-button",
onClick.mapTo(Pages.Home) --> NavigableApplicationManager.navigateTo,
"Play"
for i <- 1 to users
yield div(
cls := "setup-menu-textbox-container",
input(
cls := "setup-menu-textbox",
placeholder := "Player " + i
),
label(
cls := "setup-menu-label",
"Player" + i
)
),
button(
cls := "setup-menu-button",
onClick.mapTo(Pages.About) --> NavigableApplicationManager.navigateTo,
"About"
onClick.mapTo(Pages.Home) --> NavigableApplicationManager.navigateTo,
"Start"
)
)
)

0 comments on commit cf6568e

Please sign in to comment.