diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-07-25 17:15:07 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-07-25 17:15:07 +0200 |
commit | a12ae1c0b72794561d80ffe084b4f3dbf717426b (patch) | |
tree | 28b387730e3df3d6f069e22944ca2511ac351f7f /components | |
parent | b6d87316ff5e51727b2548305983cca027fed069 (diff) |
css tweaks + code splitting
Diffstat (limited to 'components')
-rw-r--r-- | components/slideprops.tsx | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/components/slideprops.tsx b/components/slideprops.tsx new file mode 100644 index 0000000..aa118e8 --- /dev/null +++ b/components/slideprops.tsx @@ -0,0 +1,57 @@ +import { State } from '@hookstate/core'; + +import TextField from '@material-ui/core/TextField'; + +import TimecodeInput from '../components/timeinput'; +import { globalState } from '../pages/editor'; +import { TimedVideoPlayer } from '../pages/present'; +import { anySlide, loopSlide } from '../timeline'; + +export default function SlideProperties(props: { + slide: State<anySlide>; + global: State<globalState>; + player: TimedVideoPlayer; +}) { + if (props.slide.value.type == 'default') return null; + + return <div className='section'> + <span className='title'>Properties</span> + {{ + 'loop': <> + <TextField + label='Duration' + variant='filled' + type='number' + value={(props.slide as State<loopSlide>).frame.get() + - (props.slide as State<loopSlide>).beginFrame.get()} + /> + <TimecodeInput + label='Start timestamp' + value={(props.slide as State<loopSlide>).beginFrame.get()} + update={newValue => { + (props.slide as State<loopSlide>).frame.set(newValue); + props.global.update.refreshLiveTimeline.value(); + }} + player={props.player} + /> + <TimecodeInput + label='End timestamp' + value={(props.slide as State<loopSlide>).frame.get()} + update={newValue => { + (props.slide as State<loopSlide>).frame.set(newValue); + props.global.update.refreshLiveTimeline.value(); + }} + player={props.player} + /> + <TextField label='End timestamp' variant='filled' /> + </>, + 'delay': <> + <TextField label='Delay duration' variant='filled' /> + </>, + 'speedChange': <> + <TextField label='New speed' variant='filled' /> + <TextField label='Factor' variant='filled' /> + </>, + }[props.slide.value.type]} + </div>; +} |