export default async function(req: Request): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crazy Wordle</title>
<link href="https://fonts.googleapis.com/css?family=Creepster|Permanent+Marker&display=swap" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #f093fb, #f5576c);
font-family: 'Permanent Marker', cursive;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
color: white;
}
#game-container {
text-align: center;
}
.row {
display: flex;
justify-content: center;
margin: 5px;
}
.cell {
width: 50px;
height: 50px;
margin: 2px;
border: 2px solid white;
display: flex;
justify-content: center;
align-items: center;
font-size: 2em;
font-family: 'Creepster', cursive;
background-color: black;
}
.green {
background-color: green;
}
.yellow {
background-color: yellow;
color: black;
}
.gray {
background-color: gray;
}
#message {
font-size: 1.5em;
margin-top: 20px;
}
</style>
</head>
<body>
<div id="game-container">
<h1>Crazy Wordle</h1>
<div id="board">
<div class="row">
<div class="cell" id="cell-0-0"></div>
<div class="cell" id="cell-0-1"></div>
<div class="cell" id="cell-0-2"></div>
<div class="cell" id="cell-0-3"></div>
<div class="cell" id="cell-0-4"></div>
</div>
<!-- Additional rows here... -->
</div>
<div id="message"></div>
<button onclick="restartGame()">Restart</button>
</div>
<script>
const word = "CRAZY"; // Change this to any word you'd like
let currentRow = 0;
let currentCol = 0;
document.addEventListener('keydown', handleKeydown);
function handleKeydown(event) {
const key = event.key.toUpperCase();
if (key >= 'A' && key <= 'Z' && currentCol < 5) {
document.getElementById(\`cell-\${currentRow}-\${currentCol}\`).innerText = key;
currentCol++;
} else if (key === 'BACKSPACE' && currentCol > 0) {
currentCol--;
document.getElementById(\`cell-\${currentRow}-\${currentCol}\`).innerText = '';
} else if (key === 'ENTER' && currentCol === 5) {
checkGuess();
}
}
function checkGuess() {