-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathword_guesser.html
50 lines (50 loc) · 3.88 KB
/
word_guesser.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
<!DOCTYPE html>
<html>
<head>
<title>Word Guesser</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="word_guesser_favicon.png">
<!-- Using Tailwind CSS. -->
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
<script type="text/javascript" src="./word_list.js"></script>
<script type="text/javascript" src="./word_guesser_functions.js"></script>
</head>
<body class="text-center" onload="runTryOnEnter()">
<header>
<h1 id="word_logo" class="block text-7xl my-5 font-bold" onclick="location.reload()">WORD GUESSER</h1>
<span id="main_text_output" class="block my-5 w-full sm:w-1/2 md:w-1/3 m-auto text-2xl font-semibold shadow-md">GUESS THE WORD IN 7 TRIES OR LESS</span>
<div id="guess_game_over" class="m-auto p-2">
<span id="guess_game_over_label" class="block m-2 font-bold text-2xl"></span>
<span id="guess_game_the_word_was" class="block mb-5 font-bold text-2xl"></span>
<button id="word_guess_rules" onclick="startNewGame()" class="border p-2 rounded-xl bg-green-600 text-white font-bold mb-5 shadow-xl text-xl">NEW GAME</button>
</div>
</header>
<main onload="startNewGame()">
<div id="word_guess_input" class="mb-5 w-full">
<div class="mb-5 w-full md:w-10/12 xl:w-6/12 2xl:w-6/12 m-auto shadow-xl rounded-xl">
<input class="inline my-4 mx-2 w-20 h-20 sm:w-24 sm:h-24 md:w-30 md:h-30 2xl:w-32 2xl:h-32 text-7xl uppercase text-center rounded-xl border-4 font-semibold" id="field_1" type="text" maxlength="1" onkeyup="nextInput('field_2')" autofocus>
<input class="inline my-4 mx-2 w-20 h-20 sm:w-24 sm:h-24 md:w-30 md:h-30 2xl:w-32 2xl:h-32 text-7xl uppercase text-center rounded-xl border-4 font-semibold" id="field_2" type="text" maxlength="1" onkeyup="nextInput('field_3')">
<input class="inline my-4 mx-2 w-20 h-20 sm:w-24 sm:h-24 md:w-30 md:h-30 2xl:w-32 2xl:h-32 text-7xl uppercase text-center rounded-xl border-4 font-semibold" id="field_3" type="text" maxlength="1" onkeyup="nextInput('field_4')">
<input class="inline my-4 mx-2 w-20 h-20 sm:w-24 sm:h-24 md:w-30 md:h-30 2xl:w-32 2xl:h-32 text-7xl uppercase text-center rounded-xl border-4 font-semibold" id="field_4" type="text" maxlength="1" onkeyup="nextInput('field_5')">
<input class="inline my-4 mx-2 w-20 h-20 sm:w-24 sm:h-24 md:w-30 md:h-30 2xl:w-32 2xl:h-32 text-7xl uppercase text-center rounded-xl border-4 font-semibold" id="field_5" type="text" maxlength="1" onkeyup="nextInput('field_1')">
</div>
</div>
<button id="word_guess_try" class="hidden" onclick="checkTheWord()"></button>
<div id="word_results" class="mb-5 py-2 w-full md:w-10/12 xl:w-6/12 2xl:w-6/12 m-auto shadow-xl rounded-xl"></div>
</main>
<footer>
<button id="word_guess_rules" class="border p-2 rounded-xl bg-green-600 text-white font-bold mb-5 mt-5 shadow-xl text-xl" onclick="displayRules()">RULES</button>
<div id="rules_section" style="display:none;">
<ul class="block shadow w-1/3 m-auto p-2">
<li>Guess the word in 7 tries or less.</li>
<li>Wrong guesses give clues about the correct word.</li>
<li>Letters that are in the right place, will turn green.</li>
<li>Letters that are in the word, but are in the wrong place, will turn yellow.</li>
<li>Letters that are not present in the word, will turn grey.</li>
</ul>
</div>
</footer>
</body>
</html>