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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// This script will generate a simple Wordle-like game in HTML with fun and weird CSS.
// It handles basic word validation and checks the status of the current guess.
// For simplicity, it will use a pre-defined secret word.
export default async function wordle(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>Weird Wordle</title>
<style>
body {
background: linear-gradient(45deg, #ff6ec4, #7873f5);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: 'Comic Sans MS', cursive, sans-serif;
color: #fff;
text-shadow: 2px 2px 4px #000;
}
.wordle-container {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 10px;
width: 300px;
}
.wordle-cell {
background: rgba(255, 255, 255, 0.2);
border: 2px solid #fff;
padding: 20px;
text-align: center;
font-size: 24px;
font-weight: bold;
transition: background 0.3s;
}
.correct {
background: rgba(0, 255, 0, 0.5);
}
.misplaced {
background: rgba(255, 255, 0, 0.5);
}
.incorrect {
background: rgba(255, 0, 0, 0.5);
}
input[type="text"] {
margin-top: 20px;
padding: 10px;
border-radius: 8px;
border: 2px solid #fff;
font-size: 18px;
outline: none;
width: 150px;
}
button {
margin-top: 10px;
padding: 10px 20px;
border-radius: 8px;
border: none;
background: #ff6ec4;
color: #fff;
font-size: 18px;
cursor: pointer;
transition: background 0.3s;
}
button:hover {
background: #7873f5;
}
</style>
</head>
<body>
<h1>Weird Wordle</h1>
<div class="wordle-container" id="wordle-container">
<div class="wordle-cell"></div>
<div class="wordle-cell"></div>
<div class="wordle-cell"></div>
<div class="wordle-cell"></div>
<div class="wordle-cell"></div>
</div>
<input type="text" id="guessInput" maxlength="5">
<button onclick="submitGuess()">Submit</button>
<script>
const secretWord = "CRAZY"; // Hardcoded secret word for simplicity
const guesses = [];
function submitGuess() {
const guessInput = document.getElementById('guessInput');
const guess = guessInput.value.toUpperCase();
if (guess.length === 5 && /^[A-Z]+$/.test(guess)) {
guesses.push(guess);
updateWordleContainer(guess);
guessInput.value = '';
} else {
alert('Please enter a valid 5-letter word.');
}
}