From ac093e7e4f483a7d5c15d72b4f203d4ff0a39927 Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Thu, 21 Mar 2024 00:50:53 -0400
Subject: preliminary react-spring anims

---
 src/client/views/nodes/DocumentView.tsx | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/DocumentView.tsx')

diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index d131f72d5..3c1896474 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -48,6 +48,7 @@ import { KeyValueBox } from './KeyValueBox';
 import { LinkAnchorBox } from './LinkAnchorBox';
 import { FormattedTextBox } from './formattedText/FormattedTextBox';
 import { PresEffect, PresEffectDirection } from './trails';
+import SlideEffect, { EffectType } from './trails/SlideEffect';
 interface Window {
     MediaRecorder: MediaRecorder;
 }
@@ -1004,18 +1005,34 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
             delay: 0,
             duration: Cast(presEffectDoc?.presentation_transition, 'number', Cast(presEffectDoc?.followLinkTransitionTime, 'number', null)),
         };
+        console.log('dir', dir);
+        console.log('effect', StrCast(presEffectDoc?.presentation_effect, StrCast(presEffectDoc?.followLinkAnimEffect)));
         //prettier-ignore
+
         switch (StrCast(presEffectDoc?.presentation_effect, StrCast(presEffectDoc?.followLinkAnimEffect))) {
-            default: 
+            default:
+            // package used: react-awesome-reveal
             case PresEffect.None:       return renderDoc;
-            case PresEffect.Zoom:       return <Zoom {...effectProps}>{renderDoc}</Zoom>;
+            case PresEffect.Zoom:       return <SlideEffect effectType={EffectType.ZOOM} tension={300} friction={12} mass={2}>{renderDoc}</SlideEffect>
             case PresEffect.Fade:       return <Fade {...effectProps}>{renderDoc}</Fade>;
             case PresEffect.Flip:       return <Flip {...effectProps}>{renderDoc}</Flip>;
             case PresEffect.Rotate:     return <Rotate {...effectProps}>{renderDoc}</Rotate>;
-            case PresEffect.Bounce:     return <Bounce {...effectProps}>{renderDoc}</Bounce>;
+            case PresEffect.Bounce:     return <SlideEffect effectType={EffectType.BOUNCE} tension={300} friction={12} mass={2}>{renderDoc}</SlideEffect>
             case PresEffect.Roll:       return <Roll {...effectProps}>{renderDoc}</Roll>;
             case PresEffect.Lightspeed: return <JackInTheBox {...effectProps}>{renderDoc}</JackInTheBox>;
         }
+        // switch (StrCast(presEffectDoc?.presentation_effect, StrCast(presEffectDoc?.followLinkAnimEffect))) {
+        //     default:
+        //     // package used: react-awesome-reveal
+        //     case PresEffect.None:       return renderDoc;
+        //     case PresEffect.Zoom:       return <Zoom {...effectProps}>{renderDoc}</Zoom>;
+        //     case PresEffect.Fade:       return <Fade {...effectProps}>{renderDoc}</Fade>;
+        //     case PresEffect.Flip:       return <Flip {...effectProps}>{renderDoc}</Flip>;
+        //     case PresEffect.Rotate:     return <Rotate {...effectProps}>{renderDoc}</Rotate>;
+        //     case PresEffect.Bounce:     return <Bounce {...effectProps}>{renderDoc}</Bounce>;
+        //     case PresEffect.Roll:       return <Roll {...effectProps}>{renderDoc}</Roll>;
+        //     case PresEffect.Lightspeed: return <JackInTheBox {...effectProps}>{renderDoc}</JackInTheBox>;
+        // }
     }
     public static recordAudioAnnotation(dataDoc: Doc, field: string, onRecording?: (stop: () => void) => void, onEnd?: () => void) {
         let gumStream: any;
-- 
cgit v1.2.3-70-g09d2

