3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [activeSection, setActiveSection] = useState('home');
7 const [showTerms, setShowTerms] = useState(false);
16 const [submissionStatus, setSubmissionStatus] = useState('');
17
18 // New state for chat functionality
19 const [chatMessages, setChatMessages] = useState([]);
20 const [newMessage, setNewMessage] = useState('');
363}
364
365function client() {
366 createRoot(document.getElementById("root")).render(<App />);
367}
368if (typeof document !== "undefined") { client(); }
369
370export default async function server(request: Request): Promise<Response> {
371 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
372 const KEY = "Youths4chnangeintv";
25};
26
27function ImageMatchGame() {
28 const [category, setCategory] = useState(null);
29 const [level, setLevel] = useState(1);
105}
106
107function App() {
108 return (
109 <div>
114}
115
116function client() {
117 createRoot(document.getElementById("root")).render(<App />);
118}
119if (typeof document !== "undefined") { client(); }
120
121export default async function server(request: Request): Promise<Response> {
122 return new Response(`
123 <html>
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `
116];
117
118function App() {
119 const [cart, setCart] = useState([]);
120 const [filter, setFilter] = useState("all");
430};
431
432function client() {
433 createRoot(document.getElementById("root")).render(<App />);
434}
435if (typeof document !== "undefined") { client(); }
436
437export default async function server(request: Request): Promise<Response> {
438 return new Response(
439 `
9const thisURL = parseProject(import.meta.url).links.self.project;
10
11function StatusRow({ rows }) {
12 return (
13 <div className="w-full flex flex-col space-y-2">
31}
32
33function StatusSection({ url, rows }) {
34 const sectionRows = rows.filter(row => row[0] === url);
35 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
47}
48
49export default async function(req: Request): Promise<Response> {
50 const { rows } = await sqlite.execute(
51 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2export function SparklineSVG({ strokeWidth = 2, data = [], fill = "none", stroke = "black" }) {
3 const padding = 2;
4 const xMargin = 25;
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}
7);
8
9export async function uptimeCheck(url: string, attempt = 1) {
10 let reason: string = "";
11 let status: number | null = null;
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",