From 7cf2017e9563ec2ddd7c0b4c6e9137b1a4e5428d Mon Sep 17 00:00:00 2001
From: Elizabeth Hunt <elizabeth.hunt@simponic.xyz>
Date: Fri, 9 Feb 2024 10:58:28 -0700
Subject: make function box more smooth

---
 src/components/function_box.tsx | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

(limited to 'src/components/function_box.tsx')

diff --git a/src/components/function_box.tsx b/src/components/function_box.tsx
index dc00a24..8b3b243 100644
--- a/src/components/function_box.tsx
+++ b/src/components/function_box.tsx
@@ -91,7 +91,7 @@ export class FunctionBox extends Node {
             <Rect direction={"row"} alignItems={"center"} gap={10}>
               <Rect
                 direction={"row"}
-                fontSize={this.inputFontSize}
+                fontSize={0}
                 ref={makeRef(this.inputs, i)}
                 justifyContent={"end"}
                 opacity={1}
@@ -153,7 +153,7 @@ export class FunctionBox extends Node {
               ref={this.output}
               justifyContent={"end"}
               opacity={1}
-              fontSize={this.outputFontSize}
+              fontSize={0}
             ></Rect>
           </Rect>
         </Rect>
@@ -164,10 +164,10 @@ export class FunctionBox extends Node {
   public *resetInput(duration: number) {
     yield* all(
       ...this.inputs.map((x) =>
-        all(x.opacity(1, duration), x.fontSize(this.inputFontSize, duration)),
+        all(x.opacity(0, duration), x.fontSize(0, duration)),
       ),
       ...this.inputSegments.map((segment) =>
-        all(segment.points([], duration), segment.opacity(1, duration)),
+        all(segment.points([], duration), segment.opacity(0, duration)),
       ),
     );
 
@@ -206,12 +206,15 @@ export class FunctionBox extends Node {
     });
     yield* all(
       ...this.inputSegments.map((segment) =>
-        segment.points(
-          [
-            { x: -this.padding, y: 0 },
-            { x: -this.delta, y: 0 },
-          ],
-          duration,
+        all(
+          segment.points(
+            [
+              { x: -this.padding, y: 0 },
+              { x: -this.delta, y: 0 },
+            ],
+            duration,
+          ),
+          segment.opacity(1, duration),
         ),
       ),
       ...this.inputs.map((input) =>
@@ -231,6 +234,9 @@ export class FunctionBox extends Node {
     );
     yield* all(
       this.resetInput(duration),
+      ...this.inputs.map((input) =>
+        all(input.opacity(0.2, duration), input.fontSize(0, duration)),
+      ),
       this.boxMoji().text(this.workingText, duration),
     );
   }
@@ -239,7 +245,6 @@ export class FunctionBox extends Node {
     yield* all(
       this.child()?.opacity(0.2, duration),
       this.output().opacity(0.2, duration),
-      this.output().fontSize(this.outputFontSize, duration),
       this.outputSegment().opacity(0, duration),
     );
 
@@ -276,6 +281,7 @@ export class FunctionBox extends Node {
 
     yield* all(
       this.boxMoji().text(this.idlingText, duration),
+      this.output().fontSize(this.outputFontSize, duration),
       this.outputSegment().points(
         [
           { x: 0, y: 0 },
-- 
cgit v1.3

