Single player game close to finished
This commit is contained in:
parent
3385118b14
commit
584b1c9ef9
12 changed files with 179 additions and 6454 deletions
26
shared/src/components.gleam
Normal file
26
shared/src/components.gleam
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import gleam/int
|
||||
import gleam/option.{type Option, None, Some}
|
||||
import lustre/attribute.{class}
|
||||
import lustre/element.{type Element}
|
||||
import lustre/element/html
|
||||
import lustre/event
|
||||
|
||||
pub fn click_cell(
|
||||
tag: Option(String),
|
||||
id_value_pair: #(String, String),
|
||||
on_click: fn(String) -> msg,
|
||||
) -> Element(msg) {
|
||||
let #(id, value) = id_value_pair
|
||||
html.div([class("participant-login"), event.on_click(on_click(id))], [
|
||||
html.div([class("participant-name")], [
|
||||
html.text(
|
||||
"► "
|
||||
<> case tag {
|
||||
Some(text) -> "[#" <> text <> "] "
|
||||
None -> ""
|
||||
}
|
||||
<> value,
|
||||
),
|
||||
]),
|
||||
])
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue