34});
35
36export default async function(req: Request): Promise<Response> {
37 if (req.url.endsWith("/img-chart")) {
38 return renderChart(chart());
67];
68
69export function months({ count = 12, section }: Config = {}) {
70 const values = [];
71
78}
79
80export function rand(min = 0, max = 0): number {
81 _seed = (_seed * 9301 + 49297) % 233280;
82 return min + (_seed / 233280) * (max - min);
96}
97
98export function numbers({
99 min = 0,
100 max = 100,
94};
95
96async function handler(req: Request): Promise<Response> {
97 const url = new URL(req.url);
98 if (req.method === "GET" && url.pathname === "/event") {
1let active = false;
2
3function getRandomEmoji() {
4 const emojis = ["๐ณ", "๐ณ", "๐ฒ", "๐ฟ", "๐ฑ", "๐พ", "๐", "๐", "๐", "๐ท", "๐ชป", "๐"];
5 const randomIndex = Math.floor(Math.random() * emojis.length);
7}
8
9function injectCSS(css: string) {
10 const style = document.createElement("style");
11 style.type = "text/css";
33const buttonBackgroundMap = new Map();
34
35// Function to create or get the background div
36function getBackgroundDiv(button) {
37 if (!buttonBackgroundMap.has(button)) {
38 const newDiv = document.createElement("div");
49}
50
51// Function to position the background div behind the button
52function positionDivBehindButton(button) {
53 const rect = button.getBoundingClientRect();
54 const newDiv = getBackgroundDiv(button);
63 window.addEventListener("scroll", () => positionDivBehindButton(button));
64
65 button.addEventListener("click", function() {
66 if (active) return;
67 active = true;
11import { renderToString } from "npm:react-dom/server";
12
13export default async function(req: Request): Promise<Response> {
14 return new Response(
15 renderToString(
11];
12
13export default async function(req: Request): Promise<Response> {
14 const url = new URL(req.url);
15 if (url.pathname === "/") {
9});
10
11export default async function handler(request: Request) {
12 if (request.method !== "POST") {
13 return html(`
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request): Promise<Response> {
5 return new Response(
6 renderToString(
2const resp = await fetch("https://maxm-wasmblobhost.web.val.run/e5vpzt253pv5jxqfmygo7nytl5uvyn5c.wasm");
3const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
4export default async function(req: Request): Promise<Response> {
5 return handler(req);
6}
59const resp = await fetch("${url}");
60const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
61export default async function(req: Request): Promise<Response> {
62 return handler(req);
63}`);
2const resp = await fetch("https://maxm-wasmBlobHost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
3const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
4export default async function(req: Request): Promise<Response> {
5 return handler(req);
6}