crimewriter: eh, done enough enough
This commit is contained in:
parent
54d8017261
commit
381ff345be
5 changed files with 61 additions and 37 deletions
5
#1.6.scm#
Normal file
5
#1.6.scm#
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
(define (new-if predicate then-clause else-clause)
|
||||||
|
(cond (predicate then-clause)
|
||||||
|
(else else-clause)))
|
||||||
|
|
||||||
|
(new-if (= 1 1) 0 5)
|
|
@ -267,3 +267,7 @@ export const css = {
|
||||||
min_content: "min-content",
|
min_content: "min-content",
|
||||||
max_content: "max-content",
|
max_content: "max-content",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
export const Filler = ({ height }: { height: string }) => (
|
||||||
|
<div style={`height:${height}`}></div>
|
||||||
|
);
|
||||||
|
|
|
@ -79,10 +79,8 @@ export const Fall = ({
|
||||||
const msg = `
|
const msg = `
|
||||||
i haven't seen this on other blogs, but some of the posts on mine seem to be kinda unstable?
|
i haven't seen this on other blogs, but some of the posts on mine seem to be kinda unstable?
|
||||||
if that makes sense?
|
if that makes sense?
|
||||||
like, sometimes i see them shake, and i swear i saw some letters fall, not to mention the terrible line-wrapping
|
like, sometimes i see them shake, and i swear i saw some letters fall, not to mention the terrible line-wrapping.
|
||||||
|
|
||||||
i know i'm a (convicted?) css criminal, so i'm thinking that this might just be the w3 gods punishing me.
|
i know i'm a (convicted?) css criminal, so i'm thinking that this might just be the w3 gods punishing me.
|
||||||
|
|
||||||
so. yeah. if you see anything like that on any of my posts, let me know
|
so. yeah. if you see anything like that on any of my posts, let me know
|
||||||
`.trim();
|
`.trim();
|
||||||
|
|
||||||
|
|
2
html/meltings.tsx
Normal file
2
html/meltings.tsx
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
// like crumbling but more complex and maybe cooler (ha) looking
|
||||||
|
// nah. too derivative
|
|
@ -1,42 +1,57 @@
|
||||||
import { toChildArray, ComponentChildren } from "preact";
|
// new idea: beeg tree
|
||||||
import { Main, render_and_copy } from "./common.tsx";
|
|
||||||
|
|
||||||
// idea is to have buttons you can click to type out words, should be fun
|
import { render } from "preact-render-to-string";
|
||||||
// (and maybe possible)
|
import { Filler, render_and_copy } from "./common.tsx";
|
||||||
// new idea: type out eggbug or you LOSE
|
|
||||||
const Key = ({ letter }: { letter: string }) => (
|
// there's more size savings to be had but jsx is bad for that
|
||||||
<details class="key">
|
const Key = ({
|
||||||
<summary class="keycap">{letter}</summary>
|
code,
|
||||||
<div
|
content,
|
||||||
class="keyout"
|
remaining_depth,
|
||||||
style={{ left: (sentence.indexOf(letter) ?? 0) + "em" }}
|
}: {
|
||||||
>
|
code: string;
|
||||||
{letter}
|
content: string;
|
||||||
</div>
|
remaining_depth: number;
|
||||||
|
}) => (
|
||||||
|
<details>
|
||||||
|
<summary>{code}</summary>
|
||||||
|
<Screen content={content + code} remaining_depth={remaining_depth} />
|
||||||
</details>
|
</details>
|
||||||
);
|
);
|
||||||
|
|
||||||
const sentence = "cwm fjord bank glyphs vext quiz";
|
// toki pono or whatever that is
|
||||||
|
// oh my gosh this is such a stupid alphabet
|
||||||
|
const alphabet = "acgt";
|
||||||
|
// i went to immense pains to make it so that you have 6 characters for catcat
|
||||||
|
// nvm this isn't working
|
||||||
|
|
||||||
const KeyRow = ({ keys }: { keys: string }) => (
|
const Screen = ({
|
||||||
<div class="keyrow">
|
content = "",
|
||||||
{...keys.split("").map(letter => <Key letter={letter} />)}
|
remaining_depth,
|
||||||
|
}: {
|
||||||
|
content?: string;
|
||||||
|
remaining_depth: number;
|
||||||
|
}) =>
|
||||||
|
remaining_depth == 0 ? (
|
||||||
|
<div style="background:#fff;position:absolute;inset:0">{content}</div>
|
||||||
|
) : (
|
||||||
|
<div style={`background:#fff;position:absolute;inset:0`}>
|
||||||
|
{content == ""
|
||||||
|
? "come on do it write some dna"
|
||||||
|
: content + ".".repeat(remaining_depth)}
|
||||||
|
{alphabet.split("").map(c => (
|
||||||
|
<Key
|
||||||
|
code={c}
|
||||||
|
content={content}
|
||||||
|
remaining_depth={remaining_depth - 1}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const Keyboard = ({ children }: { children: ComponentChildren }) => (
|
|
||||||
<div class="keyboard">{...toChildArray(children)}</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const Out = () => <div class="out"></div>;
|
|
||||||
|
|
||||||
render_and_copy(
|
render_and_copy(
|
||||||
<Main>
|
<>
|
||||||
<Keyboard>
|
<Filler height="8rem" />
|
||||||
<KeyRow keys="qwertyuiop" />
|
<Screen remaining_depth={5} />
|
||||||
<KeyRow keys="asdfghjkl" />
|
</>
|
||||||
<KeyRow keys="zxcvbnm" />
|
|
||||||
</Keyboard>
|
|
||||||
<Out />
|
|
||||||
</Main>
|
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue