From c1a70d10b53ab06b2518450be85687d3913a46be Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 27 May 2021 13:25:23 +0200 Subject: keyframes are now classes :tada: --- pages/editor.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index c2406a5..b6d7ca0 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -1,9 +1,8 @@ import { CSSProperties, ReactNode, useEffect, useRef, useState } from 'react'; import { animated, useSpring } from 'react-spring'; import { useDrag } from 'react-use-gesture'; -import { v4 as uuid } from 'uuid'; import create from 'zustand'; -import { anySlide, loopSlide, slide, slideTypes } from '../timeline'; +import { anySlide, loopSlide, slide, slideTypes, toolToSlide } from '../timeline'; import { TimedVideoPlayer } from './present'; import AppBar from '@material-ui/core/AppBar'; @@ -324,13 +323,8 @@ function TimelineEditor(props: { // place new keyframe var x = event.clientX - 240; var frame = Math.round(getFrameAtOffset(x, timelineZoom)); - var id = uuid(); - workingTimeline.push({ - frame, - id, - type: props.selectedTool as slideTypes, - clickThroughBehaviour: 'ImmediatelySkip', - }); + var slide = new toolToSlide[props.selectedTool](frame); + workingTimeline.push(slide); setWorkingTimeline(workingTimeline); }} /> -- cgit v1.2.3