-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathindex.html
155 lines (146 loc) · 6.77 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Squirdle</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Telex" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="scripts/game.js" type="module"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h2>Squirdle</h2>
<h3>A Pokémon Wordle-like by <a href="https://www.fireblend.com">Fireblend</a></h3>
<div id="news">
<p style="font-size: 15px;">
<b>20/11/22:</b> Gen 9 Pokémon have been added!
<br>- Optional for now, use gen selector below to include.
<br>- New Pkmn will be added to the Daily pool on Dec 10th.
<br><button onclick="getElementById('news').style.display='none'">Hide</button></p></div>
<p>I'm thinking of a Pokémon. Guess which! You have <span id="attempts"></span> guesses.
<span class="tooltip">
Emoji Key<span class="tooltiptext">🟩: Correct guess<br>🟥: Incorrect Guess<br>🟨: Type in wrong position<br>🔼: Guessed too low<br>🔽: Guessed too high</span>
</span><br><a href="filters.html">Advanced filters guide</a>
</p>
<div id="guesses" class="guesses" style="display: none;">
<div class="row" id="hinttitles">
<div class='column'>
<p class="hint">Gen</p>
</div>
<div class='column'>
<p class="hint">Type 1</p>
</div>
<div class='column'>
<p class="hint">Type 2</p>
</div>
<div class='column'>
<p class="hint">Height</p>
</div>
<div class='column'>
<p class="hint">Weight</p>
</div>
</div>
</div>
<br>
<p id="error" style="display: none;">
Pokémon not found!
</p>
<form id="guessform" autocomplete="off" onsubmit="return false;">
<div class="autocomplete">
<input class="guess_input" id="guess" type="text" name="guess" placeholder="Who's that Pokémon?">
</div>
<input id="guess_submit" class="guess_input" type="submit" value="Submit">
<br><a class="type-block hintbtn" id="toggleinfo" href="#" title="Show Pokémon info in autocomplete entries">📋 Pokémon Info ON</a>
</form>
<div id="results" style="display: none;">
<span id="won" style="display: none;">You won!</span>
<span id="lost" style="display: none;">You lost!</span>
<span>The secret Pokémon was <b><span id="secretpoke"></span></b>!</span><br>
<a id="share_lnk" class="togglec" href="#">📄 Share</a>
<a id="share_with_names_lnk" class="togglec" href="#">👀 Share w/names</a>
</div>
<br>
<div id="type_Normal" class="type-block" style="background-color: rgba(177, 177, 177);">Normal</div>
<div id="type_Fire" class="type-block" style="background-color: rgb(255, 97, 6);">Fire</div>
<div id="type_Water" class="type-block" style="background-color: rgb(57, 159, 255);">Water</div>
<div id="type_Grass" class="type-block" style="background-color: rgb(32, 255, 11);">Grass</div>
<div id="type_Electric" class="type-block" style="background-color: rgb(192, 196, 0);">Electric</div>
<div id="type_Ice" class="type-block" style="background-color: rgb(80, 243, 255);">Ice</div>
<br>
<div id="type_Fighting" class="type-block" style="background-color: rgba(230, 0, 0);">Fighting</div>
<div id="type_Poison" class="type-block" style="background-color: rgb(143, 0, 187);">Poison</div>
<div id="type_Ground" class="type-block" style="background-color: rgb(170, 130, 0);">Ground</div>
<div id="type_Flying" class="type-block" style="background-color: rgb(235, 81, 255);">Flying</div>
<div id="type_Psychic" class="type-block" style="background-color: rgb(255, 46, 210);">Psychic</div>
<div id="type_Bug" class="type-block" style="background-color: rgb(156, 199, 0);">Bug</div>
<br>
<div id="type_Rock" class="type-block" style="background-color: rgb(129, 84, 0);">Rock</div>
<div id="type_Ghost" class="type-block" style="background-color: rgb(68, 0, 255);">Ghost</div>
<div id="type_Dark" class="type-block" style="background-color: rgb(131, 107, 0);">Dark</div>
<div id="type_Dragon" class="type-block" style="background-color: rgb(119, 0, 255);">Dragon</div>
<div id="type_Steel" class="type-block" style="background-color: rgb(122, 109, 129);">Steel</div>
<div id="type_Fairy" class="type-block" style="background-color: rgb(255, 140, 230);">Fairy</div>
<div id="type_" class="type-block" style="background-color: rgb(255, 171, 115);">Single-Type</div>
<br><br>
<label for="mingen">Guess Pkmn from gen</label>
<input class="mg_input" type="number" id="mingen" name="mingen" min="1" max="9" value="" oninput="validity.valid||(value='');">
<label for="maxgen">to</label>
<input class="mg_input" type="number" id="maxgen" name="maxgen" min="1" max="9" value="" oninput="validity.valid||(value='');"><br>
<a id="new_game_lnk" class="togglec" href="#">▶️ New Game</a><br>
<br><a href="daily.html">Try Squirdle Daily!</a>
<br><br>Pokémon names:
<a id="lang_en_lnk" href="#">🇺🇸</a> |
<a id="lang_ko_lnk" href="#">🇰🇷</a> |
<a id="lang_ja_lnk" href="#">🇯🇵</a> |
<a id="lang_fr_lnk" href="#">🇫🇷</a> |
<a id="lang_de_lnk" href="#">🇩🇪</a>
<br>Issues? <a href="cacheclear.html">Clear your cache!</a>
<script type="module">
import {getCookie} from "./scripts/utils.js";
import {setLanguage} from "./scripts/i18n.js";
import {handleGuess, toggleHints, newGame, copyCurrentDay, handleLoad} from "./scripts/game.js";
document.addEventListener('DOMContentLoaded', (event) => {
$.getJSON("data/pokedex.json", function (json) {
pokedex = json
let lang = getCookie('lang', false)
setLanguage(lang, false)
});
})
document.querySelector('#guess_submit').addEventListener('click', () => {
handleGuess(false)
});
document.querySelector('#toggleinfo').addEventListener('click', () => {
toggleHints(false)
});
document.querySelector('#new_game_lnk').addEventListener('click', () => {
newGame(false)
});
document.querySelector('#share_lnk').addEventListener('click', () => {
copyCurrentDay(-1, false)
});
document.querySelector('#share_with_names_lnk').addEventListener('click', () => {
copyCurrentDay(-1, true)
});
document.querySelector('#lang_en_lnk').addEventListener('click', () => {
setLanguage('en', false)
});
document.querySelector('#lang_ko_lnk').addEventListener('click', () => {
setLanguage('ko', false)
});
document.querySelector('#lang_ja_lnk').addEventListener('click', () => {
setLanguage('ja', false)
});
document.querySelector('#lang_fr_lnk').addEventListener('click', () => {
setLanguage('fr', false)
});
document.querySelector('#lang_de_lnk').addEventListener('click', () => {
setLanguage('de', false)
});
</script>
</body>
</html>
</body>
</html>