/** @jsxImportSource https://esm.sh/react@18.2.0 */ import { createRoot } from "https://esm.sh/react-dom@18.2.0/client"; import React, { useState } from "https://esm.sh/react@18.2.0";
const NO_PHRASES = [ "No π", "Pretty please? π₯Ί", "But we'd be so cute together! π", "One more chance? π", "Don't break my heart! π", "What about a maybe? π€", "Last try! π", ];
function App() { const [noClicks, setNoClicks] = useState(0); const [isValentine, setIsValentine] = useState(false); const yesButtonSize = (noClicks * 20) + 16;
const handleNo = () => { setNoClicks(prev => prev + 1); };
const handleYes = () => { setIsValentine(true); };
return ( <div style={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", fontFamily: "Arial, sans-serif", textAlign: "center", }} > {!isValentine ? ( <>
function client() { createRoot(document.getElementById("root")).render(); } if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise {
return new Response(
<html> <head> <title>For Youπ</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { margin: 0; font-family: Arial, sans-serif; } </style> </head> <body> <div id="root"></div> <script src="https://esm.town/v/std/catch"></script> <script type="module" src="${import.meta.url}"></script> </body> </html> ,
{
headers: { "content-type": "text/html" },
},
);
}