1import { tidbytCircle } from "https://esm.town/v/andreterron/tidbytCircle";
2
3export async function tidbytStar({ size = 7, bg = 0x047857ff, star = 0xffffffff }: {
4 size?: number;
5 bg?: number;
1import { Database } from "https://esm.sh/duckdb-async";
2
3export default async function server(request: Request): Promise<Response> {
4 const url = new URL(request.url);
5 const dataUrl = url.searchParams.get('url');
214};
215
216export function cohostSanitize(html: string, document: Document): Node {
217 const unsafeTree = fromHtml(html, { fragment: true });
218 const safeTree = sanitize(unsafeTree, FIFTH_AGE.schema);
8const BLOB_PREFIX = "items_";
9
10export default async function server(request: Request): Promise<Response> {
11 const url = new URL(request.url);
12 const path = url.pathname;
58}
59
60async function getAllItems() {
61 const keys = await blob.list(BLOB_PREFIX);
62 const items = await Promise.all(
69}
70
71async function getItem(id: string) {
72 return await blob.getJSON(`${BLOB_PREFIX}${id}`);
73}
74
75async function createItem(item: any) {
76 const id = crypto.randomUUID();
77 await blob.setJSON(`${BLOB_PREFIX}${id}`, item);
79}
80
81async function updateItem(id: string, item: any) {
82 await blob.setJSON(`${BLOB_PREFIX}${id}`, item);
83}
84
85async function deleteItem(id: string) {
86 await blob.delete(`${BLOB_PREFIX}${id}`);
87}
88
89function jsonResponse(data: any, headers: HeadersInit, status = 200) {
90 return new Response(JSON.stringify(data), {
91 headers: { ...headers, "Content-Type": "application/json" },
94}
95
96function notFoundResponse(headers: HeadersInit) {
97 return new Response("Not Found", { headers, status: 404 });
98}
99
100function getInstructions() {
101 return `
102JSON Blob Storage API
8import { FileText, Trophy, Briefcase, Palette, Book, MessageCircle } from "https://esm.sh/lucide-react";
9
10function PersonalCard() {
11 return (
12 <div className="flex justify-center items-center min-h-screen bg-gray-100 p-4">
92}
93
94function App() {
95 return <PersonalCard />;
96}
97
98// client-side only code
99function client() {
100 createRoot(document.getElementById("root")).render(<App />);
101}
103
104// server-side only code
105export default async function server(request: Request): Promise<Response> {
106 return new Response(`
107 <!DOCTYPE html>
5 url: string;
6};
7export async function searchManifoldMarkets(query: string) {
8 const result = await fetch(
9 `https://manifold.markets/api/v0/search-markets?${query}`,
7const CELL_SIZE = CANVAS_SIZE / GRID_SIZE;
8
9function ChatRoom() {
10 const [messages, setMessages] = useState([]);
11 const [inputMessage, setInputMessage] = useState('');
46}
47
48function SnakeGame() {
49 const [snake, setSnake] = useState([{ x: 10, y: 10 }]);
50 const [food, setFood] = useState({ x: 15, y: 15 });
127}
128
129function App() {
130 const [currentView, setCurrentView] = useState('menu');
131
157}
158
159function mountApp() {
160 const root = document.getElementById("root");
161 if (root) {
166}
167
168async function server(request: Request): Promise<Response> {
169 return new Response(`
170 <html>
15const PIPE_GAP = 200;
16
17function Bird({ y, invincible }) {
18 return (
19 <div style={{
33}
34
35function Pipe({ x, height, isTop, isGhost }) {
36 return (
37 <div style={{
47}
48
49function GameOver({ score, onRestart }) {
50 return (
51 <div style={{
63}
64
65function BloodEffect({ x, y }) {
66 return (
67 <div style={{
79}
80
81function SlotMachine({ spinning, result, onSpin }) {
82 return (
83 <div style={{
127}
128
129function App() {
130 const [birdY, setBirdY] = useState(GAME_HEIGHT / 2);
131 const [birdVelocity, setBirdVelocity] = useState(0);
294}
295
296function client() {
297 createRoot(document.getElementById("root")).render(<App />);
298}
300if (typeof document !== "undefined") { client(); }
301
302async function server(request: Request): Promise<Response> {
303 return new Response(`
304 <html>
1export async function tidbytCircle({ size = 7, fill, border }: {
2 size?: number;
3 fill?: number;
8import Jimp from "npm:jimp@0";
9
10export async function createTidbytWorkoutsImage(icons: WorkoutIcon[]) {
11 const headerUrl = "https://art.pixilart.com/sr2c714c74a22aws3.png";
12 const weekdaysUrl = "https://art.pixilart.com/sr22f1df42b42aws3.png";
54 });
55
56 function selectIcon(icon: WorkoutIcon) {
57 switch (icon) {
58 case "done":