From 63e9101d42eebee90f69e7e905e6e94b48d44299 Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Mon, 29 Mar 2021 13:03:54 -0400 Subject: [PATCH] Make mandala UI layout a bit less terrible (#65) The key phrase here is **less terrible**, as opposed to **good**. Right now if the mandala gets too big for the page, it will just overflow and the remainder won't be visible (not even via scrolling). This is intentional, though, as per @ninapaley's suggestion: > I'm hoping you can change the way the image keeps resizing its canvas, and keeps justifying left. > Maybe have an oversize canvas with the ring pinned to the center, and all the adjustment sliders > on the right? Then they won't disappear if the canvas is too big. Also! I have an idea for an > animated cycle that would require the symbols to eventually outgrow the canvas area and disappear. I'm not super happy with this CSS, it doesn't feel terribly maintainable. Ah well, maybe we can improve it later. --- index.html | 43 ++++++++++++++ lib/color-widget.tsx | 4 +- lib/numeric-slider.tsx | 30 +++++----- lib/pages/mandala-page.tsx | 106 +++++++++++++++++++--------------- lib/symbol-context-widget.tsx | 7 +-- 5 files changed, 122 insertions(+), 68 deletions(-) diff --git a/index.html b/index.html index 621c6f3..460fff5 100644 --- a/index.html +++ b/index.html @@ -48,6 +48,49 @@ ul.navbar li { ul.navbar li:last-child { border-right: none; } + +.mandala-container { + position: relative; +} + +.mandala-container .canvas { + display: flex; + width: 100%; + height: 85vh; + align-items: center; + justify-content: center; + overflow: hidden; +} + +.mandala-container .sidebar { + position: absolute; + right: 0; + top: 0; + padding: 8px; + width: 20em; + background-color: rgba(255, 255, 255, 0.9); +} + +.mandala-container .color-widget { + display: flex; +} + +.mandala-container .color-widget label { + flex-grow: 1; +} + +.mandala-container .numeric-slider { + display: flex; + flex-direction: column; +} + +.mandala-container .numeric-slider .slider { + display: flex; +} + +.mandala-container .numeric-slider .slider input { + flex-basis: 90%; +}