diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-30 17:03:31 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-30 17:03:31 +0200 |
| commit | 7bc1723499503800cbdd446b27e202898fc32b9e (patch) | |
| tree | 03480b0dae36c6e97ad524ff667a01d2efe43c82 /animism-align/frontend/views/align/components/cursor.component.js | |
| parent | bd57b5abf5fc73d5e61d80be1ee509b7afc97ff7 (diff) | |
cursor
Diffstat (limited to 'animism-align/frontend/views/align/components/cursor.component.js')
| -rw-r--r-- | animism-align/frontend/views/align/components/cursor.component.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/animism-align/frontend/views/align/components/cursor.component.js b/animism-align/frontend/views/align/components/cursor.component.js new file mode 100644 index 0000000..c92f807 --- /dev/null +++ b/animism-align/frontend/views/align/components/cursor.component.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react' + +import { ZOOM_STEPS } from '../constants' +import { clamp, timestamp } from '../../../util' + +const Cursor = ({ timeline }) => { + const { start_ts, zoom, cursor_ts, duration } = timeline + const secondsPerPixel = ZOOM_STEPS[zoom] * 0.1 + const y = (cursor_ts - start_ts) / secondsPerPixel + return ( + <div + className='cursor' + style={{ + top: y, + }} + > + <div className='line' /> + <div className='tickLabel'> + {timestamp(cursor_ts, 1)} + </div> + </div> + ) +} + +export default Cursor
\ No newline at end of file |
