diff --git a/html/common.tsx b/html/common.tsx
index 9d32c21..0161ae6 100644
--- a/html/common.tsx
+++ b/html/common.tsx
@@ -5,3 +5,13 @@ export const Main: Component = (attributes, children) => (
{...children}
);
+
+export const HCenter: Component = (attributes, children) => (
+
+ {...children}
+
+);
diff --git a/html/eggbug-spamclick-battle.tsx b/html/eggbug-spamclick-battle.tsx
index 287bcf0..d805e45 100644
--- a/html/eggbug-spamclick-battle.tsx
+++ b/html/eggbug-spamclick-battle.tsx
@@ -1,12 +1,98 @@
+import { HCenter, Main } from "./common.tsx";
import { debug_render } from "./html.ts";
import { Component } from "./jsx/jsx-runtime.ts";
const Eggbug: Component = () => (
-
+
+
+
);
-debug_render();
+function health_style(current: number, last: number, max: number) {
+ const inc_width = 100 / max;
+ const dhealth = last - current;
+ console.log(inc_width, dhealth);
+
+ return `transform: translateX(${-(inc_width * dhealth)}%); width: ${
+ last * inc_width
+ }%;`;
+}
+
+// could be generalized
+// might be worthwhile later since