From d8d4a576f9ffefc3e31ea0116d917d5dec560752 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 7 Aug 2024 13:43:14 +0800 Subject: [PATCH] float message box above --- calcit.cirru | 41 ++++++++++++++++++++++++++++++++++++++++- compact.cirru | 4 +++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index 60ccb24..7f60271 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -233,6 +233,11 @@ :data $ {} |D $ %{} :Leaf (:at 1722448078258) (:by |rJG4IHzWf) (:text |str-spaced) |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |css/font-fancy) + |l $ %{} :Expr (:at 1723009241406) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009242315) (:by |rJG4IHzWf) (:text |=<) + |b $ %{} :Leaf (:at 1723009244225) (:by |rJG4IHzWf) (:text |nil) + |h $ %{} :Leaf (:at 1723009245221) (:by |rJG4IHzWf) (:text |200) |r $ %{} :Expr (:at 1722536188689) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536196074) (:by |rJG4IHzWf) (:text |comp-message-box) @@ -662,7 +667,15 @@ |b $ %{} :Expr (:at 1722963253603) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722963255664) (:by |rJG4IHzWf) (:text |:position) - |b $ %{} :Leaf (:at 1722963257811) (:by |rJG4IHzWf) (:text |:relative) + |b $ %{} :Leaf (:at 1723009221445) (:by |rJG4IHzWf) (:text |:absolute) + |g $ %{} :Expr (:at 1723009224492) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009225607) (:by |rJG4IHzWf) (:text |:bottom) + |b $ %{} :Leaf (:at 1723009226474) (:by |rJG4IHzWf) (:text |0) + |i $ %{} :Expr (:at 1723009262069) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009264048) (:by |rJG4IHzWf) (:text |:opacity) + |b $ %{} :Leaf (:at 1723009381682) (:by |rJG4IHzWf) (:text |0.9) |l $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:max-width) @@ -671,6 +684,10 @@ :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:width) |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text "|\"100%") + |p $ %{} :Expr (:at 1723009676687) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009685327) (:by |rJG4IHzWf) (:text |:right) + |b $ %{} :Leaf (:at 1723009687437) (:by |rJG4IHzWf) (:text "|\"50%") |q $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:padding) @@ -679,6 +696,28 @@ :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:margin) |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:auto) + |t $ %{} :Expr (:at 1723009306927) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009310956) (:by |rJG4IHzWf) (:text |:transition-duration) + |b $ %{} :Leaf (:at 1723009322467) (:by |rJG4IHzWf) (:text "|\"300ms") + |u $ %{} :Expr (:at 1723009695319) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009698867) (:by |rJG4IHzWf) (:text |:transform) + |b $ %{} :Leaf (:at 1723009724165) (:by |rJG4IHzWf) (:text "|\"translate(80%,0)") + |h $ %{} :Expr (:at 1723009270885) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009298734) (:by |rJG4IHzWf) (:text "|\"&:focus-within") + |b $ %{} :Expr (:at 1723009276874) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009277352) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723009277572) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009279238) (:by |rJG4IHzWf) (:text |:opacity) + |b $ %{} :Leaf (:at 1723009279508) (:by |rJG4IHzWf) (:text |1) + |h $ %{} :Expr (:at 1723009718408) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009718408) (:by |rJG4IHzWf) (:text |:transform) + |b $ %{} :Leaf (:at 1723009718408) (:by |rJG4IHzWf) (:text "|\"translate(50%,0)") |style-message-list $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1723008329516) (:by |rJG4IHzWf) :data $ {} diff --git a/compact.cirru b/compact.cirru index 264bf03..61b98d7 100644 --- a/compact.cirru +++ b/compact.cirru @@ -40,6 +40,7 @@ div {} $ :class-name style-more <> "\"Streaming..." $ str-spaced css/font-fancy + =< nil 200 comp-message-box (>> states :message-box) fn (text d!) (submit-message! cursor state text d!) when dev? $ comp-reel (>> states :reel) reel ({}) @@ -106,7 +107,8 @@ |style-message-box $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-box $ {} - "\"&" $ {} (:position :relative) (:max-width 1200) (:width "\"100%") (:padding "\"8px") (:margin :auto) + "\"&" $ {} (:position :absolute) (:bottom 0) (:opacity 0.9) (:max-width 1200) (:width "\"100%") (:right "\"50%") (:padding "\"8px") (:margin :auto) (:transition-duration "\"300ms") (:transform "\"translate(80%,0)") + "\"&:focus-within" $ {} (:opacity 1) (:transform "\"translate(50%,0)") |style-message-list $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-list $ {}