Initial commit

This commit is contained in:
2025-10-22 22:06:16 +02:00
commit d8ca4e154f
141 changed files with 32231 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { Main } from './main';
export class Calibration {
private _Main: Main;
container: HTMLDivElement = document.querySelector('.ntsh_calibration');
image: HTMLImageElement = this.container.querySelector('img');
fullscreenButton: HTMLDivElement = this.container.querySelector(
'.ntsh_calibration-fullscreen'
);
constructor(Main: Main) {
this._Main = Main;
this.registerListeners();
}
private fetchClock: NodeJS.Timeout;
startFetchClock() {
this.image.src = `/calibrationImage?t=${Date.now()}`;
this.fetchClock = setInterval(() => {
this.image.src = `/calibrationImage?t=${Date.now()}`;
}, 1000);
}
stopFetchClock() {
clearInterval(this.fetchClock);
}
private registerListeners() {
this._Main.TabController.registerListener('calibration', (visible) => {
if (visible) this.startFetchClock();
else this.stopFetchClock();
});
this.fullscreenButton.addEventListener('click', () => {
this.image.requestFullscreen();
});
}
}