Version 1.0 upload

This commit is contained in:
2025-04-08 00:05:15 +08:00
parent 2eff273486
commit 35378d17d0
38 changed files with 2096 additions and 598 deletions

26
src/components/Widget.ts Normal file
View File

@@ -0,0 +1,26 @@
// components/Widget.ts
import { createElement } from '../utils/utils';
export abstract class Widget {
protected container: HTMLElement;
protected sizeType: 'default' | 'icon';
constructor(sizeType: 'default' | 'icon' = 'default') {
this.container = createElement('div');
this.container.classList.add('widget');
this.sizeType = sizeType;
if (sizeType === 'icon') {
this.container.classList.add('icon-widget');
}
}
abstract render(): HTMLElement;
getSizeType(): 'default' | 'icon' {
return this.sizeType;
}
getContainer(): HTMLElement {
return this.container;
}
}