1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** @jsxImportSource https://esm.sh/preact */
import { render } from "npm:preact-render-to-string";
export default async function(req: Request) {
return new Response(
render(
<html>
<head>
<title>Year Input</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 flex items-center justify-center h-screen">
<main class="bg-white p-10 rounded-lg shadow-xl max-w-md mx-auto">
<h1 class="text-3xl font-bold text-center mb-6">Year Input Form</h1>
<p class="text-center mb-6 text-gray-600">
Please input a year to learn what has been invented and disproven since you graduated.
</p>
<form>
<div class="mb-5">
<label for="year" class="block text-sm font-medium text-gray-700">Year</label>
<input
type="number"
id="year"
name="year"
placeholder="e.g., 2023"
class="mt-2 block w-full px-4 py-2 rounded-md border border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
/>
</div>
<button
type="submit"
class="w-full bg-gradient-to-r from-green-400 to-blue-500 text-white py-3 rounded-md text-lg font-semibold shadow-md hover:bg-green-400 focus:outline-none focus:ring-2 focus:ring-blue-300 transition duration-300"
>
Submit
</button>
</form>
</main>
</body>
</html>,
),
{
headers: {
"Content-Type": "text/html; charset=utf-8",
},
},
);
}