Added basic control panel

This commit is contained in:
2026-03-11 16:46:06 +01:00
parent 7df210aaf2
commit c4eedfff1e
105 changed files with 21923 additions and 958 deletions

View File

@@ -0,0 +1,41 @@
import { Main } from './main';
export class Calibration {
private _Main: Main;
observer: IntersectionObserver;
visible: boolean = false;
container: HTMLDivElement = document.querySelector('.ntsh-calibration');
image: HTMLImageElement = this.container.querySelector('img');
constructor(Main: Main) {
this._Main = Main;
this.registerListeners();
this.startClock();
}
private startClock() {
setInterval(() => {
if (this.visible && this.image)
this.image.src = `/calibrationImage?t=${Date.now()}`;
}, 1000);
}
private registerListeners() {
this.observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
this.visible = true;
console.log('Calibration visible');
} else {
this.visible = false;
console.log('Calibration not visible');
}
});
});
this.observer.observe(this.container);
}
}