multilingualchatroommain.tsx9 matches
93};
9495function Banner({ message, isVisible, language }) {
96if (!isVisible) return null;
97return <div className="banner">{message[language] || message.en}</div>;
98}
99100function UserList({ users, t }) {
101return (
102<div className="user-list">
113}
114115function Sidebar({ users, language, handleLanguageChange, roomUrl, copyToClipboard, copied, t }) {
116return (
117<div className="sidebar">
149}
150151function TypingIndicator({ typingUsers, t }) {
152if (typingUsers.length === 0) return null;
153
164}
165166function App() {
167const [messages, setMessages] = useState([]);
168const [inputMessage, setInputMessage] = useState("");
490}
491492function client() {
493createRoot(document.getElementById("root")).render(<App />);
494}
495if (typeof document !== "undefined") { client(); }
496497export default async function server(request: Request): Promise<Response> {
498const url = new URL(request.url);
499const { blob } = await import("https://esm.town/v/std/blob");
508const TIME_WINDOW = 60 * 1000; // 1 minute
509510async function checkRateLimit() {
511const now = Date.now();
512const rateLimit = await blob.getJSON(RATE_LIMIT_KEY) || { count: 0, timestamp: now };
523}
524525async function translateText(text: string, targetLanguage: string, sourceLanguage: string): Promise<string> {
526const cacheKey = `${KEY}_translation_${sourceLanguage}_${targetLanguage}_${text}`;
527const cachedTranslation = await blob.getJSON(cacheKey);
solanaPayDemomain.tsx3 matches
19import { createRoot } from "https://esm.sh/react-dom/client";
2021function Home() {
22const [storeName, setStoreName] = useState("");
23const [description, setDescription] = useState("");
238}
239240function client() {
241createRoot(document.getElementById("root")).render(<Home />);
242}
243if (typeof document !== "undefined") { client(); }
244245export default async function server(request: Request): Promise<Response> {
246return new Response(
247`
Update_Wise_Old_Manmain.tsx1 match
1import { WOMClient } from "npm:@wise-old-man/utils";
23export default async function(interval: Interval) {
4const rawUsers = Deno.env.get("OSRS_USERS") ?? "";
5const users: string[] = rawUsers.split(",");
23}
2425function onfile(file: UnzipFile) {
26const { name } = file;
27file.ondata = (err, data, final) => {
37}
3839function ondone() {
40console.log(`${repo}: Found ${loc} lines of code.`);
41}
multilingualchatroommain.tsx9 matches
93};
9495function Banner({ message, isVisible, language }) {
96if (!isVisible) return null;
97return <div className="banner">{message[language] || message.en}</div>;
98}
99100function UserList({ users, t }) {
101return (
102<div className="user-list">
113}
114115function Sidebar({ users, language, handleLanguageChange, roomUrl, copyToClipboard, copied, t }) {
116return (
117<div className="sidebar">
149}
150151function TypingIndicator({ typingUsers, t }) {
152if (typingUsers.length === 0) return null;
153
164}
165166function App() {
167const [messages, setMessages] = useState([]);
168const [inputMessage, setInputMessage] = useState("");
490}
491492function client() {
493createRoot(document.getElementById("root")).render(<App />);
494}
495if (typeof document !== "undefined") { client(); }
496497export default async function server(request: Request): Promise<Response> {
498const url = new URL(request.url);
499const { blob } = await import("https://esm.town/v/std/blob");
508const TIME_WINDOW = 60 * 1000; // 1 minute
509510async function checkRateLimit() {
511const now = Date.now();
512const rateLimit = await blob.getJSON(RATE_LIMIT_KEY) || { count: 0, timestamp: now };
523}
524525async function translateText(text: string, targetLanguage: string, sourceLanguage: string): Promise<string> {
526const cacheKey = `${KEY}_translation_${sourceLanguage}_${targetLanguage}_${text}`;
527const cachedTranslation = await blob.getJSON(cacheKey);
MoonCatWalkmain.tsx6 matches
40}
4142function parseGoal(x: number, y: number, goalX: number, goalY: number) {
43const parsed: { x: number; y: number; animation: AnimationLabel } = {
44x: x,
92}
9394function VirtualPet({ spriteNum }: { spriteNum: number }) {
95const [petState, setPetState] = useState<PetState>({
96behavior: "idle",
173174useEffect(() => {
175function handleMouseMove(e) {
176const now = Date.now();
177if (now - mousePos.current.moveTime > 2000) {
202useEffect(() => {
203let ignore = false;
204function doTick() {
205if (ignore) return;
206tick();
229}
230231function client() {
232const root = document.getElementById("root");
233if (root) {
241}
242243export default async function server(req: Request): Promise<Response> {
244const pathSegment = new URL(req.url).pathname.split("/")[1];
245const spriteNum = pathSegment && /^\d+$/.test(pathSegment)
serveAudiomain.tsx1 match
1export default async function serveAudio(req: Request): Promise<Response> {
2const { blob } = await import("https://esm.town/v/std/blob");
3
RobotBackupCallGraphmain.tsx15 matches
2import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL?v=2";
34export default async function server(req: Request): Promise<Response> {
5// Handle GET requests
6if (req.method === "GET") {
288layout: {
289name: 'preset',
290positions: function(node) {
291return { x: 0, y: 0 }; // Initial positions, will be overwritten
292}
297});
298299// Custom layout function
300function customLayout() {
301const mainGraph = cy.elements().not('#isolated, #isolated > node');
302const isolatedGraph = cy.getElementById('isolated');
349350// Add event listeners for highlighting
351cy.on('mouseover', 'node', function(e) {
352const node = e.target;
353highlightNodeChildrenAndParents(node);
354});
355356cy.on('mouseout', 'node', function(e) {
357unhighlightAll();
358});
359360cy.on('click', 'node', function(e) {
361const node = e.target;
362if (node.hasClass('highlighted') || node.hasClass('parent-highlighted')) {
368});
369370function highlightNodeChildrenAndParents(node) {
371const children = node.outgoers();
372const parents = node.incomers();
376}
377378function unhighlightAll() {
379cy.elements().removeClass('highlighted');
380cy.elements().removeClass('parent-highlighted');
529let match;
530while ((match = callRegex.exec(line)) !== null) {
531const calledFunction = match[1].toLowerCase();
532relationships.get(caller).add(calledFunction);
533allNodes.add(calledFunction);
534}
535});
545546const edges = [];
547relationships.forEach((calledFunctions, file) => {
548calledFunctions.forEach(calledFunction => {
549edges.push({
550data: {
551source: file,
552target: calledFunction,
553},
554});
welcomingPinkAlligatormain.tsx9 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function debounce(func: Function, wait: number) {
7let timeout: number | undefined;
8return function executedFunction(...args: any[]) {
9const later = () => {
10clearTimeout(timeout);
16}
1718function App() {
19const [prompt, setPrompt] = useState("Generate a colorful gradient shader");
20const [code, setCode] = useState(`
79}, [code, debouncedRenderShader, retryCount]);
8081async function handleSubmit(e: React.FormEvent, shaderErrorMessage?: string) {
82if (e) e.preventDefault();
83setLoading(true);
149}
150151function client() {
152createRoot(document.getElementById("root")!).render(<App />);
153}
157}
158159function renderShader(canvas: HTMLCanvasElement, fragmentShaderSource: string, time: number) {
160const gl = canvas.getContext("webgl");
161if (!gl) {
171`;
172173function createShader(gl: WebGLRenderingContext, type: number, source: string) {
174const shader = gl.createShader(type);
175if (!shader) return null;
240}
241242function extractGLSLCode(text: string): string {
243const glslMatch = text.match(/```glsl\n([\s\S]*?)\n```/);
244return glslMatch
247}
248249export default async function server(req: Request): Promise<Response> {
250if (req.method === "POST") {
251const client = new Cerebras();
dailyDadJokemain.tsx1 match
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
34export async function dailyDadJoke() {
5let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6return email({