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

View File

@@ -0,0 +1,28 @@
// widgets/BackButtonWidget.ts
import { Widget } from '../components/Widget';
import { createElement, navigateTo } from '../utils/utils';
export class BackButtonWidget extends Widget {
private buttonText: string;
private navigatePath: string;
constructor(buttonText: string, navigatePath: string) {
super();
this.buttonText = buttonText;
this.navigatePath = navigatePath;
}
render(): HTMLElement {
this.container.innerHTML = ''; // Clear previous content
const button = createElement('button');
button.classList.add('btn', 'btn-secondary');
button.textContent = this.buttonText;
button.addEventListener('click', () => {
navigateTo(this.navigatePath);
});
this.container.appendChild(button);
return this.container;
}
}