diff options
Diffstat (limited to 'animism-align/frontend/views/align/components/timeline/cursor.component.js')
| -rw-r--r-- | animism-align/frontend/views/align/components/timeline/cursor.component.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/animism-align/frontend/views/align/components/timeline/cursor.component.js b/animism-align/frontend/views/align/components/timeline/cursor.component.js new file mode 100644 index 0000000..f621b37 --- /dev/null +++ b/animism-align/frontend/views/align/components/timeline/cursor.component.js @@ -0,0 +1,26 @@ +import React, { Component } from 'react' + +import { ZOOM_STEPS } from '../../constants' +import { timestamp } from '../../../../util' + +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 |
