summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-11 14:38:02 +0100
committerJules Laplace <julescarbon@gmail.com>2021-03-11 14:38:02 +0100
commit37896f6960f8145a13e2943fbb0cde52da430d30 (patch)
tree40cb7ca2a6b470dc397dd0ba99998ad899a212b0 /animism-align/frontend/app/views/editor/timeline/components/cursor.component.js
parent64cd37eae81845dc5eaace17739a72299cfc6c67 (diff)
move sidebar and timeline out of align folder
Diffstat (limited to 'animism-align/frontend/app/views/editor/timeline/components/cursor.component.js')
-rw-r--r--animism-align/frontend/app/views/editor/timeline/components/cursor.component.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js b/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js
new file mode 100644
index 0000000..4a94100
--- /dev/null
+++ b/animism-align/frontend/app/views/editor/timeline/components/cursor.component.js
@@ -0,0 +1,26 @@
+import React, { Component } from 'react'
+
+import { ZOOM_STEPS } from 'app/constants'
+import { timestamp } from 'app/utils'
+
+const Cursor = ({ timeline, annotation }) => {
+ const { start_ts, zoom, cursor_ts, duration } = timeline
+ const ts = annotation.start_ts || cursor_ts
+ const secondsPerPixel = ZOOM_STEPS[zoom] * 0.1
+ const y = (ts - start_ts) / secondsPerPixel
+ return (
+ <div
+ className='cursor'
+ style={{
+ top: y,
+ }}
+ >
+ <div className='line' />
+ <div className='tickLabel'>
+ {timestamp(ts, 1)}
+ </div>
+ </div>
+ )
+}
+
+export default Cursor \ No newline at end of file