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
47
48
49
50
51
52
53
54
55
56
// This val will respond with an HTML page saying "Hello, world!" with fun CSS.
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Permanent+Marker&display=swap');
body {
font-family: 'Caveat', cursive;
background: linear-gradient(45deg, #ff6ec4, #7873f5);
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
padding: 0;
color: white;
overflow: hidden;
}
h1 {
font-family: 'Permanent Marker', cursive;
font-size: 5rem;
text-shadow: 0 0 10px rgba(0,0,0,0.3);
animation: neon 1.5s infinite alternate;
}
@keyframes neon {
from {
text-shadow: 0 0 10px rgba(0,0,0,0.3), 0 0 20px rgba(0,0,0,0.3), 0 0 30px rgba(0,0,0,0.3), 0 0 40px #ff6ec4, 0 0 70px #ff6ec4, 0 0 80px #ff6ec4, 0 0 100px #ff6ec4, 0 0 150px #ff6ec4;
}
to {
text-shadow: 0 0 5px rgba(0,0,0,0.3), 0 0 10px rgba(0,0,0,0.3), 0 0 15px rgba(0,0,0,0.3), 0 0 20px #7873f5, 0 0 35px #7873f5, 0 0 40px #7873f5, 0 0 50px #7873f5, 0 0 75px #7873f5;
}
}
</style>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
`;
// Respond with HTML content
return new Response(htmlContent, {
headers: {
"Content-Type": "text/html",
},
});
}