From a2367f303eabdc97b08338f7ec27c5958d115154 Mon Sep 17 00:00:00 2001 From: Charlotte Som Date: Wed, 26 Feb 2025 08:10:58 +0000 Subject: [PATCH] write a little frontend --- .prettierrc | 5 ++ _build_client.ts | 14 ++++ client/main.tsx | 103 ++++++++++++++++++++++++++ client/web/css/char.css | 143 ++++++++++++++++++++++++++++++++++++ client/web/css/styles.css | 72 ++++++++++++++++++ client/web/dist/main.js | 116 +++++++++++++++++++++++++++++ client/web/dist/main.js.map | 7 ++ client/web/index.html | 12 +++ deno.json | 18 +++++ server/__init__.py | 6 +- server/http.py | 2 +- server/inference.py | 2 +- 12 files changed, 496 insertions(+), 4 deletions(-) create mode 100644 .prettierrc create mode 100644 _build_client.ts create mode 100644 client/main.tsx create mode 100644 client/web/css/char.css create mode 100644 client/web/css/styles.css create mode 100644 client/web/dist/main.js create mode 100644 client/web/dist/main.js.map create mode 100644 client/web/index.html create mode 100644 deno.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..addff06 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "tabWidth": 2, + "arrowParens": "avoid", + "printWidth": 96 +} diff --git a/_build_client.ts b/_build_client.ts new file mode 100644 index 0000000..483e981 --- /dev/null +++ b/_build_client.ts @@ -0,0 +1,14 @@ +import { build } from "@char/aftercare/esbuild"; + +if (import.meta.main) { + const watch = Deno.args.includes("--watch"); + await build({ + in: ["./client/main.tsx"], + outDir: "./client/web/dist", + watch, + extraOptions: { + splitting: true, + minify: false, + }, + }); +} diff --git a/client/main.tsx b/client/main.tsx new file mode 100644 index 0000000..bb4263a --- /dev/null +++ b/client/main.tsx @@ -0,0 +1,103 @@ +const main = document.querySelector("main")!; + +async function nav() { + const nav =