Bingo board for a D&D session I play in bingo.lesbian.skin/
gleam bingo dnd

Basic functionality

Signed-off-by: Naomi Roberts <mia@naomieow.xyz>

lesbian.skin 43e53ada 957c34aa

verified
+1
.gitignore
··· 3 3 /build 4 4 erl_crash.dump 5 5 .direnv 6 + priv/static/voyagers_bingo*
+7
LICENSE
··· 1 + Copyright © 2025 Naomi Roberts 2 + 3 + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 + 5 + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 + 7 + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+1
flake.nix
··· 18 18 gleam 19 19 erlang_28 20 20 beam28Packages.rebar3 21 + inotify-tools 21 22 ]; 22 23 }; 23 24 });
+5
gleam.toml
··· 14 14 15 15 [dependencies] 16 16 gleam_stdlib = ">= 0.44.0 and < 2.0.0" 17 + lustre = ">= 5.2.1 and < 6.0.0" 18 + sketch = ">= 4.2.0 and < 5.0.0" 19 + sketch_lustre = ">= 3.1.1 and < 4.0.0" 20 + iv = ">= 1.3.2 and < 2.0.0" 17 21 18 22 [dev-dependencies] 19 23 gleeunit = ">= 1.0.0 and < 2.0.0" 24 + lustre_dev_tools = ">= 1.9.0 and < 2.0.0"
+27
index.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 + 7 + <title>🚧 voyagers_bingo</title> 8 + 9 + <!-- Uncomment this if you use the TailwindCSS integration --> 10 + <!-- <link rel="stylesheet" href="/priv/static/voyagers_bingo.css"> --> 11 + <script type="module" src="/priv/static/voyagers_bingo.mjs"></script> 12 + </head> 13 + <style> 14 + html { 15 + display: table; 16 + margin: auto; 17 + } 18 + 19 + body { 20 + display: table-cell; 21 + } 22 + </style> 23 + 24 + <body> 25 + <div id="app"></div> 26 + </body> 27 + </html>
+45
manifest.toml
··· 2 2 # You typically do not need to edit this file 3 3 4 4 packages = [ 5 + { name = "argv", version = "1.0.2", build_tools = ["gleam"], requirements = [], otp_app = "argv", source = "hex", outer_checksum = "BA1FF0929525DEBA1CE67256E5ADF77A7CDDFE729E3E3F57A5BDCAA031DED09D" }, 6 + { name = "directories", version = "1.2.0", build_tools = ["gleam"], requirements = ["envoy", "gleam_stdlib", "platform", "simplifile"], otp_app = "directories", source = "hex", outer_checksum = "D13090CFCDF6759B87217E8DDD73A75903A700148A82C1D33799F333E249BF9E" }, 7 + { name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" }, 8 + { name = "exception", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "329D269D5C2A314F7364BD2711372B6F2C58FA6F39981572E5CA68624D291F8C" }, 9 + { name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" }, 10 + { name = "fs", version = "11.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "fs", source = "hex", outer_checksum = "DD00A61D89EAC01D16D3FC51D5B0EB5F0722EF8E3C1A3A547CD086957F3260A9" }, 11 + { name = "gleam_community_ansi", version = "1.4.3", build_tools = ["gleam"], requirements = ["gleam_community_colour", "gleam_regexp", "gleam_stdlib"], otp_app = "gleam_community_ansi", source = "hex", outer_checksum = "8A62AE9CC6EA65BEA630D95016D6C07E4F9973565FA3D0DE68DC4200D8E0DD27" }, 12 + { name = "gleam_community_colour", version = "2.0.2", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "E34DD2C896AC3792151EDA939DA435FF3B69922F33415ED3C4406C932FBE9634" }, 13 + { name = "gleam_crypto", version = "1.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "50774BAFFF1144E7872814C566C5D653D83A3EBF23ACC3156B757A1B6819086E" }, 14 + { name = "gleam_deque", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_deque", source = "hex", outer_checksum = "64D77068931338CF0D0CB5D37522C3E3CCA7CB7D6C5BACB41648B519CC0133C7" }, 15 + { name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" }, 16 + { name = "gleam_http", version = "4.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "DD0271B32C356FB684EC7E9F48B1E835D0480168848581F68983C0CC371405D4" }, 17 + { name = "gleam_httpc", version = "4.1.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gleam_httpc", source = "hex", outer_checksum = "C670EBD46FC1472AD5F1F74F1D3938D1D0AC1C7531895ED1D4DDCB6F07279F43" }, 18 + { name = "gleam_json", version = "3.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "874FA3C3BB6E22DD2BB111966BD40B3759E9094E05257899A7C08F5DE77EC049" }, 19 + { name = "gleam_otp", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "7020E652D18F9ABAC9C877270B14160519FA0856EE80126231C505D719AD68DA" }, 20 + { name = "gleam_package_interface", version = "3.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_package_interface", source = "hex", outer_checksum = "8F2D19DE9876D9401BB0626260958A6B1580BB233489C32831FE74CE0ACAE8B4" }, 21 + { name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" }, 5 22 { name = "gleam_stdlib", version = "0.62.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "DC8872BC0B8550F6E22F0F698CFE7F1E4BDA7312FDEB40D6C3F44C5B706C8310" }, 23 + { name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" }, 6 24 { name = "gleeunit", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "FDC68A8C492B1E9B429249062CD9BAC9B5538C6FBF584817205D0998C42E1DAC" }, 25 + { name = "glint", version = "1.2.1", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "snag"], otp_app = "glint", source = "hex", outer_checksum = "2214C7CEFDE457CEE62140C3D4899B964E05236DA74E4243DFADF4AF29C382BB" }, 26 + { name = "glisten", version = "8.0.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "logging", "telemetry"], otp_app = "glisten", source = "hex", outer_checksum = "534BB27C71FB9E506345A767C0D76B17A9E9199934340C975DC003C710E3692D" }, 27 + { name = "gramps", version = "3.0.3", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gramps", source = "hex", outer_checksum = "75F0F20C867A6217CBB632A7E563568D6A6366B850815041E8E0B4F179681E53" }, 28 + { name = "houdini", version = "1.2.0", build_tools = ["gleam"], requirements = [], otp_app = "houdini", source = "hex", outer_checksum = "5DB1053F1AF828049C2B206D4403C18970ABEF5C18671CA3C2D2ED0DD64F6385" }, 29 + { name = "hpack_erl", version = "0.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "hpack", source = "hex", outer_checksum = "D6137D7079169D8C485C6962DFE261AF5B9EF60FBC557344511C1E65E3D95FB0" }, 30 + { name = "iv", version = "1.3.2", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_yielder"], otp_app = "iv", source = "hex", outer_checksum = "1FE22E047705BE69EA366E3A2E73C2E1310CBCB27DDE767DE17AE3FA86499947" }, 31 + { name = "logging", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "logging", source = "hex", outer_checksum = "1098FBF10B54B44C2C7FDF0B01C1253CAFACDACABEFB4B0D027803246753E06D" }, 32 + { name = "lustre", version = "5.2.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib", "houdini"], otp_app = "lustre", source = "hex", outer_checksum = "DCD121F8E6B7E179B27D9A8AEB6C828D8380E26DF2E16D078511EDAD1CA9F2A7" }, 33 + { name = "lustre_dev_tools", version = "1.9.0", build_tools = ["gleam"], requirements = ["argv", "filepath", "fs", "gleam_community_ansi", "gleam_crypto", "gleam_deque", "gleam_erlang", "gleam_http", "gleam_httpc", "gleam_json", "gleam_otp", "gleam_package_interface", "gleam_regexp", "gleam_stdlib", "glint", "glisten", "mist", "repeatedly", "simplifile", "term_size", "tom", "wisp"], otp_app = "lustre_dev_tools", source = "hex", outer_checksum = "2132E6B2B7E89ED87C138FFE1F2CD70D859258D67222F26B5793CDACE9B07D75" }, 34 + { name = "marceau", version = "1.3.0", build_tools = ["gleam"], requirements = [], otp_app = "marceau", source = "hex", outer_checksum = "2D1C27504BEF45005F5DFB18591F8610FB4BFA91744878210BDC464412EC44E9" }, 35 + { name = "mist", version = "5.0.2", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "gleam_yielder", "glisten", "gramps", "hpack_erl", "logging"], otp_app = "mist", source = "hex", outer_checksum = "0716CE491EA13E1AA1EFEC4B427593F8EB2B953B6EBDEBE41F15BE3D06A22918" }, 36 + { name = "murmur3a", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "murmur3a", source = "hex", outer_checksum = "DAA714CEF379915D0F718BC410389245AA8ABFB6F48C73ADB9F011B009F28893" }, 37 + { name = "platform", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "platform", source = "hex", outer_checksum = "8339420A95AD89AAC0F82F4C3DB8DD401041742D6C3F46132A8739F6AEB75391" }, 38 + { name = "repeatedly", version = "2.1.2", build_tools = ["gleam"], requirements = [], otp_app = "repeatedly", source = "hex", outer_checksum = "93AE1938DDE0DC0F7034F32C1BF0D4E89ACEBA82198A1FE21F604E849DA5F589" }, 39 + { name = "simplifile", version = "2.3.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0A868DAC6063D9E983477981839810DC2E553285AB4588B87E3E9C96A7FB4CB4" }, 40 + { name = "sketch", version = "4.2.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "murmur3a"], otp_app = "sketch", source = "hex", outer_checksum = "4FFB47A957D39DB1487790E23662E654E91B7D3AA36C99333335E39E48241128" }, 41 + { name = "sketch_lustre", version = "3.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre", "sketch"], otp_app = "sketch_lustre", source = "hex", outer_checksum = "16DB17FE9C46993D32BE8448E567E5FAD9324BE4254FFC604339A5D3BECBE285" }, 42 + { name = "snag", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "snag", source = "hex", outer_checksum = "7E9F06390040EB5FAB392CE642771484136F2EC103A92AE11BA898C8167E6E17" }, 43 + { name = "telemetry", version = "1.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6" }, 44 + { name = "term_size", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "term_size", source = "hex", outer_checksum = "D00BD2BC8FB3EBB7E6AE076F3F1FF2AC9D5ED1805F004D0896C784D06C6645F1" }, 45 + { name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" }, 46 + { name = "wisp", version = "1.8.0", build_tools = ["gleam"], requirements = ["directories", "exception", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_stdlib", "houdini", "logging", "marceau", "mist", "simplifile"], otp_app = "wisp", source = "hex", outer_checksum = "0FE9049AFFB7C8D5FC0B154EEE2704806F4D51B97F44925D69349B3F4F192957" }, 7 47 ] 8 48 9 49 [requirements] 10 50 gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" } 11 51 gleeunit = { version = ">= 1.0.0 and < 2.0.0" } 52 + iv = { version = ">= 1.3.2 and < 2.0.0" } 53 + lustre = { version = ">= 5.2.1 and < 6.0.0" } 54 + lustre_dev_tools = { version = ">= 1.9.0 and < 2.0.0" } 55 + sketch = { version = ">= 4.2.0 and < 5.0.0" } 56 + sketch_lustre = { version = ">= 3.1.1 and < 4.0.0" }
+196 -2
src/voyagers_bingo.gleam
··· 1 - import gleam/io 1 + import gleam/bool 2 + import gleam/float 3 + import gleam/int 4 + import gleam/list 5 + import gleam/result 6 + import iv.{type Array} 7 + import lustre 8 + import lustre/attribute 9 + import lustre/effect 10 + import lustre/event 11 + import sketch.{type StyleSheet} 12 + import sketch/css 13 + import sketch/css/length.{vw} 14 + import sketch/lustre as sklustre 15 + import sketch/lustre/element 16 + import sketch/lustre/element/html 17 + import voyagers_bingo/styles 18 + 19 + const available_squares = [ 20 + "PC Flirting", "Ben Blushing", "Off Topic", "Pidgeon", 21 + ] 22 + 23 + pub type Msg { 24 + UserRequestedNewSheet(rows: Int, columns: Int) 25 + UserSelectedSquare(x: Int, y: Int) 26 + UserDeselectedSquare(x: Int, y: Int) 27 + CreatedNewSheet(sheet: Array(Array(Square))) 28 + FailedToCreateSheet 29 + UserSetX(x: Int) 30 + UserSetY(y: Int) 31 + } 32 + 33 + pub type Square { 34 + Square(text: String, crossed: Bool) 35 + } 36 + 37 + pub type Model { 38 + Model(sheet: Array(Array(Square)), failed: Bool, x: Int, y: Int) 39 + } 40 + 41 + pub fn sheet_with_size( 42 + rows rows: Int, 43 + columns columns: Int, 44 + ) -> Array(Array(Square)) { 45 + let assert Ok(random_squares) = 46 + list.shuffle(available_squares) 47 + |> list.sized_chunk(rows * columns) 48 + |> list.first() 49 + 50 + let square_rows = 51 + random_squares 52 + |> list.sized_chunk(columns) 53 + 54 + square_rows 55 + |> list.map(fn(row) { 56 + row 57 + |> list.map(fn(text) { Square(text, False) }) 58 + |> iv.from_list() 59 + }) 60 + |> iv.from_list() 61 + } 62 + 63 + fn init(_flags) -> #(Model, effect.Effect(Msg)) { 64 + let sqrt = 65 + int.square_root(list.length(available_squares)) 66 + |> result.unwrap(2.0) 67 + |> float.floor() 68 + |> float.round() 69 + |> int.min(5) 70 + 71 + #( 72 + Model(sheet: sheet_with_size(sqrt, sqrt), failed: False, x: sqrt, y: sqrt), 73 + effect.none(), 74 + ) 75 + } 76 + 77 + fn update(model: Model, msg: Msg) -> #(Model, effect.Effect(Msg)) { 78 + case msg { 79 + UserRequestedNewSheet(rows:, columns:) -> { 80 + let too_big = { rows * columns } > list.length(available_squares) 81 + use <- bool.guard(when: too_big, return: #( 82 + model, 83 + effect.from(fn(dispatch) { dispatch(FailedToCreateSheet) }), 84 + )) 85 + #( 86 + model, 87 + effect.from(fn(dispatch) { 88 + let sheet = sheet_with_size(rows:, columns:) 89 + 90 + dispatch(CreatedNewSheet(sheet)) 91 + }), 92 + ) 93 + } 94 + UserSelectedSquare(x:, y:) -> { 95 + let assert Ok(row) = iv.get(model.sheet, x) 96 + let assert Ok(value) = iv.get(row, y) 97 + let assert Ok(updated_row) = 98 + iv.set(row, y, Square(..value, crossed: True)) 99 + let assert Ok(updated) = iv.set(model.sheet, x, updated_row) 100 + #(Model(..model, sheet: updated), effect.none()) 101 + } 102 + UserDeselectedSquare(x:, y:) -> { 103 + let assert Ok(row) = iv.get(model.sheet, x) 104 + let assert Ok(value) = iv.get(row, y) 105 + let assert Ok(updated_row) = 106 + iv.set(row, y, Square(..value, crossed: False)) 107 + let assert Ok(updated) = iv.set(model.sheet, x, updated_row) 108 + #(Model(..model, sheet: updated), effect.none()) 109 + } 110 + CreatedNewSheet(sheet:) -> #( 111 + Model(..model, sheet:, failed: False), 112 + effect.none(), 113 + ) 114 + FailedToCreateSheet -> #(Model(..model, failed: True), effect.none()) 115 + UserSetX(x:) -> #(Model(..model, x:, failed: False), effect.none()) 116 + UserSetY(y:) -> #(Model(..model, y:, failed: False), effect.none()) 117 + } 118 + } 119 + 120 + fn view(model: Model) -> element.Element(Msg) { 121 + html.div(styles.container(), [], [ 122 + html.h1_([], [html.text("Voyagers Bingo")]), 123 + html.div( 124 + styles.grid(), 125 + [], 126 + model.sheet 127 + |> iv.index_map(fn(row, x) { 128 + html.span( 129 + styles.row(), 130 + [], 131 + iv.index_map(row, fn(square: Square, y) { 132 + html.button( 133 + styles.square(square.crossed), 134 + [ 135 + event.on_click(case square.crossed { 136 + True -> UserDeselectedSquare(x:, y:) 137 + False -> UserSelectedSquare(x:, y:) 138 + }), 139 + ], 140 + [html.text(square.text)], 141 + ) 142 + }) 143 + |> iv.to_list(), 144 + ) 145 + }) 146 + |> iv.to_list(), 147 + ), 148 + html.input_([ 149 + attribute.type_("number"), 150 + attribute.placeholder("Rows: 2"), 151 + event.on_input(fn(content) { 152 + let assert Ok(num) = int.parse(content) 153 + UserSetX(num) 154 + }), 155 + ]), 156 + html.input_([ 157 + attribute.type_("number"), 158 + attribute.placeholder("Columns: 2"), 159 + event.on_input(fn(content) { 160 + let assert Ok(num) = int.parse(content) 161 + UserSetY(num) 162 + }), 163 + ]), 164 + html.button( 165 + css.class([css.width_("fit-content")]), 166 + [event.on_click(UserRequestedNewSheet(model.x, model.y))], 167 + [html.text("New Sheet")], 168 + ), 169 + case model.failed { 170 + True -> 171 + html.h4(css.class([css.color("red")]), [], [ 172 + html.text( 173 + "Failed to create sheet of size " 174 + <> int.to_string(model.x) 175 + <> "x" 176 + <> int.to_string(model.y) 177 + <> " (" 178 + <> int.to_string(model.x * model.y) 179 + <> ") - maximum possible size is " 180 + <> int.to_string(list.length(available_squares)), 181 + ), 182 + ]) 183 + False -> element.none() 184 + }, 185 + ]) 186 + } 187 + 188 + fn css_view(model: Model, stylesheet: StyleSheet) -> element.Element(Msg) { 189 + use <- sklustre.render(stylesheet:, in: [sklustre.node()]) 190 + view(model) 191 + } 2 192 3 193 pub fn main() -> Nil { 4 - io.println("Hello from voyagers_bingo!") 194 + let assert Ok(stylesheet) = sklustre.setup() 195 + sketch.global(stylesheet, css.global("body", [css.margin(vw(10))])) 196 + let app = lustre.application(init, update, css_view(_, stylesheet)) 197 + let assert Ok(_) = lustre.start(app, "#app", Nil) 198 + Nil 5 199 }
+50
src/voyagers_bingo/styles.gleam
··· 1 + import sketch/css 2 + import sketch/css/length.{em, px, vw} 3 + 4 + pub fn container() { 5 + css.class([ 6 + css.margin_left(vw(3)), 7 + css.gap(em(0.5)), 8 + css.display("flex"), 9 + css.flex_direction("column"), 10 + css.width_("fit-content"), 11 + css.align_items("center"), 12 + ]) 13 + } 14 + 15 + pub fn grid() { 16 + css.class([ 17 + css.display("flex"), 18 + css.flex_direction("column"), 19 + css.background_color("black"), 20 + css.width_("auto"), 21 + css.gap(em(0.5)), 22 + css.padding(em(0.5)), 23 + css.border_radius(px(4)), 24 + css.align_items("center"), 25 + css.width_("fit-content"), 26 + ]) 27 + } 28 + 29 + pub fn row() { 30 + css.class([ 31 + css.display("flex"), 32 + css.flex_direction("row"), 33 + css.gap(em(0.5)), 34 + css.width(length.percent(100)), 35 + ]) 36 + } 37 + 38 + pub fn square(checked: Bool) { 39 + css.class([ 40 + css.width(em(10.0)), 41 + css.aspect_ratio("1 / 1"), 42 + css.max_width(em(5.0)), 43 + case checked { 44 + True -> css.background("yellow") 45 + False -> css.background("white") 46 + }, 47 + css.border("none"), 48 + css.border_radius(px(4)), 49 + ]) 50 + }