From 2f5446f433902fa2718a46d545433dc0bfd2bfe0 Mon Sep 17 00:00:00 2001 From: mehbark Date: Sun, 16 Jul 2023 00:36:39 -0400 Subject: [PATCH] okay yeesh, hlm skelly --- deno.json | 3 +- html/common.tsx | 2 +- html/hotline-miami.tsx | 69 +++++++++++++++++++++++++++++++----------- 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/deno.json b/deno.json index 6d36579..8ef972d 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,8 @@ { "compilerOptions": { "jsx": "react-jsx", - "jsxImportSource": "preact" + "jsxImportSource": "preact", + "exclude": ["typings/browser.d.ts", "typings/browser", "node_modules"] }, "imports": { "copy-paste": "https://deno.land/x/copy_paste@v1.1.3/mod.ts", diff --git a/html/common.tsx b/html/common.tsx index ae9383e..865dea4 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -54,4 +54,4 @@ export const render_and_copy = (elem: VNode) => { export const mk_class_wrapper = (klass: string) => ({ children }: { children: ComponentChildren }) => -
{...toChildArray(children)}
; +
{...toChildArray(children)}
; diff --git a/html/hotline-miami.tsx b/html/hotline-miami.tsx index 43ff712..1d3003c 100644 --- a/html/hotline-miami.tsx +++ b/html/hotline-miami.tsx @@ -1,4 +1,9 @@ -import { EggbugImg, Main, render_and_copy } from "./common.tsx"; +import { + EggbugImg, + Main, + mk_class_wrapper, + render_and_copy, +} from "./common.tsx"; import { ComponentChildren, JSX, toChildArray } from "preact"; const Pulse = ({ children }: { children: ComponentChildren }) => ( @@ -12,9 +17,7 @@ const Portrait = ({ href, alt }: { href: string; alt: string }) => ( {alt} ); -const Wiggle = ({ children }: { children: ComponentChildren }) => ( -
{...toChildArray(children)}
-); +const Wiggle = mk_class_wrapper("wiggle"); const PortraitFrame = ({ children }: { children: ComponentChildren }) => (
@@ -23,6 +26,46 @@ const PortraitFrame = ({ children }: { children: ComponentChildren }) => (
); +const Frame = ({ + tooltip = "PRESS [RMB] TO OPEN BROWSER CONTEXT MENU", + game = <>, + portrait = , + dialogue = "", + children, +}: { + tooltip?: string; + game?: JSX.Element; + portrait?: JSX.Element; + dialogue?: string; + children?: ComponentChildren; +}) => + children ? ( +
+ +
{tooltip}
+
+
{game}
+ {portrait} +
+
+ {dialogue} +
+
+
{...toChildArray(children)}
+
+ ) : ( +
+
{tooltip}
+
+
{game}
+ {portrait} +
+
+ {dialogue} +
+
+ ); + // score wiggles faster the more points you get but resets // there is a canonicl speed for like "go to car" // could also do bigger ui elements @@ -34,18 +77,10 @@ const PortraitFrame = ({ children }: { children: ComponentChildren }) => ( // i'll probably go for a different ui element render_and_copy(
-
press [rmb] to open browser context menu
-
-
- - - -
-
- - FORTNITE BATTLE ROYALE PLAY FREE NOW AWESOME FUN GAME PLAY FOR - FREE NOW! WIN - -
+ + + + +
);