diff options
| author | Jenny Yu <jennyyu212@outlook.com> | 2022-04-20 23:52:56 -0400 |
|---|---|---|
| committer | Jenny Yu <jennyyu212@outlook.com> | 2022-04-20 23:52:56 -0400 |
| commit | 7d59a4fee343598f4b5a4adde97c3845e051df11 (patch) | |
| tree | e80e7fb2fcd38c412b59c03f1aa4cc8fa5dcbd00 /src/client/views/nodes/RecordingBox/ProgressBar.tsx | |
| parent | 48f628afe1f814c4e604ec306d721a5afb991c10 (diff) | |
feat: styling + play entire video after finish
Diffstat (limited to 'src/client/views/nodes/RecordingBox/ProgressBar.tsx')
| -rw-r--r-- | src/client/views/nodes/RecordingBox/ProgressBar.tsx | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/client/views/nodes/RecordingBox/ProgressBar.tsx b/src/client/views/nodes/RecordingBox/ProgressBar.tsx index da5fa2b00..82d5e1f04 100644 --- a/src/client/views/nodes/RecordingBox/ProgressBar.tsx +++ b/src/client/views/nodes/RecordingBox/ProgressBar.tsx @@ -5,42 +5,41 @@ import "./ProgressBar.scss" interface ProgressBarProps { progress: number, marks: number[], - playSegment: (idx: number) => void } export function ProgressBar(props: ProgressBarProps) { - const handleClick = (e: React.MouseEvent) => { - let progressbar = document.getElementById('progressbar')! - let bounds = progressbar!.getBoundingClientRect(); - let x = e.clientX - bounds.left; - let percent = x / progressbar.clientWidth * 100 - - for (let i = 0; i < props.marks.length; i++) { - let start = i == 0 ? 0 : props.marks[i-1]; - if (percent > start && percent < props.marks[i]) { - props.playSegment(i) - // console.log(i) - // console.log(percent) - // console.log(props.marks[i]) - break - } - } - } + // const handleClick = (e: React.MouseEvent) => { + // let progressbar = document.getElementById('progressbar')! + // let bounds = progressbar!.getBoundingClientRect(); + // let x = e.clientX - bounds.left; + // let percent = x / progressbar.clientWidth * 100 - return( + // for (let i = 0; i < props.marks.length; i++) { + // let start = i == 0 ? 0 : props.marks[i-1]; + // if (percent > start && percent < props.marks[i]) { + // props.playSegment(i) + // // console.log(i) + // // console.log(percent) + // // console.log(props.marks[i]) + // break + // } + // } + // } + + return ( <div className="progressbar" id="progressbar"> - <div + <div className="progressbar done" style={{ width: `${props.progress}%` }} - onClick={handleClick} + // onClick={handleClick} ></div> {props.marks.map((mark) => { - return <div - className="progressbar mark" - style={{ width: `${mark}%` }} - ></div> + return <div + className="progressbar mark" + style={{ width: `${mark}%` }} + ></div> })} - </div> + </div> ) }
\ No newline at end of file |
