1Base working example of combining Hono, React/JSX, and html templates
2
3Migrated from folder: Experiments/hono/honoJsxHtmlTemplates
3 * When a valid chain is selected, the last square in the chain holds the total value rounded up to the nearest power of two,
4 * and the other squares get new random values. The player scores points based on the chain length and values.
5 * We'll use React for the UI and manage game state on the client side.
6 * The server will just serve the initial HTML and JavaScript.
7 *
17 */
18
19/** @jsxImportSource https://esm.sh/react */
20import React, { useEffect, useRef, useState } from "https://esm.sh/react";
21import { createRoot } from "https://esm.sh/react-dom/client";
22
23// Game board size
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState, useEffect } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import { BrowserRouter as Router, Route, Link, Routes } from "https://esm.sh/react-router-dom";
5
6function EasingVisualizer({ easing }) {
7 const canvasRef = React.useRef(null);
8
9 React.useEffect(() => {
10 const canvas = canvasRef.current;
11 const ctx = canvas.getContext('2d');
1/** @jsxImportSource npm:react **/
2import { blob } from "https://esm.town/v/std/blob";
3import { email } from "https://esm.town/v/std/email";
4import { renderToString } from "npm:react-dom@18/server";
5
6const updatedKey = "caniuse-updated-at";
2// We'll use SQLite for persistence to store the click count and add a confetti effect for each click.
3
4/** @jsxImportSource https://esm.sh/react */
5import React, { useState, useEffect } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
7import confetti from 'https://esm.sh/canvas-confetti';
8
4 * Users can upvote each post exactly once and comment on stories in an infinitely nested style.
5 */
6/** @jsxImportSource https://esm.sh/react */
7import React, { useState, useEffect } from "https://esm.sh/react";
8import { createRoot } from "https://esm.sh/react-dom/client";
9import { luciaMiddleware } from "https://esm.town/v/yawnxyz/lucia_middleware_safe";
10
1// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
2// and display them on a big calendar. We'll use react-big-calendar for the calendar component,
3// and pdf.js for PDF parsing. The server will handle PDF processing and event extraction.
4
5/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
8import { Calendar, momentLocalizer } from "https://esm.sh/react-big-calendar";
9import { createEvents } from "https://esm.sh/ics@3.1.0";
10import moment from "https://esm.sh/moment";
11
12// Set up the localizer for react-big-calendar
13const localizer = momentLocalizer(moment);
14
177 <head>
178 <title>Calendar Event Extractor</title>
179 <link rel="stylesheet" href="https://esm.sh/react-big-calendar/lib/css/react-big-calendar.css">
180 <style>${css}</style>
181 </head>
1// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
2// and display them on a big calendar. We'll use react-big-calendar for the calendar component,
3// and pdf.js for PDF parsing. The server will handle PDF processing and event extraction.
4
5/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
8import { Calendar, momentLocalizer } from "https://esm.sh/react-big-calendar";
9import moment from "https://esm.sh/moment";
10
11// Set up the localizer for react-big-calendar
12const localizer = momentLocalizer(moment);
13
137 <head>
138 <title>Calendar Event Extractor</title>
139 <link rel="stylesheet" href="https://esm.sh/react-big-calendar/lib/css/react-big-calendar.css">
140 <style>${css}</style>
141 </head>
1/** @jsxImportSource https://esm.sh/react */
2import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
3import dagre from "https://esm.sh/cytoscape-dagre@2.5.0";
4import cytoscape from "https://esm.sh/cytoscape@3.23.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
7
8cytoscape.use(dagre);
3// The main tradeoff is the complexity of setting up Lucia, but it offers robust auth features.
4
5/** @jsxImportSource https://esm.sh/react */
6import { ValTownAdapter } from "https://esm.town/v/yawnxyz/lucia_adapter_valtown";
7import { createUser, getUser, verifyPassword } from "https://esm.town/v/yawnxyz/lucia_sqlite";
8import { Lucia, Session, User } from "npm:lucia@3.0.1";
9import { renderToString } from "npm:react-dom/server";
10import { CookieJar } from "https://deno.land/x/cookies/mod.ts";
11