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":
1import CryptoJS from "npm:crypto-js";
2const cryptoJs = CryptoJS;
3function _kv(a) {
4 return [(a & 4278190080) >> 24, (a & 16711680) >> 16, (a & 65280) >> 8, a & 255];
5}
13 }
14};
15export async function decryptURL(a, X) {
16 try {
17 var r0 = CryptoJS.AES.decrypt(a, X);
23}
24
25export async function decryptSource(keys, kversion, response) {
26 let encrypted = response.sources;
27 console.log(kversion);
38 return response;
39}
40export async function getMeta(id) {
41 const req = await fetch(`https://rabbitstream.net/v2/embed-4/${id}?z=`, {
42 headers: {
54 return metaMatch[1];
55}
56export async function getWasm() {
57 const req = await fetch("https://rabbitstream.net/images/loading.png?v=0.6", {
58 "headers": {
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function calculateDensityAltitude(elevation, temperature, pressure) {
10 // Convert temperature to Celsius
11 const tempC = (temperature - 32) * 5 / 9;
20}
21
22function App() {
23 const [weatherData, setWeatherData] = useState(null);
24 const [error, setError] = useState(null);
134}
135
136function client() {
137 createRoot(document.getElementById("root")).render(<App />);
138}
140if (typeof document !== "undefined") { client(); }
141
142async function server(request: Request): Promise<Response> {
143 const url = new URL(request.url);
144 const stationId = url.searchParams.get("stationId");
6import { systemPrompt } from "https://esm.town/v/weaverwhale/jtdPrompt";
7
8// Move OpenAI initialization to server function
9let openai;
10
11function App() {
12 const [json, setJson] = useState("");
13 const [imageUrl, setImageUrl] = useState("");
128`;
129
130function client() {
131 createRoot(document.getElementById("root")).render(<App />);
132}
136}
137
138async function server(request: Request): Promise<Response> {
139 const url = new URL(request.url);
140
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [page, setPage] = useState("home");
7 const [showModal, setShowModal] = useState(false);
153}
154
155function client() {
156 createRoot(document.getElementById("root")).render(<App />);
157}
159if (typeof document !== "undefined") { client(); }
160
161async function server(request: Request): Promise<Response> {
162 return new Response(
163 `
3import { email } from "https://esm.town/v/std/email";
4
5async function fetchStories(type: string, count: number) {
6 const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7 const storyIds = await response.json();
15}
16
17function createStoryHTML(story: any) {
18 return `
19 <li>
28}
29
30function createEmailContent(
31 topStories: any[],
32 newStories: any[],
118}
119
120export default async function server(req: Request) {
121 try {
122 const topStories = await fetchStories("top", 10);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function proxy(req: Request) {
4 const resp = await fetch(
5 "http://api.quotable.io/quotes/random?limit=1",
14const openai = new OpenAI();
15
16async function POST(cmd: string, data: { [key: string]: string }) {
17 const url = BOT + "/" + cmd;
18 return await (await fetch(
26}
27
28async function GET(cmd: string) {
29 return await (await fetch(BOT + "/" + cmd)).json();
30}
31
32async function sendMessage(chat_id: string, text: string) {
33 return await POST("sendMessage", { chat_id, text });
34}
35
36async function setWebhook(url: string) {
37 return await POST("setWebhook", { url });
38}
39
40async function getWebhookInfo() {
41 return await GET("getWebhookInfo");
42}
43
44export default async function(req: Request): Promise<Response> {
45 const url = new URL(req.url);
46 const path = url.pathname;