playhead.tsx 639 B

12345678910111213141516171819202122232425
  1. import * as React from "react";
  2. interface IPlayheadProps {
  3. frame: number;
  4. offset: number;
  5. }
  6. export class Playhead extends React.Component<IPlayheadProps>{
  7. constructor(props: IPlayheadProps) {
  8. super(props);
  9. }
  10. render() {
  11. return (
  12. <div className="playhead-wrapper" id="playhead" style={{left: `calc(${this.props.frame * (this.props.offset) }px - 13px)`}}>
  13. <div className="playhead">{this.props.frame}</div>
  14. <div className="playhead-triangle"></div>
  15. <div className="playhead-line"></div>
  16. </div>
  17. )
  18. }
  19. }