From 279c165e2d9f633052f53a609bb721ba0c9710a1 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 25 Jun 2021 09:28:28 +0200 Subject: ready state / disabled tools --- pages/editor.tsx | 21 +++++++++++++++++++-- styles/editor.css | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/pages/editor.tsx b/pages/editor.tsx index 58b360d..722c4a8 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -67,6 +67,13 @@ interface project { right: slideTypes | null; }; }; + ready: { + timeline: boolean; + video: { + available: boolean; + fullyloaded: boolean; + }; + }; update: { refreshLiveTimeline: () => void; }; @@ -91,6 +98,13 @@ var project = createState({ right: null, }, }, + ready: { + timeline: false, + video: { + available: false, + fullyloaded: false, + }, + }, update: { refreshLiveTimeline: () => { player.timeline.slides = Array(...(project.timeline.workingTimeline.value)); @@ -828,6 +842,7 @@ function DefaultSettings() { player.loadSlides(ev.target.result as string); project.timeline.workingTimeline.set(player.timeline.slides); project.update.refreshLiveTimeline.value(); + project.ready.timeline.set(true); }); reader.readAsText(file); }} @@ -874,15 +889,17 @@ function Tools() { var frame = useHookstate(project).timeline.frame; var tool = useHookstate(project).timeline.tool; var timelineZoom = useHookstate(project).timeline.zoom; + var ready = useHookstate(project).ready; return
-
+
@{player.framerate}fps

{player.frameToTimestampString(frame.value, false)}

-
+