export default async function(req: Request): Promise<Response> {
const html = `
<html>
<head>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #282c34;
color: white;
font-family: Arial, sans-serif;
font-size: 2em;
text-align: center;
overflow: hidden; /* Ensures the cat doesn't overflow */
}
h1 {
color: #61dafb;
animation: colorChange 3s infinite;
}
@keyframes colorChange {
0% { color: #61dafb; }
50% { color: #ff6f61; }
100% { color: #61dafb; }
}
.cat {
position: absolute;
bottom: 0;
left: 0;
width: 100px;
animation: moveCat 10s linear infinite;
}
@keyframes moveCat {
0% { transform: translate(0, 0); }
25% { transform: translate(300px, 0); }
50% { transform: translate(300px, -300px); }
75% { transform: translate(0, -300px); }
100% { transform: translate(0, 0); }
}
</style>
</head>
<body>
<h1>Hello, world!</h1>
<img class="cat" src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" alt="Cat"/>
</body>
</html>
`;
return new Response(html, { headers: { "Content-Type": "text/html" } });
}