-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guillaume Hivert <[email protected]>
- Loading branch information
Showing
16 changed files
with
479 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
pub type Model { | ||
Model | ||
Model(input: String) | ||
} | ||
|
||
pub fn init() { | ||
Model | ||
Model(input: "") | ||
} | ||
|
||
pub fn update_input(model: Model, content: String) { | ||
Model(..model, input: content) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub type Msg { | ||
None | ||
SubmitSearch | ||
UpdateInput(String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
import data/model.{type Model} | ||
import data/msg.{type Msg} | ||
import frontend/view | ||
import gleam/io | ||
import lustre | ||
import lustre/effect | ||
import lustre/element/html as h | ||
import lustre/update | ||
import sketch/lustre as sketch | ||
import sketch/options as sketch_options | ||
import tardis | ||
|
||
pub fn main() { | ||
let assert Ok(debugger_) = tardis.singleton("gling") | ||
let init = fn(_) { #(model.init(), effect.none()) } | ||
|
||
let assert Ok(debugger_) = tardis.single("gling") | ||
|
||
let assert Ok(cache) = | ||
sketch_options.document() | ||
sketch_options.node() | ||
|> sketch.setup() | ||
|
||
let assert Ok(_) = | ||
fn(_) { #(model.init(), effect.none()) } | ||
|> lustre.application(update, view) | ||
|> sketch.wrap(cache) | ||
view.view | ||
|> sketch.compose(cache) | ||
|> lustre.application(init, update, _) | ||
|> tardis.wrap(debugger_) | ||
|> lustre.start("#app", Nil) | ||
|> tardis.activate(debugger_) | ||
} | ||
|
||
fn update(model: Model, msg: Msg) { | ||
case msg { | ||
msg.UpdateInput(content) -> | ||
model | ||
|> model.update_input(content) | ||
|> update.none() | ||
msg.SubmitSearch -> update.none(model) | ||
msg.None -> update.none(model) | ||
} | ||
} | ||
|
||
fn view(_model: Model) { | ||
h.div([], []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
pub type Palette { | ||
Palette( | ||
white: String, | ||
dark_white: String, | ||
unnamed_blue: String, | ||
faff_pink: String, | ||
dark_faff_pink: String, | ||
aged_plastic_yellow: String, | ||
unexpected_aubergine: String, | ||
underwater_blue: String, | ||
charcoal: String, | ||
black: String, | ||
blacker: String, | ||
) | ||
} | ||
|
||
pub const dark = Palette( | ||
white: "#fefefc", | ||
dark_white: "#aeaeac", | ||
unnamed_blue: "#a6f0fc", | ||
faff_pink: "#ffaff3", | ||
dark_faff_pink: "#eb94de", | ||
aged_plastic_yellow: "#fffbe8", | ||
unexpected_aubergine: "#584355", | ||
underwater_blue: "#292d3e", | ||
charcoal: "#2f2f2f", | ||
black: "#1e1e1e", | ||
blacker: "#151515", | ||
) |
Oops, something went wrong.