From b3f132201b455e2a101cc616778e9b3d356ebe37 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Wed, 25 Sep 2019 14:47:07 -0700 Subject: [PATCH] Better expandables for the instance debugger --- assets/index.css | 43 +++++++++++++++++++++++++++++++++---------- src/web/ui.rs | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 68 insertions(+), 18 deletions(-) diff --git a/assets/index.css b/assets/index.css index 270a70fc..2d36296f 100644 --- a/assets/index.css +++ b/assets/index.css @@ -14,17 +14,9 @@ html { font-family: sans-serif; font-size: 18px; text-decoration: none; - height: 100%; line-height: 1.4; } -body { - min-height: 100%; - display: flex; - flex-direction: column; - justify-content: center; -} - img { max-width:100%; max-height:100%; @@ -37,7 +29,6 @@ img { } .root { - flex: 0 0; display: flex; flex-direction: column; margin: 0.5rem auto; @@ -112,7 +103,7 @@ img { } .instance-title { - font-size: 1.5rem; + font-size: 1.2rem; padding: 0.5rem; } @@ -124,6 +115,38 @@ img { padding: 0.5rem 0 0.5rem 1rem; } +.expandable-input { + display: none; +} + +.expandable-input ~ .expandable-label .expandable-visualizer { + font-family: monospace; + display: inline-flex; + justify-content: center; + align-items: center; + align-content: center; + width: 1rem; + height: 1rem; + border: 1px solid #666; + margin: 0 0.5rem; +} + +.expandable-visualizer::before { + content: ""; +} + +.expandable-input:checked ~ .expandable-label .expandable-visualizer::before { + content: "-"; +} + +.expandable-input:not(:checked) ~ .expandable-label .expandable-visualizer::before { + content: "+"; +} + +.expandable-input:not(:checked) ~ .expandable-items { + display: none; +} + .imfs-entry { } diff --git a/src/web/ui.rs b/src/web/ui.rs index 973e5845..2de8ccf4 100644 --- a/src/web/ui.rs +++ b/src/web/ui.rs @@ -202,9 +202,23 @@ impl UiService { HtmlContent::None } else { html! { -
- { Fragment::new(children_list) } -
+
+ + +

+ +

+
+ { Fragment::new(children_list) } +
+
} }; @@ -226,9 +240,22 @@ impl UiService { HtmlContent::None } else { html! { -
- { Fragment::new(property_list) } -
+
+ + +

+ +

+
+ { Fragment::new(property_list) } +
+
} }; @@ -244,10 +271,10 @@ impl UiService { html! {
-
+
+ { property_container } { children_container }