diff --git a/html/common.tsx b/html/common.tsx index ea79761..53e4b7d 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -40,41 +40,62 @@ export const HCenter = ({ ); -export const eggbug_emotions = { - smiling: ( - eggbug, smiling - ), - frowning: ( - eggbug, frowning - ), - revengeance: ( - ULTRA EGGBUG REVENGEANCE, MEGA. THERE IS FIRE. THERE IS TRISCAR. EGGBUG REVENGEANCE. YOU ARE. DIE! - ), - jpeg_annihilation: ( - eggbug dissolving as the image gets more and more jpeg - ), -} as const; +export const eggbug_emotions = (attrs: JSX.HTMLAttributes) => + ({ + smiling: ( + eggbug, smiling + ), + frowning: ( + eggbug, frowning + ), + revengeance: ( + ULTRA EGGBUG REVENGEANCE, MEGA. THERE IS FIRE. THERE IS TRISCAR. EGGBUG REVENGEANCE. YOU ARE. DIE! + ), + jpeg_annihilation: ( + eggbug dissolving as the image gets more and more jpeg + ), + golfball: ( + eggbug as a golfball. no legs + ), + } as const); -export type EggbugEmotion = keyof typeof eggbug_emotions; +export type EggbugEmotion = keyof ReturnType; +type bla = ({ + type: EggbugEmotion; +} & JSX.HTMLAttributes)["type"]; -export const EggbugImg = ({ type }: { type: EggbugEmotion }) => - eggbug_emotions[type]; +export const EggbugImg = ({ + type, + ...attrs +}: { type: EggbugEmotion } & Omit< + JSX.HTMLAttributes, + "type" +>) => eggbug_emotions(attrs)[type]; export const render_and_copy = (elem: VNode, pretty = false) => { const rendered = render(elem, null, { pretty }); diff --git a/html/minigolf.tsx b/html/minigolf.tsx new file mode 100644 index 0000000..2ccaf5b --- /dev/null +++ b/html/minigolf.tsx @@ -0,0 +1,18 @@ +import { EggbugImg, render_and_copy } from "./common.tsx"; + +render_and_copy( +
+
+ +
+
+); diff --git a/static/eggbug-golfball.png b/static/eggbug-golfball.png new file mode 100644 index 0000000..186f87d Binary files /dev/null and b/static/eggbug-golfball.png differ