import animator from "../animator" import View from "./index" import createElement from "../utils/create-element"; import props from "../models/props"; import { BandType } from '../models/band'; export default class Debug implements View { wrapper: HTMLDivElement constructor() { animator.registerView(this) } render() { this.wrapper = createElement('div', 'debug', [ 'background: black', 'color: white', 'font-size: .75em', 'height: 640px', 'padding: 1em', 'position: absolute', 'right: 0', 'top: 200px', 'width: 240px', 'z-index: 10', ]) this.update() return this.wrapper } resize() {} update() { this.wrapper.innerHTML = ` ${ props.bands .map(band => `
| type | ${band.type === BandType.MinimapBand ? 'minimap' : 'events'} |
| zoom | ${band.zoomLevel} |
| px/ms | ${band.pixelsPerMillisecond.toExponential(2)} |
| left | ${Math.round(band.offsetX)}px |
| width | ${Math.round(band.width)}px |
| from | ${new Date(band.from).toUTCString()} |
| to | ${new Date(band.to).toUTCString()} |