9}
10
11export async function runGlif({
12 id,
13 inputs,
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function CryptoPriceApp() {
6 const [prices, setPrices] = useState<{
7 bitcoin: { current: number | null, previous: number | null },
15
16 useEffect(() => {
17 async function fetchCryptoPrices() {
18 try {
19 // Fetch Bitcoin price from CoinDesk
195}
196
197function client() {
198 createRoot(document.getElementById("root")).render(<CryptoPriceApp />);
199}
200if (typeof document !== "undefined") { client(); }
201
202export default async function server(request: Request): Promise<Response> {
203 return new Response(`
204 <html>
1/** @jsxImportSource npm:hono/jsx */
2async function createSession(email: string, hostname: string) {
3 const { zip } = await import("https://esm.town/v/pomdtr/sql");
4 const { sqlite } = await import("https://esm.town/v/std/sqlite");
23}
24
25async function getSession(sessionID: string, hostname: string) {
26 const { zip } = await import("https://esm.town/v/pomdtr/sql");
27 const { sqlite } = await import("https://esm.town/v/std/sqlite");
52}
53
54async function deleteSession(sessionID: string) {
55 const { sqlite } = await import("https://esm.town/v/std/sqlite");
56
64const OAUTH_COOKIE = "oauth_store";
65
66export function lastlogin(
67 handler: (req: Request) => Response | Promise<Response>,
68) {
1export default async function(req: Request): Promise<Response> {
2 // Pick a random greeting
3 const greetings = ["Hello!", "Welcome!", "Hi!", "Heya!", "Hoi!"];
10const SOLUTION_WORDS = ["WILLY", "YOUTH", "MARRY", "METER"];
11
12function Modal({ isOpen, onClose, children }) {
13 if (!isOpen) return null;
14
22}
23
24function WinModal({ isOpen, onPlay }) {
25 return (
26 <Modal isOpen={isOpen}>
36}
37
38function ProposalModal({ isOpen }) {
39 return (
40 <Modal isOpen={isOpen}>
47}
48
49function App() {
50 const [games, setGames] = useState(SOLUTION_WORDS.map(word => ({
51 word,
188}
189
190function GameBoard(
191 {
192 word,
272}
273
274function Keyboard({ usedLetters, onKeyPress, disabled }) {
275 const rows = [
276 ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
339}
340
341function client() {
342 createRoot(document.getElementById("root")).render(<App />);
343}
345if (typeof document !== "undefined") { client(); }
346
347export default async function server(request: Request): Promise<Response> {
348 const { blob } = await import("https://esm.town/v/std/blob");
349 const wordList = await (await blob.get("quordle")).text();
393 }
394 @keyframes bounce {
395 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
396 50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
397 }
398 .animate-bounce { animation: bounce 1s infinite; }
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [numPeople, setNumPeople] = useState(4);
7 const [numRecipes, setNumRecipes] = useState(1);
229}
230
231function client() {
232 createRoot(document.getElementById("root")).render(<App />);
233}
234if (typeof document !== "undefined") { client(); }
235
236function extractJSONFromMarkdown(markdown: string): string {
237 const jsonMatch = markdown.match(/```json\n([\s\S]*?)\n```/);
238 return jsonMatch ? jsonMatch[1] : "";
239}
240
241export default async function server(request: Request): Promise<Response> {
242 if (request.method === "POST" && new URL(request.url).pathname === "/recipes") {
243 const { OpenAI } = await import("https://esm.town/v/std/openai");
338}
339
340async function generateImage(recipeName: string): Promise<string> {
341 const response = await fetch(`https://maxm-imggenurl.web.val.run/${encodeURIComponent(recipeName)}`);
342 if (!response.ok) {
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "region Hannover "; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
4 const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
5 url.searchParams.set("query", query);
8type User = { id: string; username: string; tier: string };
9
10function SimpleLineChart({ data, width = 800, height = 400, margin = { top: 20, right: 20, bottom: 30, left: 40 } }) {
11 const chartWidth = width - margin.left - margin.right;
12 const chartHeight = height - margin.top - margin.bottom;
69}
70
71function Dashboard({ data }) {
72 const chartData = Object.keys(data[0].users).map(username => ({
73 name: username,
106}
107
108function App({ initialData }) {
109 const [data] = useState(initialData);
110
112}
113
114function client() {
115 const initialData = (window as any).INITIAL_DATA;
116 createRoot(document.getElementById("root")).render(<App initialData={initialData} />);
121}
122
123async function getUsageData() {
124 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
125 const result = await sqlite.execute(`
141}
142
143export default async function server(req: Request): Promise<Response> {
144 const url = new URL(req.url);
145