From 83dc103386f5dcde43b3e4d80838808efb27997c Mon Sep 17 00:00:00 2001 From: mehbark Date: Mon, 17 Apr 2023 19:52:04 -0400 Subject: [PATCH] so much meaningless stuff :] --- src/App.css | 28 ++++++++++---- src/App.tsx | 105 ++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 105 insertions(+), 28 deletions(-) diff --git a/src/App.css b/src/App.css index be25b78..7104617 100644 --- a/src/App.css +++ b/src/App.css @@ -35,19 +35,21 @@ html { display: grid; width: 50%; grid-template-areas: "ops stack" "states states"; - grid-template-rows: max-content; + grid-template-columns: 50% 50%; + grid-template-rows: 50% 50%; } -/* .ops, -.states { - width: 50vw; -} */ +.ops, +.stack { + overflow: scroll; + width: 100%; +} .ops { /* position: fixed; */ /* top: 0; left: 50%; */ - min-height: 25vh; + /* height: 100%; */ margin-bottom: 0; background-color: var(--bg); border: 1px solid var(--fg); @@ -66,6 +68,7 @@ html { border-bottom: 1px solid var(--fg); /* margin: 5px; */ padding-left: 5px; + background-color: var(--bg); } /* .state > * { @@ -79,9 +82,9 @@ html { padding: 5px; } -.stack::before { +/* .stack::before { content: "Stack: "; -} +} */ /* later i can do .op.active and .state.active if necessary */ .active { @@ -92,15 +95,24 @@ html { background-color: var(--accent); } +.jumped-from { + backdrop-filter: brightness(1.8); +} + .op { display: flex; white-space: pre; + overflow: clip; } .output { display: flex; } +.just-popped { + backdrop-filter: hue-rotate(180deg); +} + /* https://www.joshwcomeau.com/css/custom-css-reset/ */ /* 1. Use a more-intuitive box-sizing model. diff --git a/src/App.tsx b/src/App.tsx index 06acd07..9ac24e5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,6 +15,8 @@ export default function App() { let [activeStateIdx, setActiveStateIdx] = useState(0); let parsed = somes(input.split(/[^a-z0-9-]+/).map(parse_op)); let states = steps(INITIAL_STATE, parsed); + let state = states[activeStateIdx] ?? INITIAL_STATE; + return ( <>