1/** @jsxImportSource https://esm.sh/react */
2import { modifyFetchHandler as codeOnValTown } from "https://esm.town/v/andreterron/codeOnValTown?v=45";
3import { modifyResponse } from "https://esm.town/v/andreterron/codeOnVT_modifyResponse?v=9";
5import { Chess, Move, Square } from "npm:chess.js";
6import minify from "npm:css-simple-minifier";
7import { renderToString } from "npm:react-dom/server";
8
9class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { Chess, Move, Square } from "npm:chess.js";
3import minify from "npm:css-simple-minifier";
4import { renderToString } from "npm:react-dom/server";
5
6class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { Chess, Move, Square } from "npm:chess.js";
3import minify from "npm:css-simple-minifier";
4import { renderToString } from "npm:react-dom/server";
5
6class StaticChess {
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import cronstrue from "https://esm.sh/cronstrue";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
5import react_http from "https://esm.town/v/stevekrouse/react_http?v=6";
6
7export default function(req: Request) {
8 const url = new URL(req.url);
9 if (req.method === "GET" && url.pathname === "/") {
10 return react_http({
11 component: App,
12 sourceURL: import.meta.url,
26 const [loading, setLoading] = useState(false);
27 const [cron, setCron] = useState("0 16 * * 1-5");
28 const onSubmit: React.FormEventHandler<HTMLFormElement> = async function(e) {
29 e.preventDefault();
30 setLoading(true);
6 <script type="module">
7 import { ${component.name} } from "${sourceURL}";
8 import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
9 import { jsx } from "https://esm.sh/react@18.2.0/jsx-runtime";
10 createRoot(document.body).render(jsx(${component.name}, {}));
11 </script>
12## TODO
13
14- [ ] simplify by removing HTMX (try doing the form as a GET request, manual JS script, or client side react)
15- [ ] make the timezone picker better (fewer options, searchable)
16- [ ] add a copy button?
17
18Migrated from folder: Archive/cron_client_react_fork
1/** @jsxImportSource npm:react **/
2import { renderToString } from "npm:react-dom@18/server";
3
4export default (req: Request) => {
1/** @jsxImportSource https://esm.sh/preact **/
2
3import { blob } from "https://esm.town/v/std/blob?v=12";
4import { compile } from "npm:@mdx-js/mdx";
5import { Hono } from "npm:hono";
6import { render } from "npm:preact-render-to-string";
7import remarkFrontmatter from "npm:remark-frontmatter";
8import remarkMdxFrontmatter from "npm:remark-mdx-frontmatter";
51 const vfile = await compile(await resp.text(), {
52 jsx: true,
53 jsxImportSource: "https://esm.sh/preact",
54 remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter],
55 });
63
64 const vfile = await compile(await resp.text(), {
65 jsxImportSource: "https://esm.sh/preact",
66 remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter],
67 });
1/** @jsxImportSource https://esm.sh/preact */
2import { activeGTrainAlerts } from "https://esm.town/v/pbt/gtrainalerts?v=36";
3import { render } from "npm:preact-render-to-string";
4import Uwuifier from "npm:uwuifier";
5