feat(home): implement background, clock and calendar

This commit is contained in:
2025-12-13 19:02:52 +01:00
parent 1f859c6578
commit f2e869e283
9 changed files with 204 additions and 8 deletions

View File

@@ -1,9 +1,23 @@
import { ImageLoader } from "../../../utils/loadImages";
import { StatusBar } from "./statusBar";
import { Clock } from "./clock";
import { Calendar } from "./calendar";
export class HomeTopScreen {
private backgroundImage = new ImageLoader({
background: "/images/home/top-screen/background.webp",
});
private statusBar = new StatusBar();
private clock = new Clock();
private calendar = new Calendar();
render(ctx: CanvasRenderingContext2D): void {
if (!this.backgroundImage.isReady) return;
ctx.drawImage(this.backgroundImage.require("background"), 0, 0);
this.clock.render(ctx);
this.calendar.render(ctx);
this.statusBar.render(ctx);
}
}