From 6f5bfba41aff2e867eb77e1bbab8c746865c16f5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 19 Jun 2021 14:30:31 +0200 Subject: settings section --- pages/editor.tsx | 174 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 95 insertions(+), 79 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index 0387246..177ec9f 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -14,6 +14,7 @@ import AppBar from '@material-ui/core/AppBar'; import Button from '@material-ui/core/Button'; import Fab from '@material-ui/core/Fab'; import Slider from '@material-ui/core/Slider'; +import Switch from '@material-ui/core/Switch'; import Toolbar from '@material-ui/core/Toolbar'; import ZoomInRoundedIcon from '@material-ui/icons/ZoomInRounded'; import ZoomOutRoundedIcon from '@material-ui/icons/ZoomOutRounded'; @@ -75,6 +76,11 @@ var useFrame = create(set => ({ setFrame: (newFrame: number) => set(() => ({ currentFrame: newFrame })), })); +var usePlaying = create(set => ({ + playing: false, + setPlaying: (playing: boolean) => set(() => ({ playing })), +})); + function calculateSelectionOffsets(left: slideTypes, right: slideTypes) { var offsets = { default: { left: -6, right: 6 }, @@ -609,12 +615,93 @@ function TimelineEditor(props: { ; } -export default function Index() { - var [dummy, setDummy] = useState(false); - var rerender = () => setDummy(!dummy); - +function DefaultSettings() { + var setPlaying = usePlaying((st: any) => st.setPlaying); var setWorkingTimeline = useWorkingTimeline((st: any) => st.setTimeline); + return <> +

Presentation settings

+
+
+ Controls +
+ Allow remote control during presentation + +
+
+
+ Cool temporary buttons + { + var file = event.target.files[0]; + if (!file) return; + var reader = new FileReader(); + reader.addEventListener('load', ev => { + player.loadVideo(ev.target.result as string); + + player.player.addEventListener('play', () => setPlaying(true)); + player.player.addEventListener('pause', () => setPlaying(false)); + }); + reader.readAsDataURL(file); + }} + /> +
+
+ ; +} + +export default function Index() { var timelineZoom = getTimelineZoom((st: any) => st.zoom); var setTimelineZoom = getTimelineZoom((st: any) => st.setZoom); @@ -622,7 +709,7 @@ export default function Index() { var [tool, setTool] = useState('cursor'); - var [playing, setPlaying] = useState(false); + var playing = usePlaying((st: any) => st.playing); var mouseX = 0; @@ -673,80 +760,9 @@ export default function Index() {

pressure

-
-
-

Presentation settings

-
-
- Cool temporary buttons - { - var file = event.target.files[0]; - if (!file) return; - var reader = new FileReader(); - reader.addEventListener('load', ev => { - player.loadVideo(ev.target.result as string); - - player.player.addEventListener('play', () => setPlaying(true)); - player.player.addEventListener('pause', () => setPlaying(false)); - }); - reader.readAsDataURL(file); - }} - /> -
-
+
+
+
-- cgit v1.2.3