diff --git a/html/common.tsx b/html/common.tsx index e43d7c3..ee95c42 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -194,3 +194,24 @@ export const pick_random = (xs: T[]): T => xs[Math.floor(Math.random() * xs.length)]; export const jitter = (n: number) => n * (Math.random() - 0.5); + +export const svg_url = (svg: string) => `data:image/svg+xml,${encodeURI(svg)}`; + +export const css = { + url(href: string) { + return `url('${href}')`; + }, + px(n: number) { + return `${n}px`; + }, + em(n: number) { + return `${n}em`; + }, + rem(n: number) { + return `${n}rem`; + }, + inline_block: "inline-block", + block: "block", + grid: "grid", + flex: "flex", +} as const; diff --git a/html/draft.tsx b/html/draft.tsx new file mode 100644 index 0000000..e69de29 diff --git a/html/sunshine-curved-text.tsx b/html/sunshine-curved-text.tsx index e69de29..b335d70 100644 --- a/html/sunshine-curved-text.tsx +++ b/html/sunshine-curved-text.tsx @@ -0,0 +1,29 @@ +import { css, render_and_copy, svg_url } from "./common.tsx"; + +const svg = ` + + + + + + + + +`.trim(); + +render_and_copy( +
+ yo what's up i am a chuckya +
+);