From d9dfb549f6b2f6fb5caa954cad6ecd82bf245f35 Mon Sep 17 00:00:00 2001 From: mehbark Date: Tue, 11 Jul 2023 16:35:51 -0400 Subject: [PATCH] gonna take a break and work on something else --- html/cohost-plus.tsx | 0 html/eggbug-spamclick-battle.tsx | 0 ...eople_who_eat_croissants_are_dangerous.tsx | 36 +++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 html/cohost-plus.tsx create mode 100644 html/eggbug-spamclick-battle.tsx diff --git a/html/cohost-plus.tsx b/html/cohost-plus.tsx new file mode 100644 index 0000000..e69de29 diff --git a/html/eggbug-spamclick-battle.tsx b/html/eggbug-spamclick-battle.tsx new file mode 100644 index 0000000..e69de29 diff --git a/html/hot_people_who_eat_croissants_are_dangerous.tsx b/html/hot_people_who_eat_croissants_are_dangerous.tsx index 43e65bf..9f0cdbd 100644 --- a/html/hot_people_who_eat_croissants_are_dangerous.tsx +++ b/html/hot_people_who_eat_croissants_are_dangerous.tsx @@ -8,12 +8,12 @@ const peopleify = (...people: string[]): string[] => const animation_length = (num_items: number): number => /*num_items / 5*/ 3; -const wheel_style = (num_items: number, width?: number): string => +const wheel_style = (num_items: number, width?: number, n?: number): string => `transform: translateY(calc(2rem * -${num_items})); animation: ${animation_length( num_items )}s ease-in-out reverse none running spin; ${ width ? `width: ${width * 100}%;` : "" - }`; + } ${n ? `margin-left: calc(-${(width ?? 0) * 100}% * ${n})` : ""}`; const get_delays = (...lengths: number[]): number[] => { let out = [0]; @@ -23,14 +23,14 @@ const get_delays = (...lengths: number[]): number[] => { return out; }; -const Wheel: Component = ({ items, width, classes }, _) => ( -
- +const Wheel: Component = ({ items, width, n, classes }, _) => ( +
+ {...items.map((i: string) =>
{i}
)}
{/*
*/} {...items.map((item: string, i: number) => ( @@ -49,15 +49,21 @@ function slices(arr: T[]): T[][] { } function weird_slices(arr: T[]): T[][] { + console.log(arr.map(item => [...arr.filter(t => t != item), item])); return arr.map(item => [...arr.filter(t => t != item), item]); } -const MultiWheel: Component = ({ items }, _) => ( - - {...weird_slices(items).map(items => ( - +const MultiWheel: Component = ({ items, type }, _) => ( + + {...weird_slices(items).map((items, n) => ( + ))} - + ); @@ -66,9 +72,11 @@ const MultiWheel: Component = ({ items }, _) => ( // it would be possible to have it so the final text is actually properyly selectable maybe but eh const Take: Component = ({ subjects, objects, adjectives }, _) => (
- who eat{" "} - are{" "} - + {" "} +
who eat
{" "} + {" "} +
are
{" "} +
);