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 val renders a fully functioning Wordle game in HTML with unique and fun CSS styles.
function generateHTML() {
return `
<!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>
<style>
@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');
body {
font-family: 'Pacifico', cursive;
background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
animation: gradient 5s infinite;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
color: #fff;
}
@keyframes gradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.container {
display: flex;
flex-direction: column;
align-items: center;
}
.row {
display: flex;
margin-bottom: 10px;
}
.tile {
width: 40px;
height: 40px;
background: #222;
margin: 2px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
color: #fff;
border: 2px solid #333;
}
.correct {
background: #00ff00;
animation: pulse 1s infinite;
}
.present {
background: #ffff00;
}
.absent {
background: #333;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
input {
background: none;
border: 2px solid #fff;
padding: 10px;
color: #fff;
font-size: 1em;
}
</style>
</head>
<body>
<div class="container">
<div id="board"></div>
<input type="text" id="guessInput" maxlength="5" placeholder="Type your guess">
<button onclick="submitGuess()">Submit</button>
</div>
<script>
const solution = 'magic'; // Change this to any 5 letter word
let currentRow = 0;
function createBoard() {
const board = document.getElementById('board');
for (let i = 0; i < 6; i++) {
const row = document.createElement('div');
row.className = 'row';
for (let j = 0; j < 5; j++) {
const tile = document.createElement('div');
tile.className = 'tile';
row.appendChild(tile);
}
board.appendChild(row);
}
}
function submitGuess() {
const guessInput = document.getElementById('guessInput');
const guess = guessInput.value.toLowerCase();