From ca3f52a9a973f856a8fb667170d0c0dd423b5e4f Mon Sep 17 00:00:00 2001 From: Sophie Zhang Date: Tue, 14 May 2024 14:47:05 -0400 Subject: docs --- src/client/views/nodes/trails/CubicBezierEditor.tsx | 6 ++++-- src/client/views/nodes/trails/PresBox.tsx | 4 +++- src/client/views/nodes/trails/SpringUtils.ts | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/trails/CubicBezierEditor.tsx b/src/client/views/nodes/trails/CubicBezierEditor.tsx index 5f348ddd9..a5e21259a 100644 --- a/src/client/views/nodes/trails/CubicBezierEditor.tsx +++ b/src/client/views/nodes/trails/CubicBezierEditor.tsx @@ -7,7 +7,7 @@ type Props = { }; const ANIMATION_DURATION = 750; -const ANIMATION_TIMING_FUNC = 'cubic-bezier(0.3, .2, .2, 1.4)'; + const CONTAINER_WIDTH = 200; const EDITOR_WIDTH = 100; const OFFSET = (CONTAINER_WIDTH - EDITOR_WIDTH) / 2; @@ -21,8 +21,9 @@ export const TIMING_DEFAULT_MAPPINGS = { }; /** - * Visual editor for a bezier curve with draggable control points + * Visual editor for a bezier curve with draggable control points. * */ + const CubicBezierEditor = ({ setFunc, currPoints, easeFunc }: Props) => { const [animating, setAnimating] = useState(false); const [c1Down, setC1Down] = useState(false); @@ -96,6 +97,7 @@ const CubicBezierEditor = ({ setFunc, currPoints, easeFunc }: Props) => { return () => window.removeEventListener('pointermove', handlePointerMove); }, [c1Down, currPoints]); + // Sets up pointer events for moving the control points useEffect(() => { if (!c2Down) return; window.addEventListener('pointerup', () => { diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 2d4a25ff4..632636c85 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -1974,7 +1974,7 @@ export class PresBox extends ViewBoxBaseComponent() {
Customize Slide Properties{' '} -
window.open('https://brown-dash.github.io/Dash-Documentation/features/trails/#customizing-slide-transitions')}> +
window.open('https://brown-dash.github.io/Dash-Documentation/features/trails/#transitions')}> } color={SettingsManager.userColor} />
@@ -2100,6 +2100,7 @@ export class PresBox extends ViewBoxBaseComponent() {
+ {/* Cubic bezier editor */} {this.showBezierEditor && (

@@ -2140,6 +2141,7 @@ export class PresBox extends ViewBoxBaseComponent() { />

+