From e2b4502f87cf5707a77736267a1d96261024874c Mon Sep 17 00:00:00 2001 From: Sophie Zhang Date: Thu, 9 May 2024 11:49:33 -0400 Subject: started cleanup --- src/client/views/nodes/trails/PresBox.tsx | 261 ++++++++++++++--------------- src/client/views/pdf/GPTPopup/GPTPopup.tsx | 1 + 2 files changed, 124 insertions(+), 138 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 964b793bd..248de5f4b 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -421,20 +421,6 @@ export class PresBox extends ViewBoxBaseComponent() { console.log('Parsed GPT Result ', resObj); // this.activeItem this.setGeneratedAnimations(resObj as AnimationSettings[]); - // this.updateEffect(resObj.effect as PresEffect, false); - // this.updateEffectTiming(this.activeItem, { - // type: SpringType.CUSTOM, - // stiffness: resObj.stiffness, - // damping: resObj.damping, - // mass: resObj.mass, - // }); - - // for (let key in resObj) { - // if (resObj[key]) { - // console.log('typeof property', typeof resObj[key]); - // this.activeItem[key] = resObj[key]; - // } - // } } } catch (err) { console.error(err); @@ -1862,7 +1848,7 @@ export class PresBox extends ViewBoxBaseComponent() { {[DocumentType.AUDIO, DocumentType.VID].includes(targetType as any as DocumentType) ? null : ( <> -
+
Slide Duration
e.stopPropagation()} onChange={e => this.updateDurationTime(e.target.value)} /> s @@ -2035,6 +2021,7 @@ export class PresBox extends ViewBoxBaseComponent() { return ( <> {/* GPT Component */} + {/* This chatbox is for customizing the properties of trails, like transition time, movement type (zoom, pan) */}

Customize with GPT

@@ -2081,6 +2068,112 @@ export class PresBox extends ViewBoxBaseComponent() { />
+ + {/* Movement */} +
{ + e.stopPropagation(); + this._openMovementDropdown = false; + this._openEffectDropdown = false; + this._openBulletEffectDropdown = false; + })}> +
+ Movement + { + this.updateMovement(val as PresMovement); + }} + dropdownType={DropdownType.SELECT} + type={Type.TERT} + /> +
+
Zoom (% screen filled)
+
+ this.updateZoom(e.target.value)} />% +
+ {/*
+
this.updateZoom(String(zoom), 0.1)}> + +
+
this.updateZoom(String(zoom), -0.1)}> + +
+
*/} +
+ {PresBox.inputter('0', '1', '100', zoom, activeItem.presentation_movement === PresMovement.Zoom, this.updateZoom)} +
+
Transition Time
+
+ e.stopPropagation()} onChange={action(e => this.updateTransitionTime(e.target.value))} /> s +
+ {/*
+
this.updateTransitionTime(String(transitionSpeed), 1000)}> + +
+
this.updateTransitionTime(String(transitionSpeed), -1000)}> + +
+
*/} +
+ {PresBox.inputter('0.1', '0.1', '10', transitionSpeed, true, this.updateTransitionTime)} +
+
Fast
+
Medium
+
Slow
+
+ {/* Easing function */} +
+ { + if (typeof val === 'string') { + if (val !== 'custom') { + this.setBezierEditorVisibility(true); + this.setEaseFunc(this.activeItem, val); + } else { + this.setEaseFunc(this.activeItem, TIMING_DEFAULT_MAPPINGS.ease); + } + } + }} + dropdownType={DropdownType.SELECT} + type={Type.TERT} + /> + {/* Custom */} +
{ + e.stopPropagation(); + this.setBezierEditorVisibility(!this.showBezierEditor); + }}> + {`${this.showBezierEditor ? 'Hide' : 'Show'} Timing Editor`} + +
+ {this.showBezierEditor && ( + <> +

+ Custom Timing Function +

+ + + )} +
+
+
+ + {/* This chatbox is for getting slide effect transition suggestions from gpt and visualizing them */}
@@ -2099,21 +2192,6 @@ export class PresBox extends ViewBoxBaseComponent() { e.stopPropagation(); }} /> - {/* (this._inputref2 = r)} - minRows={1} - placeholder="Get animation suggestions..." - className="pres-chatbox" - autoFocus={true} - value={this.animationChat} - onChange={e => { - this.setAnimationChat(e.target.value); - }} - onKeyDown={e => { - this.stopDictation(true); - e.stopPropagation(); - }} - /> */}
- {/* Movement */} -
- Movement - { - this.updateMovement(val as PresMovement); - }} - dropdownType={DropdownType.SELECT} - type={Type.TERT} - /> -
-
Zoom (% screen filled)
-
- this.updateZoom(e.target.value)} />% -
- {/*
-
this.updateZoom(String(zoom), 0.1)}> - -
-
this.updateZoom(String(zoom), -0.1)}> - -
-
*/} -
- {PresBox.inputter('0', '1', '100', zoom, activeItem.presentation_movement === PresMovement.Zoom, this.updateZoom)} -
-
Transition Time
-
- e.stopPropagation()} onChange={action(e => this.updateTransitionTime(e.target.value))} /> s -
- {/*
-
this.updateTransitionTime(String(transitionSpeed), 1000)}> - -
-
this.updateTransitionTime(String(transitionSpeed), -1000)}> - -
-
*/} -
- {PresBox.inputter('0.1', '0.1', '10', transitionSpeed, true, this.updateTransitionTime)} -
-
Fast
-
Medium
-
Slow
-
- {/* Easing function */} -
- { - if (typeof val === 'string') { - if (val !== 'custom') { - this.setBezierEditorVisibility(true); - this.setEaseFunc(this.activeItem, val); - } else { - this.setEaseFunc(this.activeItem, TIMING_DEFAULT_MAPPINGS.ease); - } - } - }} - dropdownType={DropdownType.SELECT} - type={Type.TERT} - /> - {/* Custom */} -
{ - e.stopPropagation(); - this.setBezierEditorVisibility(!this.showBezierEditor); - }}> - {`${this.showBezierEditor ? 'Hide' : 'Show'} Timing Editor`} - -
- {this.showBezierEditor && ( - <> -

- Custom Timing Function -

- - - )} -
-
{/* Toggles */} { _layout_autoHeight: true, }); this.addDoc(newDoc, this.sidebarId); + // newDoc.data = 'Hello world'; const anchor = AnchorMenu.Instance?.GetAnchor(undefined, false); if (anchor) { DocUtils.MakeLink(newDoc, anchor, { -- cgit v1.2.3-70-g09d2