From 03b8e4ef2d19f6932c2c0128bd24247c1c0de8dc Mon Sep 17 00:00:00 2001 From: mehbark Date: Sat, 24 Feb 2024 22:39:17 -0500 Subject: [PATCH] randchar: looking really nice --- html/random-character.tsx | 225 ++++++++++++++++++++++++++++++++++++-- serverside/prngnouns.ts | 2 +- 2 files changed, 214 insertions(+), 13 deletions(-) diff --git a/html/random-character.tsx b/html/random-character.tsx index 565e548..3ba4c0d 100644 --- a/html/random-character.tsx +++ b/html/random-character.tsx @@ -1,5 +1,5 @@ import { JSX } from "preact/jsx-runtime"; -import { render_and_copy } from "./common.tsx"; +import { Main, render_and_copy, serverside_randirect } from "./common.tsx"; // let's do 100 first and last names OKAY // @@ -217,19 +217,193 @@ const LAST_NAMES = [ "bark", ].map(name => name[0].toUpperCase() + name.slice(1)); +// sweet we can just img src= +const ASPECT_URLS = [ + "https://static.wikia.nocookie.net/mspaintadventures/images/6/60/Space_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/f/f4/Time_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/1/11/Mind_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/a/ac/Heart_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/3/35/Hope_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/c/c3/Rage_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/a/a0/Breath_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/1/13/Blood_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/3/3e/Life_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/1/1c/Doom_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/6/68/Light_Aspect.svg", + "https://static.wikia.nocookie.net/mspaintadventures/images/1/13/Void_Aspect.svg", +]; + +// oh heck yeah we can totally layer clothes and stuff +// not gonna though +// link to http://www.farragofiction.com/DollSim/ why not + +const CLASSES = [ + "Thief", + "Rogue", + "Bard", + "Prince", + "Heir", + "Page", + "Seer", + "Maid", + "Sylph", + "Knight", + "Witch", + "Mage", +]; + +// if this was ruby i could just multiply that array grumble grumble + +const LIKED_NOUNS = [ + "cats", + "dogs", + "computers", + "keyboards", + "eggbug", + "homestuck", + "websites", + "paintbrushes", + "randomness", + "posts", + "chairs", + "wires", + "audio", + "sound", + "music", + "sound effects", + "personal hygiene", + "smells", + "cars", + "cdrs", + "pairs", + "atoms", + "lists", + "trees", + "tasks", + "smart devices", + "dumb devices", + "synthesizers", + "violins", + "pianos", + "remotes", + "earbuds", + "eggbuds", + "scented waxes", + "cables", + "cords", + "love", + "hate", + "coolness", + "radness", + "gnarliness", + "lameness", + "sick-nastiness", + "maximalism", + "minimalism", + "cohost", + "html", + "css", + "javascript", + "typescript", + "deno", + "dinos", + "life", + "yourself", + "whatever is reading this", + "fish", + "sharks", + "eevees", + "seagulls", +].map(s => s.toUpperCase()); + +const LIKED_ACTIVITIES = [ + "playing the trombone", + "playing the piano", + "using the computer", + "posting on the websites", + "reading homestuck", + "playing homestuck", + "reading gamebro", + "reading gamegrl", + "helping others", + "hindering others", + "egging the bug", + "coing the host", + "making a javascript", + "scheming (in the evil sense)", + "scheming (in the algorithmic language sense)", + "reading books (how exciting)", + "reading blogs", + "being kind :D", + "being rude D:", + "liking things", + "loving things", + "transforming", + "refreshing this page to see different things", + "writing blogs", + "writing books", + "writing visual novels", + "reading visual novels", + "playing visual novels", + "gaming", + "gaming so hard", + "gaming so, so hard", + "gaming so, so, so hard", + "gaming a regular amount of hard", + "flarping", + "playing games for girls", + "sweeping mines", + "tetrising", + "nixing operating systems", + "emacsing", + "using alternatives to discord", + "internet relay chatting", + "hypertexting", + "decorating your room", + "designing clothes", + "wearing clothes", + "being cool", + "being rad", + "being gnarly", + "being lame", + "making fun random generators by assembling a small set of primitives that, yes, could be more atomic", + "making this text really squishy by liking doing something with a really long description like this", + "finishing up a list", + "writing activities that are actually homestuckish", + "staying in your room", + "staying anywhere but your room", + "programming poorly", + "shaving", + "dressing in a spiffy manner", + "watching crappy movies", + "watching really good movies", + "doing nothing in particular", + "cleaning your room", + "attempting to escape your absurd house", + "attempting to make your house more absurd", + "architecting", + "visiting others", + "visiting yourself", + "doing enough", +].map(s => s.toUpperCase()); + // has some defaults export const Prngnoun = ({ prns, + alt, style = {}, }: { prns: string[]; + alt: string; style?: JSX.CSSProperties; }) => ( {alt} @@ -242,18 +416,45 @@ export const Prngnoun = ({ // idk render_and_copy( -

- Your name is {" "} - . You are{" "} - i.toString())} - />{" "} - years old. Cool! -

+

+ Your name is{" "} + {" "} + + . You like ,{" "} + {/* we add another thing so that it isn't the same url */} + + , and . +

+

+ You are a {" "} + of{" "} + the symbol of an aspect from homestuck + , but you don't really care about that—it's hard to god-tier + when you are a randomly-filled out template! +

+ ); diff --git a/serverside/prngnouns.ts b/serverside/prngnouns.ts index 66bc828..3ed4411 100644 --- a/serverside/prngnouns.ts +++ b/serverside/prngnouns.ts @@ -59,7 +59,7 @@ async function get_pronoun_image(prn: string): Promise { } // the whole cache thing def sketches me out, but people probably won't be *that* malicious -const MAX_PRN_LENGTH = 32; +const MAX_PRN_LENGTH = 128; const MAX_PRN_CACHE = 64; // shouldn't really be a problem const MAX_PRN_CHOICES = 256;