whackaghostmain.tsx12 matches
44* HomeButton component - Renders a button to return to the home screen
45* @param {Object} props - Component props
46* @param {Function} props.onClick - Function to handle button click
47*/
48function HomeButton({ onClick }) {
49return (
50<button className="home-button" onClick={onClick}>
57* SpookyMessage component - Displays a game over message with a ghost animation
58* @param {Object} props - Component props
59* @param {Function} props.onHomeClick - Function to handle home button click
60* @param {boolean} props.isTimeOut - Whether the game ended due to timeout
61* @param {number} props.score - The player's final score
63* @param {boolean} props.isWin - Whether the player has won the game
64*/
65function SpookyMessage({ onHomeClick, isTimeOut, score, isTooManyWrongClicks, isWin }) {
66console.log("SpookyMessage rendered. isWin:", isWin, "score:", score);
67return (
83* GameDescription component - Displays game instructions and rules
84*/
85function GameDescription() {
86return (
87<div className="game-description">
109* Main App component for the Whack-a-Ghost game
110*/
111function App() {
112const [score, setScore] = useState(0);
113const [activeGhost, setActiveGhost] = useState(-1);
314315/**
316* Client-side rendering function
317*/
318export function client() {
319const rootElement = document.getElementById("root");
320if (rootElement) {
328329/**
330* Server-side rendering function
331* @param {Request} request - The incoming request object
332* @returns {Promise<Response>} The response object with the HTML content
333*/
334export default async function server(request: Request): Promise<Response> {
335return new Response(
336`
350import { client } from "${import.meta.url}";
351window.addEventListener("load", () => {
352if (typeof client === "function") {
353client();
354} else {
355console.error("Client function not found");
356}
357});
10import { html } from "https://esm.town/v/stevekrouse/html";
1112export default async function(req: Request) {
13let handler = createStaticHandler(routes);
14let context = await handler.query(req);
runescapeWoodCuttingmain.tsx4 matches
9};
1011function LoginScreen({ onLogin }) {
12const [name, setName] = useState("");
1336}
3738function App() {
39const [playerName, setPlayerName] = useState("");
40const [skill, setSkill] = useState("woodcutting");
107}
108109function client() {
110createRoot(document.getElementById("root")).render(<App />);
111}
115}
116117export default async function server(request: Request): Promise<Response> {
118const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
119const SCHEMA_VERSION = 2;
denoGameHTMLmain.tsx9 matches
27};
2829function setup() {
30createCanvas(800, 300);
31resetGame();
32}
3334function resetGame() {
35dino = new Dino();
36obstacles = [];
41}
4243function draw() {
44if (isGameOver) {
45showGameOver();
94}
9596function keyPressed() {
97if (keyCode === 32) {
98if (isGameOver) {
107}
108109function gameOver() {
110isGameOver = true;
111let name = prompt("Enter your name (max 16 characters, no spaces):");
113scoreboard.push({ name, score });
114115// Call the function to update the scoreboard on the Val Town API
116updateScoreboard(name, score);
117}
118119function updateScoreboard(name, score) {
120const apiUrl =
121"https://api.val.town/v1/run/rodrigotello.updateDinoScoreboard";
147}
148149function showGameOver() {
150background(255);
151textAlign(CENTER);
176}
177178function showGamePaused() {
179background(255);
180textAlign(CENTER);
smallAndCuteSnakeGamemain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [count, setCount] = useState(0);
755}
5657function client() {
58createRoot(document.getElementById("root")).render(<App />);
59}
63}
6465export default async function server(request: Request): Promise<Response> {
66return new Response(`
67<!DOCTYPE html>
mortgageDeductionCalculatormain.tsx5 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function formatNumber(num: number): string {
6return num.toLocaleString("no-NO", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
7}
89function QuestionMarkIcon() {
10return (
11<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" className="question-mark-icon">
16}
1718function App() {
19const [mortgage, setMortgage] = useState<number | undefined>(undefined);
20const [rentPercentage, setRentPercentage] = useState<number | undefined>(undefined);
197}
198199function client() {
200createRoot(document.getElementById("root")).render(<App />);
201}
202if (typeof document !== "undefined") { client(); }
203204export default async function server(request: Request): Promise<Response> {
205return new Response(
206`
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [items, setItems] = useState([]);
7const [newItem, setNewItem] = useState("");
75}
7677function client() {
78createRoot(document.getElementById("root")).render(<App />);
79}
83}
8485export default async function server(request: Request): Promise<Response> {
86const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
87const SCHEMA_VERSION = 1;
createFlashcardsValmain.tsx3 matches
9cherry,a small round stone fruit with red skin`;
1011function App() {
12const [flashcards, setFlashcards] = useState([]);
13const [currentCard, setCurrentCard] = useState(null);
95}
9697function client() {
98createRoot(document.getElementById("root")).render(<App />);
99}
103}
104105export default async function server(request: Request): Promise<Response> {
106const url = new URL(request.url);
107
browserbasePuppeteerExamplemain.tsx2 matches
2import puppeteer from "npm:puppeteer-core";
34async function sendPDF() {
5console.log("Initiating pdf sender");
6const browser = await puppeteer.connect({
28}
2930export default async function() {
31console.log("RUnning");
32await sendPDF();
generateDailyTwitterEmailmain.tsx3 matches
1import { email } from "https://esm.town/v/std/email";
23async function fetchTweets(listId: string): Promise<any[]> {
4const url = `https://news.ycombinator.com/`;
5const response = await fetch(url);
17}
1819function formatTweetsForEmail(tweets: any[]): string {
20return tweets.map((tweet, index) => `
21${index + 1}. @${tweet.username} (${tweet.likes} likes)
25}
2627export default async function(interval: Interval) {
28const listId = "1359390628841480192";
29const tweets = await fetchTweets(listId);