Throw looking OK-ish

This commit is contained in:
2020-03-29 10:37:10 -07:00
parent 4a1d126f9f
commit 2d7c90cb33
9 changed files with 263 additions and 20 deletions

16
src/power.ts Normal file
View File

@@ -0,0 +1,16 @@
export class Power {
node: HTMLDivElement;
constructor() {
const node = document.getElementById("Power");
if (!node) {
throw new Error("no power");
}
this.node = node as HTMLDivElement;
}
setPower = (power: number) => {
this.node.style.width = power * 100 + "%";
}
}