From e55f4c2fe8a6e1d62a0b005777b46c80e360d37e Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 31 Jul 2025 22:48:01 +0200 Subject: feat: initial commit --- src/user/index.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/user/index.ts (limited to 'src/user/index.ts') diff --git a/src/user/index.ts b/src/user/index.ts new file mode 100644 index 0000000..2caf88c --- /dev/null +++ b/src/user/index.ts @@ -0,0 +1,21 @@ +import { Video as BaseVideo, type FrameTime } from '$/lib/Player/Video'; +import SneakySnitchUrl from './Sneky Snitch.mp4?url' + +export default class Video extends BaseVideo { + public ctx!: CanvasRenderingContext2D + public init(): void | Promise { + // this.resize(this.canvas.clientWidth,this.canvas.clientHeight) + this.resize(1920, 1080) + this.ctx = this.canvas.getContext('2d')! + } + public renderFrame(time: FrameTime): Promise | void { + this.ctx.fillStyle = '#000' + this.ctx.fillRect(0, 0, this.w, this.h) + this.ctx.font = "50px Nunito"; + this.ctx.fillStyle = '#fff' + this.ctx.fillText(`${time.seconds.toFixed(3)}`, 0, 50) + } + public fps = 30; + public length = 3 * this.fps; + public audioUrl = ['sneakysnitch.mp4', SneakySnitchUrl] as const +} -- cgit v1.2.3