Application prototype #14

Merged
glen merged 101 commits from app-proto into main 2024-10-21 23:38:28 +00:00
5 changed files with 46 additions and 3 deletions
Showing only changes of commit 49170671b4 - Show all commits

View File

@ -9,7 +9,6 @@ default = ["console_error_panic_hook"]
[dependencies] [dependencies]
itertools = "0.13.0" itertools = "0.13.0"
js-sys = "0.3.70"
nalgebra = "0.33.0" nalgebra = "0.33.0"
sycamore = "0.9.0-beta.3" sycamore = "0.9.0-beta.3"

View File

@ -5,11 +5,17 @@ body {
background-color: #222; background-color: #222;
} }
/* outline */
ul { ul {
float: left;
width: 450px; width: 450px;
height: 750px;
margin: 0px;
padding: 8px; padding: 8px;
border: 1px solid #888; border: 1px solid #555;
border-radius: 16px; border-radius: 16px;
box-sizing: border-box;
} }
li { li {
@ -20,6 +26,11 @@ li {
border-radius: 8px; border-radius: 8px;
} }
li:focus {
color: #fff;
background-color: #666;
}
li:not(:last-child) { li:not(:last-child) {
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -41,10 +52,28 @@ li > .elt-rep > div {
background-color: #333; background-color: #333;
} }
li:focus > .elt-rep > div {
background-color: #555;
}
li > .elt-rep > div:first-child { li > .elt-rep > div:first-child {
border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px;
} }
li > .elt-rep > div:last-child { li > .elt-rep > div:last-child {
border-radius: 0px 6px 6px 0px; border-radius: 0px 6px 6px 0px;
}
/* display */
canvas {
float: left;
margin-left: 16px;
background-color: #020202;
border: 1px solid #555;
border-radius: 16px;
}
canvas:focus {
border-color: #aaa;
} }

View File

@ -55,7 +55,9 @@ pub fn App() -> View {
View::from(div().children(u_coord)) View::from(div().children(u_coord))
}).collect::<Vec<_>>(); }).collect::<Vec<_>>();
view! { view! {
li { /* [TO DO] switch to integer-valued parameters whenever
that becomes possible again */
li(tabindex="0") {
div(class="elt-label") { (label) } div(class="elt-label") { (label) }
div(class="elt-rep") { (rep_components) } div(class="elt-rep") { (rep_components) }
} }

View File

@ -0,0 +1,10 @@
use sycamore::prelude::*;
#[component]
pub fn Display() -> View {
view! {
/* [TO DO] switch back to integer-valued parameters when that becomes
possible again */
canvas(width="750", height="750", tabindex="0")
}
}

View File

@ -1,14 +1,17 @@
mod app; mod app;
mod assembly; mod assembly;
mod display;
use sycamore::prelude::*; use sycamore::prelude::*;
use app::App; use app::App;
use display::Display;
fn main() { fn main() {
sycamore::render(|| { sycamore::render(|| {
view! { view! {
App {} App {}
Display {}
} }
}); });
} }