23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
show_keyword_cloudmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [keywords, setKeywords] = useState({});
730}
3132function client() {
33createRoot(document.getElementById("root")).render(<App />);
34}
38}
3940export default async function server(request: Request): Promise<Response> {
41const { blob } = await import("https://esm.town/v/std/blob");
42
StripeCheckoutDemomain.tsx8 matches
81`;
8283function Instructions() {
84return (
85<div className="mb-4">
95}
9697function TipList({ tips, selectedDate, sortOrder, setSortOrder }) {
98const filteredTips = tips.filter((tip) => {
99const tipDate = new Date(tip.timestamp);
145}
146147function DateSelector({ selectedDate, setSelectedDate }) {
148const [isCalendarOpen, setIsCalendarOpen] = useState(false);
149const today = new Date();
232}
233234function App({ initialTips }) {
235const [amount, setAmount] = useState(20);
236const [name, setName] = useState("");
354}
355356function Confetti() {
357useEffect(() => {
358confetti({
366}
367368function SuccessPage({ payments }) {
369return (
370<div className="min-h-screen bg-white text-black flex flex-col items-center justify-center p-4">
391}
392393function client() {
394const root = document.getElementById("root");
395if (root.dataset.page === "success") {
406}
407408export default async function server(req: Request): Promise<Response> {
409const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
410const SCHEMA_VERSION = 2;
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
curiousMoccasinWeaselmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [step, setStep] = useState(0);
7const [isPlaying, setIsPlaying] = useState(false);
120}
121122function client() {
123createRoot(document.getElementById("root")).render(<App />);
124}
128}
129130export default async function server(request: Request): Promise<Response> {
131return new Response(`
132<html>
diacomDemomain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [imageId, setImageId] = useState(null);
7const [file, setFile] = useState(null);
12let cornerstone, cornerstoneWADOImageLoader, dicomParser;
1314async function loadLibraries() {
15cornerstone = (await import("https://esm.sh/cornerstone-core")).default;
16cornerstoneWADOImageLoader = (await import("https://esm.sh/cornerstone-wado-image-loader")).default;
80}
8182function client() {
83createRoot(document.getElementById("root")).render(<App />);
84}
86if (typeof document !== "undefined") { client(); }
8788export default async function server(request: Request): Promise<Response> {
89return new Response(`
90<html>
cheerfulTanDeermain.tsx1 match
78// Fetches a random joke.
9async function fetchRandomJoke() {
10const response = await fetch(
11"https://official-joke-api.appspot.com/random_joke",
bricklesGamemain.tsx10 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const canvasRef = useRef(null);
7const [score, setScore] = useState(0);
36document.addEventListener('keyup', (e) => keys[e.key] = false);
3738function drawBall() {
39ctx.beginPath();
40ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2);
44}
4546function drawPaddle() {
47ctx.beginPath();
48ctx.rect(paddle.x, paddle.y, paddle.width, paddle.height);
52}
5354function drawBricks() {
55for (let c = 0; c < brickColumnCount; c++) {
56for (let r = 0; r < brickRowCount; r++) {
70}
7172function drawParticles() {
73particles.forEach((particle, index) => {
74particle.life--;
87}
8889function createParticles(x, y) {
90for (let i = 0; i < 10; i++) {
91particles.push({
100}
101102function collisionDetection() {
103for (let c = 0; c < brickColumnCount; c++) {
104for (let r = 0; r < brickRowCount; r++) {
118}
119120function draw() {
121ctx.clearRect(0, 0, canvas.width, canvas.height);
122drawBricks();
187}
188189function client() {
190createRoot(document.getElementById("root")).render(<App />);
191}
192if (typeof document !== "undefined") { client(); }
193194export default async function server(request: Request): Promise<Response> {
195return new Response(`
196<html>
StripeDemomain.tsx4 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function App() {
7const [tipAmount, setTipAmount] = useState(5);
8const paymentLinks = {
63}
6465function Success() {
66useEffect(() => {
67confetti({
81}
8283function client() {
84const root = document.getElementById("root");
85if (root) {
94if (typeof document !== "undefined") { client(); }
9596export default async function server(request: Request): Promise<Response> {
97const url = new URL(request.url);
98
handleDiscordNewUsermain.tsx1 match
3// # New Val Town User (on Clerk) -> Val Town Discord notification
4// Translates one kind of webhook (Clerk) into another (Discord)
5export async function handleDiscordNewUser(req: Request): Promise<Response> {
6// check custom auth secret sent from clerk
7if (req.headers.get("auth") !== Deno.env.get("clerkNonSensitive"))