From 0a7571115ee19d4a36281a6e9540f8ed6e79134e Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 20 Jul 2023 13:33:55 -0400 Subject: [PATCH] yet another likely impossible idea --- html/common.tsx | 49 +++++++++++++++- html/draw.tsx | 0 html/lc.tsx | 91 +++++++++++++++++++++++++++++ html/you-are-the-turing-machine.tsx | 1 + 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 html/draw.tsx create mode 100644 html/lc.tsx create mode 100644 html/you-are-the-turing-machine.tsx diff --git a/html/common.tsx b/html/common.tsx index 865dea4..d381b3e 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -1,4 +1,11 @@ -import { Attributes, ComponentChildren, VNode, toChildArray } from "preact"; +import { + Attributes, + ComponentChild, + ComponentChildren, + JSX, + VNode, + toChildArray, +} from "preact"; import { render } from "preact-render-to-string"; import { writeText } from "copy-paste"; @@ -55,3 +62,43 @@ export const mk_class_wrapper = (klass: string) => ({ children }: { children: ComponentChildren }) =>
{...toChildArray(children)}
; + +export const slidify = ( + Slide: (_: { + slide: JSX.Element; + next?: JSX.Element; + n: number; + max: number; + }) => JSX.Element, + slides: JSX.Element[], + n = 1, + max = slides.length +): JSX.Element => + slides[0] ? ( + + ) : ( + <> + ); + +// https://cohost.org/lexyeevee/post/2107474-css-for-css-baby-3 (wayyy down at the bottom) +export const DisappearOnClick = ({ + children, + className, +}: { + className?: string; + children: ComponentChildren; +}) => ( +
+ + {children} +
+); diff --git a/html/draw.tsx b/html/draw.tsx new file mode 100644 index 0000000..e69de29 diff --git a/html/lc.tsx b/html/lc.tsx new file mode 100644 index 0000000..2406e60 --- /dev/null +++ b/html/lc.tsx @@ -0,0 +1,91 @@ +import { JSX } from "preact"; +import { DisappearOnClick, Main, render_and_copy, slidify } from "./common.tsx"; + +const Slide = ({ + slide, + next, + n, + max, +}: { + slide: JSX.Element; + next?: JSX.Element; + n: number; + max: number; +}) => + next ? ( +
+
+ +
{slide}
+
+ {/* prob going to change this back to just n/max */} + {n == max ? ( + + thank you so much for reading! + + ) : ( + + {n}/{max} + + )} +
+
+ +
+
+ ) : ( +
{slide}
+ ); + +// let 'em click to get rid of stuff +// show that the names don't matter, their just symbols etc +// (use homestuck pictures) + +render_and_copy( +
+ {slidify(Slide, [ + <>homestuck, + <>is cool, + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + <> + bla bla this WILL disappear{" "} + bla + , + ])} +
+); diff --git a/html/you-are-the-turing-machine.tsx b/html/you-are-the-turing-machine.tsx new file mode 100644 index 0000000..00d4178 --- /dev/null +++ b/html/you-are-the-turing-machine.tsx @@ -0,0 +1 @@ +// binary