-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (72 loc) · 3.15 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sudoku Checker</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/confetti-js/dist/index.min.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body class="bg-gray-800 text-white flex flex-col items-center justify-center min-h-screen relative">
<!-- Main container -->
<div class="bg-gray-900 p-10 rounded-lg shadow-lg text-center">
<h1 class="text-3xl font-bold mb-6 text-white">Sudoku Checker</h1>
<!-- Sudoku grid -->
<div class="bg-gray-200 rounded-lg p-4 flex justify-center items-center mb-6">
<div id="sudokuGrid" class="sudoku-grid"></div>
</div>
<!-- Update specific row -->
<div class="mb-6">
<label for="rowSelect" class="block mb-2 text-lg">Select Row:</label>
<select id="rowSelect" class="block w-full p-2 rounded border-gray-300 bg-white text-black cursor-pointer">
<option value="0">Row 1</option>
<option value="1">Row 2</option>
<option value="2">Row 3</option>
<option value="3">Row 4</option>
<option value="4">Row 5</option>
<option value="5">Row 6</option>
<option value="6">Row 7</option>
<option value="7">Row 8</option>
<option value="8">Row 9</option>
</select>
<input
id="rowInput"
class="block w-full p-2 mt-2 rounded border-gray-300 text-black text-center"
type="text"
placeholder="Enter 9 numbers only"
maxlength="9"
/>
<button onclick="updateRow()" class="block w-full mt-2 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded">
Update Row
</button>
</div>
<!-- Update all rows -->
<div class="mb-6">
<label for="allRowsInput" class="block mb-2 text-lg">Enter All Rows (81 Numbers), Beginning with Row 1:</label>
<input
id="allRowsInput"
class="block w-full p-2 rounded border-gray-300 text-black text-center"
type="text"
placeholder="Enter 81 numbers for the entire grid"
maxlength="81"
/>
<button onclick="updateAllRows()" class="block w-full mt-2 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded">
Update All Rows
</button>
</div>
<!-- Validate button -->
<button
onclick="validateSudoku()"
id="validateButton"
class="block w-full bg-orange-500 hover:bg-orange-600 text-white font-bold py-2 rounded mb-2"
>
Validate Sudoku
</button>
<div id="result" class="text-lg font-bold"></div>
</div>
<!-- Confetti container -->
<canvas id="confettiCanvas" class="absolute top-0 left-0 w-full h-full pointer-events-none"></canvas>
<script src="script.js"></script>
</body>
</html>