diff --git a/POINTS b/POINTS new file mode 100644 index 0000000..14c8a85 --- /dev/null +++ b/POINTS @@ -0,0 +1,4 @@ +im queer: aro, enby/agen, acespec +i love tea: oolongs, pu erh, sencha +computer toucher + diff --git a/README.md b/README.md new file mode 100644 index 0000000..07d2f69 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ + + +# My queer page + +This is a (wip) page, not dissimilar to [pronouns.page](https://pronouns.page), [pronouns.cc](https://pronouns.cc) &c. that describes my queerness. + +I wanted to have a way of describing my quirks (queerks? :-P) in more detail, since labels are not everything and sometimes the conventional understanding implies stuff that are different for me (e.g. my trans-ness involves little to no dysphoria and there are no transition plans). Also, Czech language is heavily gendered, so I need more space to describe stuff than “just setting 5 pronouns”. + +And I wanted to have a testing project in Gleam (and Lustre in this case) + +## Running + +```sh +gleam build +python3 -m http.server # or any other server for local static files +badwolf http://localhost:8000 # or other browser +``` + +## Deployment + +None yet. I'll see if I can deploy this in a similar way to [my blog](https://blog.ledoian.cz/about-blog.html). + +## Tests + +I accidentally deleted the default ones, so there are none :3 diff --git a/gleam.toml b/gleam.toml new file mode 100644 index 0000000..09bccf5 --- /dev/null +++ b/gleam.toml @@ -0,0 +1,21 @@ +name = "queer_ledoian" +target = "javascript" +version = "1.0.0" + +# Fill out these fields if you intend to generate HTML documentation or publish +# your project to the Hex package manager. +# +# description = "" +# licences = ["Apache-2.0"] +# repository = { type = "github", user = "", repo = "" } +# links = [{ title = "Website", href = "" }] +# +# For a full reference of all the available options, you can have a look at +# https://gleam.run/writing-gleam/gleam-toml/. + +[dependencies] +gleam_stdlib = ">= 0.34.0 and < 2.0.0" + +[dev-dependencies] +gleeunit = ">= 1.0.0 and < 2.0.0" +lustre = ">= 4.6.1 and < 5.0.0" diff --git a/index.html b/index.html new file mode 100644 index 0000000..2ada256 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + TODO: title + + + +
+ + diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..b9f0d86 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,16 @@ +# This file was generated by Gleam +# You typically do not need to edit this file + +packages = [ + { name = "gleam_erlang", version = "0.30.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "760618870AE4A497B10C73548E6E44F43B76292A54F0207B3771CBB599C675B4" }, + { name = "gleam_json", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB10B0E7BF44282FB25162F1A24C1A025F6B93E777CCF238C4017E4EEF2CDE97" }, + { name = "gleam_otp", version = "0.14.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "5A8CE8DBD01C29403390A7BD5C0A63D26F865C83173CF9708E6E827E53159C65" }, + { name = "gleam_stdlib", version = "0.43.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "69EF22E78FDCA9097CBE7DF91C05B2A8B5436826D9F66680D879182C0860A747" }, + { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" }, + { name = "lustre", version = "4.6.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "486C3CFBD126939CAD2CA8B92A979A2DAADA5BABAA62BF2B163CD21E257BD4A1" }, +] + +[requirements] +gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleeunit = { version = ">= 1.0.0 and < 2.0.0" } +lustre = { version = ">= 4.6.1 and < 5.0.0" } diff --git a/src/queer_ledoian.gleam b/src/queer_ledoian.gleam new file mode 100644 index 0000000..4536a1a --- /dev/null +++ b/src/queer_ledoian.gleam @@ -0,0 +1,64 @@ +import gleam/bool +import gleam/io +import gleam/list +import lustre +import lustre/attribute +import lustre/element.{type Element} +import lustre/element/html +import lustre/event + +pub fn main() { + io.println("Hello from queer_ledoian!") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "#lustre-app", Nil) +} + +type Msg = Int + +type Bit { + Bit(closed: Element(Msg), open: Element(Msg)) +} + +type Model { + Model(bits: List(Bit), states: List(Bool)) +} + +fn init(_opts) { + let bits = [ + Bit(html.text("Agender"), html.text("Hi I'm agen lol")), + ] + let states = list.map(bits, fn(_) {False}) + Model(bits: bits, states: states) +} + +fn flip_at(list: List(Bool), index: Int) -> List(Bool) { + list.index_map(list, fn(elem, idx) { +// This worked too ig, but xor is fancy :-D +// case idx { +// idx if idx == index -> !elem +// _ -> elem +// } + bool.exclusive_or(elem, idx == index) + }) +} + +fn update(model, msg) { + Model(..model, states: flip_at(model.states, msg)) +} + +fn view(model: Model) { + html.div([], // no attributes, can style `main > div` or sth + list.zip(model.bits, model.states) + |> list.index_map(fn(bitstate: #(Bit, Bool), index) { + let #(bit, state) = bitstate + let style = case state { + True -> [#("display", "block")] + False -> [#("display", "none")] + } + html.div([attribute.class("bit")], [ // FIXME: This is like a lot of divs. Could we learn to alter stuff from the Model? + html.div([event.on_click(index)], [bit.closed]), + html.div([attribute.style(style)], [bit.open]), + ]) + }) + ) +} diff --git a/test/.gitkeep b/test/.gitkeep new file mode 100644 index 0000000..e69de29