1export default function handler(req: Request) {
2return new Response("Hello, Val Town API!", {
3headers: {
TestProjectfairYellowSheep1 match
1function greet() {
2return "Hello, Val Town!";
3}
aiMessengermain.tsx5 matches
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
45function generateSecureRoomCode() {
6return crypto.randomUUID().split("-")[0].toUpperCase();
7}
89function App() {
10const [user, setUser] = useState(null);
11const [chatRooms, setChatRooms] = useState([]);
2324useEffect(() => {
25async function fetchUser() {
26try {
27const response = await fetch("/authenticate");
402}
403404function client() {
405createRoot(document.getElementById("root")).render(<App />);
406}
407if (typeof document !== "undefined") { client(); }
408409export default async function server(request: Request): Promise<Response> {
410const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
411const { OpenAI } = await import("https://esm.town/v/std/openai");
selfassuredCoralPigmain.tsx5 matches
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
45function generateSecureRoomCode() {
6return crypto.randomUUID().split('-')[0].toUpperCase();
7}
89function App() {
10const [user, setUser] = useState(null);
11const [chatRooms, setChatRooms] = useState([]);
2324useEffect(() => {
25async function fetchUser() {
26try {
27const response = await fetch('/authenticate');
386}
387388function client() {
389createRoot(document.getElementById("root")).render(<App />);
390}
391if (typeof document !== "undefined") { client(); }
392393export default async function server(request: Request): Promise<Response> {
394const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
395const { OpenAI } = await import("https://esm.town/v/std/openai");
generateQRmain.tsx4 matches
1import { qrcode } from "https://deno.land/x/qrcode/mod.ts";
23export default async function server(req: Request): Promise<Response> {
4const url = new URL(req.url);
5const peer = url.searchParams.get("peer") || "";
81
82<script>
83function showMessage(message) {
84const notification = document.getElementById("notification");
85notification.textContent = message;
91}
92
93async function copyImage() {
94try {
95const dataUrl = document.getElementById("qr-img").src;
137}
138
139function copyBase64() {
140const base64Text = document.getElementById("qr-base64").innerText;
141navigator.clipboard.writeText(base64Text)
22}
2324function getFileEmote(file: RTCFile) {
25const fileType = file.type.split("/")[0];
26switch (fileType) {
59const buttonHover = Object.values(ButtonHover)[randomIndex];
6061function App() {
62const [showModal, setShowModal] = useState(false);
63const [peerId, setPeerId] = useState("");
154* @returns The base64 string if found; otherwise, null.
155*/
156function extractBase64FromHtml(html: string): string | null {
157// This regex captures everything between <pre id="qr-base64"> and </pre>
158const regex = /<pre\s+id=["']qr-base64["']>([\s\S]*?)<\/pre>/i;
393}
394395function client() {
396render(<App />, document.getElementById("root")!);
397}
432`;
433434export default async function server(request: Request): Promise<Response> {
435const url = new URL(request.url);
436
blob_admin_migratedmain.tsx8 matches
13}
1415function Tooltip({ children, content }: TooltipProps) {
16const [isVisible, setIsVisible] = useState(false);
17const tooltipRef = useRef<HTMLDivElement>(null);
52}
5354function formatBytes(bytes: number, decimals = 2) {
55if (bytes === 0) return "0 Bytes";
56const k = 1024;
61}
6263function copyToClipboard(text: string) {
64navigator.clipboard.writeText(text).then(() => {
65console.log("Text copied to clipboard");
69}
7071function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72const [isOpen, setIsOpen] = useState(false);
73const menuRef = useRef(null);
7677useEffect(() => {
78function handleClickOutside(event) {
79if (menuRef.current && !menuRef.current.contains(event.target)) {
80event.stopPropagation();
158}
159160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161const [isLoading, setIsLoading] = useState(false);
162const decodedKey = decodeURIComponent(blob.key);
219}
220221function App({ initialEmail, initialProfile }) {
222const encodeKey = (key: string) => encodeURIComponent(key);
223const decodeKey = (key: string) => decodeURIComponent(key);
645}
646647function client() {
648const initialEmail = document.getElementById("root").getAttribute("data-email");
649const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));
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
versatileWhiteJaymain.tsx3 matches
24];
2526function IndianMovieExplorer() {
27const [searchTerm, setSearchTerm] = useState("");
28const [actors, setActors] = useState([]);
311}
312313function client() {
314createRoot(document.getElementById("root")).render(<IndianMovieExplorer />);
315}
317if (typeof document !== "undefined") { client(); }
318319export default async function server(request: Request) {
320return new Response(`
321<html>
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
45function LoginScreen({ onLogin }) {
6const [password, setPassword] = useState("");
7const [error, setError] = useState("");
46}
4748function CustomerInteractionForm({ onSubmit }) {
49const [email, setEmail] = useState("");
50const [firstName, setFirstName] = useState("");
240}
241242function InteractionList() {
243const [customerInteractions, setCustomerInteractions] = useState({});
244const [copiedEmail, setCopiedEmail] = useState(null);
470}
471472function App() {
473const [isAuthenticated, setIsAuthenticated] = useState(false);
474const [refreshList, setRefreshList] = useState(0);
517}
518519function client() {
520createRoot(document.getElementById("root")).render(<App />);
521}
522if (typeof document !== "undefined") { client(); }
523524export default async function server(request: Request): Promise<Response> {
525const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
526const KEY = "CRM";