word-games-theme 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/wordgames/en/word-game-play.json +6 -43
- data/_includes/section/home2.html +2 -1
- data/_includes/word-game/word-game-generator-online.html +8 -5
- data/_includes/word-game/word-game-play.html +178 -55
- data/_includes/wordle-solver/wordle-solver.html +11 -0
- data/assets/css/game.css +307 -7
- data/assets/css/wordleSolver.css +11 -0
- data/assets/images/close.png +0 -0
- data/assets/images/copy.svg +1 -0
- data/assets/images/facebooks.svg +1 -0
- data/assets/images/twitters.svg +1 -0
- data/assets/images/whatsapp.svg +1 -0
- data/assets/js/confetti.js +130 -0
- data/assets/js/createWordle.js +39 -5
- data/assets/js/game.js +260 -31
- metadata +8 -2
data/assets/css/game.css
CHANGED
@@ -1,9 +1,19 @@
|
|
1
1
|
/* create wordle screen css */
|
2
2
|
.create-wordle{
|
3
|
-
box-shadow: 0 5px 15px
|
3
|
+
box-shadow: 0 5px 15px rgb(0 0 0 / 20%) ;
|
4
4
|
margin-bottom: 150px;
|
5
5
|
padding:8rem 0;
|
6
6
|
}
|
7
|
+
.word-generator-link{
|
8
|
+
font-size: 18px;
|
9
|
+
background: #f8f9fa;
|
10
|
+
padding: 8px 15px;
|
11
|
+
color:#404040;
|
12
|
+
box-shadow: 0 0 1px rgba(0,0,0,0.1);
|
13
|
+
border-radius: 4px;
|
14
|
+
margin: 0 25px;
|
15
|
+
border:1px solid rgba(0,0,0,.1)
|
16
|
+
}
|
7
17
|
.create-wordle .custom-word{
|
8
18
|
font-weight: 600;
|
9
19
|
text-transform: uppercase;
|
@@ -54,6 +64,11 @@
|
|
54
64
|
top: 60px !important;
|
55
65
|
}
|
56
66
|
|
67
|
+
.game{
|
68
|
+
width: 100%;
|
69
|
+
/* height: 100vh; */
|
70
|
+
}
|
71
|
+
|
57
72
|
/* wordle game play css */
|
58
73
|
.game .game-container .game-board{
|
59
74
|
width: 350px;
|
@@ -62,12 +77,16 @@
|
|
62
77
|
margin-top: 3px;
|
63
78
|
display: flex;
|
64
79
|
flex-wrap: wrap;
|
80
|
+
justify-content: center;
|
65
81
|
}
|
66
82
|
.game .game-container .game-board .tile{
|
67
|
-
|
68
|
-
|
83
|
+
display: flex;
|
84
|
+
justify-content: center;
|
85
|
+
align-items: center;
|
86
|
+
width: 60px;
|
87
|
+
height: 60px;
|
69
88
|
text-align: center;
|
70
|
-
border:2px solid #
|
89
|
+
border:2px solid #dee1e9;
|
71
90
|
border-radius: 5px;
|
72
91
|
color: #363535;
|
73
92
|
font-size: 28px;
|
@@ -75,6 +94,10 @@
|
|
75
94
|
margin: 3px;
|
76
95
|
max-width: 64px;
|
77
96
|
text-transform: uppercase;
|
97
|
+
transition: transform 240ms linear;
|
98
|
+
}
|
99
|
+
.popAni{
|
100
|
+
animation: popAni 495ms ease-in-out;
|
78
101
|
}
|
79
102
|
.game .game-container .game-keyboard{
|
80
103
|
display: flex;
|
@@ -87,7 +110,7 @@
|
|
87
110
|
flex-direction: row;
|
88
111
|
justify-content: center;
|
89
112
|
}
|
90
|
-
.game .game-container .
|
113
|
+
.game .game-container .key-btn {
|
91
114
|
align-items: center;
|
92
115
|
background-color: #edeff1;
|
93
116
|
border: 2px solid transparent;
|
@@ -98,9 +121,286 @@
|
|
98
121
|
font-size: 16px;
|
99
122
|
font-weight: 900;
|
100
123
|
justify-content: center;
|
101
|
-
margin:
|
124
|
+
margin: 2px;
|
102
125
|
min-height: 40px;
|
103
|
-
padding:
|
126
|
+
padding: 11px 18px;
|
104
127
|
text-decoration: inherit;
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
.alert-container{
|
132
|
+
font-size: 15px;
|
133
|
+
box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
|
134
|
+
position: fixed;
|
135
|
+
top: 160px;
|
136
|
+
left: 50%;
|
137
|
+
transform: translate(-50%, -50%);
|
138
|
+
width: 180px;
|
139
|
+
padding: 12px 0px;
|
140
|
+
text-align: center;
|
141
|
+
z-index: 9999999;
|
142
|
+
background: #000;
|
143
|
+
color:#fff;
|
144
|
+
border-radius: 4px;
|
145
|
+
}
|
146
|
+
.active-alert{
|
147
|
+
visibility: visible;
|
148
|
+
}
|
149
|
+
.tick {
|
150
|
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL7SURBVEhL7ZZdSBRRFMf/s+PWSrsUFGoUfi1ooWISFUQPvfRhH1hUL5agvogvaQ/hamBRbz0W2VNBQb2IgqJsGL2VVBK11UNpPkhGKmWK6wfu7kznzFxGx5lxZ+tN/MGdOefOzP3PnTn3noN11jySOLvnWamfniqGJGVovqpOQMVnHI9ENd8l7oTDe/zwSGfp7nPkHaPm0/qXWKD2kl7gERS1A+Uf5vVuZ1YXbg9KCAT2kWgjeaeoBbR+Z/gFupFQWhGNDuLCsKp3W3EW1kQ3HYRHfkhegd7pmkEoiVrMzPY7iXvE2YrfXyJEg3pHShTQsw9oDMcXthfuLfNDlq+RxQ/KWl/qFNIYN7WxbLAX9uIMhWu58P4D9TSNVSEcE06fmqM3WSAZ+DwbcCXnEk5sO7QyaNKpVeumGWtw9ZYE4E2bIGvlkrGFRZtyqxHKq8HQ3HfsfVOJmBIXVzUWEItn4OSnGeFrWGcspxXR0ZXolrQAmkgwlFeL4blRtAzdRVxJiKsGPhqzUNgGVmFJzRSWCVmSqZlvb8ipRCi3BtPxGYSG7qD3F+8hNqtHUncIy8DpH5tg0VvBeoTL7iHbl6XN9HqwDjfy6zCy8BPnI1edRXUsv9QqrEo/hGXAA+7fXIwjWw+gbXczmunTNmZX4uvcCFq/teHVVGQ1UR5zTFgGroMrJz0LbbtatMhlxhd/azNNKuoQXNbN4enEIqq2HyYrX+/QmY5H8XzyNYr8QSwqMVz+chsvJgeSiTI9KI88FraB/V7dV3aRjvepWdYyz3znxkz0T310I8qzrMfR9090dwn74Iqhk94pLDwTI/Njbj6vQOqhsbqEY8J+xky4lPZaTzdZqWYmhhfzMBSligqEt3qXGeflxPmUUxunuNQhUU6L0QHhW3DOPO1/gAr/KLzePioEuMzhYPNq15zhf9pJhUADorPv/q0QWA6XPrLEWYaTB2ctu9KHY6IDCbWLSp+k9Zc74eVwseehXAuJt0GJir1xirOUi7111jrAXwKK6K/PgrsYAAAAAElFTkSuQmCC) no-repeat;
|
151
|
+
height: 35px;
|
152
|
+
margin: 10px 0;
|
153
|
+
background-position: center;
|
154
|
+
}
|
155
|
+
.close-icon {
|
156
|
+
background: url(/assets/images/close.png) no-repeat;
|
157
|
+
height: 20px;
|
158
|
+
margin: 10px 0;
|
159
|
+
background-position: center;
|
160
|
+
background-size: contain;
|
161
|
+
}
|
162
|
+
[data-state="active"] {
|
163
|
+
border-color: hsl(200, 1%, 34%);
|
164
|
+
}
|
165
|
+
[data-state="correct-spot"] {
|
166
|
+
color:#fff !important;
|
167
|
+
background-color:#6aaa64 !important;
|
168
|
+
border: none !important;
|
169
|
+
}
|
170
|
+
[data-state="wrong-spot"] {
|
171
|
+
color:#fff !important;
|
172
|
+
background-color: #c9b458 !important;
|
173
|
+
border: none !important;
|
174
|
+
}
|
175
|
+
[data-state="wrong-word"] {
|
176
|
+
color:white !important;
|
177
|
+
background-color: #787c7e!important;
|
178
|
+
border: none !important;
|
179
|
+
}
|
180
|
+
.shake {
|
181
|
+
animation: shake 240ms ease-in-out;
|
182
|
+
}
|
183
|
+
.dance {
|
184
|
+
animation: dance 495ms ease-in-out;
|
185
|
+
}
|
186
|
+
.flip {
|
187
|
+
transform: rotateX(90deg);
|
188
|
+
}
|
189
|
+
.wordle-game-restart{
|
190
|
+
width: 120px;
|
191
|
+
margin: 0 auto;
|
192
|
+
background: #57ac57;
|
193
|
+
color: #fff;
|
194
|
+
display: block;
|
195
|
+
font-weight: 600;
|
196
|
+
padding: 10px;
|
197
|
+
border-radius: 5px;
|
198
|
+
font-size: 16px;
|
199
|
+
margin-bottom: 1rem;
|
200
|
+
text-align: center;
|
201
|
+
}
|
202
|
+
.wordle-game-restart:hover{
|
203
|
+
color:#fff !important;
|
204
|
+
text-decoration: none !important;
|
205
|
+
}
|
206
|
+
|
207
|
+
@keyframes shake {
|
208
|
+
10% {
|
209
|
+
transform: translateX(-5%);
|
210
|
+
}
|
211
|
+
|
212
|
+
30% {
|
213
|
+
transform: translateX(5%);
|
214
|
+
}
|
215
|
+
|
216
|
+
50% {
|
217
|
+
transform: translateX(-7.5%);
|
218
|
+
}
|
219
|
+
|
220
|
+
70% {
|
221
|
+
transform: translateX(7.5%);
|
222
|
+
}
|
223
|
+
|
224
|
+
90% {
|
225
|
+
transform: translateX(-5%);
|
226
|
+
}
|
227
|
+
|
228
|
+
100% {
|
229
|
+
transform: translateX(0);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
@keyframes dance {
|
234
|
+
20% {
|
235
|
+
transform: translateY(-50%)
|
236
|
+
}
|
237
|
+
|
238
|
+
40% {
|
239
|
+
transform: translateY(5%)
|
240
|
+
}
|
241
|
+
|
242
|
+
60% {
|
243
|
+
transform: translateY(-25%)
|
244
|
+
}
|
245
|
+
|
246
|
+
80% {
|
247
|
+
transform: translateY(2.5%)
|
248
|
+
}
|
249
|
+
|
250
|
+
90% {
|
251
|
+
transform: translateY(-5%)
|
252
|
+
}
|
253
|
+
|
254
|
+
100% {
|
255
|
+
transform: translateY(0%)
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
@keyframes popAni {
|
260
|
+
0% {
|
261
|
+
transform: scale(.8);
|
262
|
+
opacity: 0;
|
263
|
+
}
|
264
|
+
|
265
|
+
40% {
|
266
|
+
transform: scale(1.1);
|
267
|
+
opacity: 1;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
.alert-Container {
|
272
|
+
position: fixed;
|
273
|
+
top: 10vh;
|
274
|
+
left: 50vw;
|
275
|
+
transform: translateX(-50%);
|
276
|
+
z-index: 10;
|
277
|
+
display: flex;
|
278
|
+
flex-direction: column;
|
279
|
+
align-items: center;
|
280
|
+
}
|
281
|
+
|
282
|
+
|
283
|
+
#confetti-canvas{
|
284
|
+
width: 100%;
|
285
|
+
position: fixed;
|
286
|
+
top:0
|
287
|
+
}
|
288
|
+
|
289
|
+
.gameResult{
|
290
|
+
text-align: center;
|
291
|
+
width: 100%;
|
292
|
+
font-size: 18px;
|
293
|
+
font-weight: 900;
|
294
|
+
}
|
295
|
+
#result-guess-word{
|
296
|
+
background: #f8f9fa;
|
297
|
+
width: 100px;
|
298
|
+
text-align: center;
|
299
|
+
margin: 0 auto;
|
300
|
+
padding: 8px;
|
301
|
+
border-radius: 5px;
|
302
|
+
border: 1px dashed gray;
|
303
|
+
margin-top: 1rem;
|
304
|
+
font-size: 15px;
|
305
|
+
text-transform: uppercase;
|
306
|
+
font-weight: 600;
|
307
|
+
}
|
308
|
+
.wordle-game-button{
|
309
|
+
padding: 0px 15px;
|
310
|
+
color: #626568;
|
311
|
+
font-size: 14px;
|
312
|
+
background: #f5f7fb;
|
313
|
+
padding: 8px 5px;
|
314
|
+
border: none;
|
315
|
+
width: 100%;
|
316
|
+
/* font-weight: 700; */
|
317
|
+
border-radius: 7px;
|
318
|
+
display: flex;
|
319
|
+
text-decoration: none;
|
320
|
+
cursor: pointer;
|
321
|
+
justify-content: center;
|
322
|
+
align-items: center;
|
323
|
+
align-content: center;
|
324
|
+
margin: 6px 0px;
|
325
|
+
border: 1px solid rgba(0,0,0,0.1);
|
326
|
+
}
|
327
|
+
.wordle-game-button:hover{
|
328
|
+
text-decoration: none !important;
|
329
|
+
}
|
330
|
+
.social-sharing-icons{
|
331
|
+
display:flex;
|
332
|
+
justify-content: center;
|
333
|
+
}
|
334
|
+
.share-icon{
|
335
|
+
width: 50px;
|
336
|
+
height: 50px;
|
337
|
+
}
|
338
|
+
|
339
|
+
|
340
|
+
#wordle-examples {
|
341
|
+
border-top: 1px solid rgba(0,0,0,0.1);
|
342
|
+
border-bottom: 1px solid rgba(0,0,0,0.1);
|
343
|
+
padding: 1rem 0rem;
|
344
|
+
}
|
345
|
+
.wordle-game-spot {
|
346
|
+
padding: 20px;
|
347
|
+
border: 2px solid #3a3a3c;
|
348
|
+
margin: 2px;
|
349
|
+
display: inline-block;
|
350
|
+
line-height: 0;
|
351
|
+
font-weight: bold;
|
352
|
+
text-align: center;
|
353
|
+
font-size: 25px;
|
354
|
+
}
|
355
|
+
.wordle-game-absent {
|
356
|
+
background-color: #3a3a3c !important;
|
357
|
+
border-color: #3a3a3c !important;
|
358
|
+
color: #fff;
|
359
|
+
}
|
360
|
+
.wordle-game-present {
|
361
|
+
background-color: #b59f3b !important;
|
362
|
+
border-color: #b59f3b !important;
|
363
|
+
color: white;
|
364
|
+
}
|
365
|
+
.wordle-game-correct {
|
366
|
+
background-color: #538d4e !important;
|
367
|
+
border-color: #538d4e !important;
|
368
|
+
color: white;
|
369
|
+
}
|
370
|
+
.wordle-game-spot:before {
|
371
|
+
content: "\a0";
|
372
|
+
}
|
373
|
+
.wordle-game-spot[title]:before { content: attr(title); }
|
374
|
+
.wordle-game-row-active .wordle-game-spot {
|
375
|
+
border-color: #666;
|
376
|
+
}
|
377
|
+
@media (max-width: 768px) {
|
378
|
+
#create-wordle-form{
|
379
|
+
padding:0 10px;
|
380
|
+
}
|
381
|
+
.create-wordle .custom-word{
|
382
|
+
width: 100%;
|
383
|
+
}
|
384
|
+
#exampleModal,.wordletip{
|
385
|
+
padding:15px;
|
386
|
+
}
|
387
|
+
.game .game-container .key-btn{
|
388
|
+
margin:2px;
|
389
|
+
padding:15px 10px;
|
390
|
+
}
|
391
|
+
.game .game-container .game-keyboard{
|
392
|
+
margin-top: 3rem !important;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
|
396
|
+
/*
|
397
|
+
.wordl_ani{
|
398
|
+
animation: animated 3s ease-in-out infinite;
|
105
399
|
}
|
106
400
|
|
401
|
+
@keyframes animated {
|
402
|
+
100%{
|
403
|
+
transform: scale(1.03);
|
404
|
+
}
|
405
|
+
*/
|
406
|
+
/* } */
|
data/assets/css/wordleSolver.css
CHANGED
@@ -120,6 +120,17 @@
|
|
120
120
|
margin: 10px auto;
|
121
121
|
width: 75%;
|
122
122
|
}
|
123
|
+
.createWordleLink{
|
124
|
+
display: block;
|
125
|
+
box-shadow: 0 0 1px rgb(0 0 0 / 10%);
|
126
|
+
border: none;
|
127
|
+
padding: 10px 15px;
|
128
|
+
width: 100%;
|
129
|
+
background: rgb(118, 118, 118);
|
130
|
+
border-radius: 20px;
|
131
|
+
font-size: 15px;
|
132
|
+
margin-bottom: 10px;
|
133
|
+
}
|
123
134
|
@media (max-width: 768px) {
|
124
135
|
.allfiveletterswords,
|
125
136
|
#wordleWordCount {
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1020" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><defs id="SvgjsDefs1021"></defs><g id="SvgjsG1022"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M20,16V4H8V16H20M22,16A2,2 0 0,1 20,18H8C6.89,18 6,17.1 6,16V4C6,2.89 6.89,2 8,2H20A2,2 0 0,1 22,4V16M16,20V22H4A2,2 0 0,1 2,20V7H4V20H16Z" fill="#626568" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1044" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1050" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#4267b2"></circle><defs id="SvgjsDefs1045"></defs><g id="SvgjsG1046" transform="matrix(0.4652,0,0,0.4652,77.01128160400391,77.0111979598999)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1030" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1036" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#1da1f2"></circle><defs id="SvgjsDefs1031"></defs><g id="SvgjsG1032" transform="matrix(0.4652,0,0,0.4652,77.0111979598999,80.22)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1066" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1072" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#25d366"></circle><defs id="SvgjsDefs1067"></defs><g id="SvgjsG1068" transform="matrix(0.4652,0,0,0.4652,77.0112040802002,77.0112)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M12.04 2C6.58 2 2.13 6.45 2.13 11.91C2.13 13.66 2.59 15.36 3.45 16.86L2.05 22L7.3 20.62C8.75 21.41 10.38 21.83 12.04 21.83C17.5 21.83 21.95 17.38 21.95 11.92C21.95 9.27 20.92 6.78 19.05 4.91C17.18 3.03 14.69 2 12.04 2M12.05 3.67C14.25 3.67 16.31 4.53 17.87 6.09C19.42 7.65 20.28 9.72 20.28 11.92C20.28 16.46 16.58 20.15 12.04 20.15C10.56 20.15 9.11 19.76 7.85 19L7.55 18.83L4.43 19.65L5.26 16.61L5.06 16.29C4.24 15 3.8 13.47 3.8 11.91C3.81 7.37 7.5 3.67 12.05 3.67M8.53 7.33C8.37 7.33 8.1 7.39 7.87 7.64C7.65 7.89 7 8.5 7 9.71C7 10.93 7.89 12.1 8 12.27C8.14 12.44 9.76 14.94 12.25 16C12.84 16.27 13.3 16.42 13.66 16.53C14.25 16.72 14.79 16.69 15.22 16.63C15.7 16.56 16.68 16.03 16.89 15.45C17.1 14.87 17.1 14.38 17.04 14.27C16.97 14.17 16.81 14.11 16.56 14C16.31 13.86 15.09 13.26 14.87 13.18C14.64 13.1 14.5 13.06 14.31 13.3C14.15 13.55 13.67 14.11 13.53 14.27C13.38 14.44 13.24 14.46 13 14.34C12.74 14.21 11.94 13.95 11 13.11C10.26 12.45 9.77 11.64 9.62 11.39C9.5 11.15 9.61 11 9.73 10.89C9.84 10.78 10 10.6 10.1 10.45C10.23 10.31 10.27 10.2 10.35 10.04C10.43 9.87 10.39 9.73 10.33 9.61C10.27 9.5 9.77 8.26 9.56 7.77C9.36 7.29 9.16 7.35 9 7.34C8.86 7.34 8.7 7.33 8.53 7.33Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
var maxParticleCount = 150; //set max confetti count
|
2
|
+
var particleSpeed = 2; //set the particle animation speed
|
3
|
+
var startConfetti; //call to start confetti animation
|
4
|
+
var stopConfetti; //call to stop adding confetti
|
5
|
+
var toggleConfetti; //call to start or stop the confetti animation depending on whether it's already running
|
6
|
+
var removeConfetti; //call to stop the confetti animation and remove all confetti immediately
|
7
|
+
|
8
|
+
(function () {
|
9
|
+
startConfetti = startConfettiInner;
|
10
|
+
stopConfetti = stopConfettiInner;
|
11
|
+
toggleConfetti = toggleConfettiInner;
|
12
|
+
removeConfetti = removeConfettiInner;
|
13
|
+
var colors = ["DodgerBlue", "OliveDrab", "Gold", "Pink", "SlateBlue", "LightBlue", "Violet", "PaleGreen", "SteelBlue", "SandyBrown", "Chocolate", "Crimson"]
|
14
|
+
var streamingConfetti = false;
|
15
|
+
var animationTimer = null;
|
16
|
+
var particles = [];
|
17
|
+
var waveAngle = 0;
|
18
|
+
|
19
|
+
function resetParticle(particle, width, height) {
|
20
|
+
particle.color = colors[(Math.random() * colors.length) | 0];
|
21
|
+
particle.x = Math.random() * width;
|
22
|
+
particle.y = Math.random() * height - height;
|
23
|
+
particle.diameter = Math.random() * 10 + 5;
|
24
|
+
particle.tilt = Math.random() * 10 - 10;
|
25
|
+
particle.tiltAngleIncrement = Math.random() * 0.07 + 0.05;
|
26
|
+
particle.tiltAngle = 0;
|
27
|
+
return particle;
|
28
|
+
}
|
29
|
+
|
30
|
+
function startConfettiInner() {
|
31
|
+
var width = window.innerWidth;
|
32
|
+
var height = window.innerHeight;
|
33
|
+
window.requestAnimFrame = (function () {
|
34
|
+
return window.requestAnimationFrame ||
|
35
|
+
window.webkitRequestAnimationFrame ||
|
36
|
+
window.mozRequestAnimationFrame ||
|
37
|
+
window.oRequestAnimationFrame ||
|
38
|
+
window.msRequestAnimationFrame ||
|
39
|
+
function (callback) {
|
40
|
+
return window.setTimeout(callback, 16.6666667);
|
41
|
+
};
|
42
|
+
})();
|
43
|
+
var canvas = document.getElementById("confetti-canvas");
|
44
|
+
if (canvas === null) {
|
45
|
+
canvas = document.createElement("canvas");
|
46
|
+
canvas.setAttribute("id", "confetti-canvas");
|
47
|
+
canvas.setAttribute("style", "display:block;z-index:999999;pointer-events:none");
|
48
|
+
document.body.appendChild(canvas);
|
49
|
+
canvas.width = width;
|
50
|
+
canvas.height = height;
|
51
|
+
window.addEventListener("resize", function () {
|
52
|
+
canvas.width = window.innerWidth;
|
53
|
+
canvas.height = window.innerHeight;
|
54
|
+
}, true);
|
55
|
+
}
|
56
|
+
var context = canvas.getContext("2d");
|
57
|
+
while (particles.length < maxParticleCount)
|
58
|
+
particles.push(resetParticle({}, width, height));
|
59
|
+
streamingConfetti = true;
|
60
|
+
if (animationTimer === null) {
|
61
|
+
(function runAnimation() {
|
62
|
+
context.clearRect(0, 0, window.innerWidth, window.innerHeight);
|
63
|
+
if (particles.length === 0)
|
64
|
+
animationTimer = null;
|
65
|
+
else {
|
66
|
+
updateParticles();
|
67
|
+
drawParticles(context);
|
68
|
+
animationTimer = requestAnimFrame(runAnimation);
|
69
|
+
}
|
70
|
+
})();
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
function stopConfettiInner() {
|
75
|
+
streamingConfetti = false;
|
76
|
+
}
|
77
|
+
|
78
|
+
function removeConfettiInner() {
|
79
|
+
stopConfetti();
|
80
|
+
particles = [];
|
81
|
+
}
|
82
|
+
|
83
|
+
function toggleConfettiInner() {
|
84
|
+
if (streamingConfetti)
|
85
|
+
stopConfettiInner();
|
86
|
+
else
|
87
|
+
startConfettiInner();
|
88
|
+
}
|
89
|
+
|
90
|
+
function drawParticles(context) {
|
91
|
+
var particle;
|
92
|
+
var x;
|
93
|
+
for (var i = 0; i < particles.length; i++) {
|
94
|
+
particle = particles[i];
|
95
|
+
context.beginPath();
|
96
|
+
context.lineWidth = particle.diameter;
|
97
|
+
context.strokeStyle = particle.color;
|
98
|
+
x = particle.x + particle.tilt;
|
99
|
+
context.moveTo(x + particle.diameter / 2, particle.y);
|
100
|
+
context.lineTo(x, particle.y + particle.tilt + particle.diameter / 2);
|
101
|
+
context.stroke();
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
function updateParticles() {
|
106
|
+
var width = window.innerWidth;
|
107
|
+
var height = window.innerHeight;
|
108
|
+
var particle;
|
109
|
+
waveAngle += 0.01;
|
110
|
+
for (var i = 0; i < particles.length; i++) {
|
111
|
+
particle = particles[i];
|
112
|
+
if (!streamingConfetti && particle.y < -15)
|
113
|
+
particle.y = height + 100;
|
114
|
+
else {
|
115
|
+
particle.tiltAngle += particle.tiltAngleIncrement;
|
116
|
+
particle.x += Math.sin(waveAngle);
|
117
|
+
particle.y += (Math.cos(waveAngle) + particle.diameter + particleSpeed) * 0.5;
|
118
|
+
particle.tilt = Math.sin(particle.tiltAngle) * 15;
|
119
|
+
}
|
120
|
+
if (particle.x > width + 20 || particle.x < -20 || particle.y > height) {
|
121
|
+
if (streamingConfetti && particles.length <= maxParticleCount)
|
122
|
+
resetParticle(particle, width, height);
|
123
|
+
else {
|
124
|
+
particles.splice(i, 1);
|
125
|
+
i--;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
})();
|
data/assets/js/createWordle.js
CHANGED
@@ -6,13 +6,47 @@ let copy_btn = document.querySelector(".copy-btn")
|
|
6
6
|
let form = document.querySelector('#create-wordle-form')
|
7
7
|
let openPopup = document.querySelector(".open-popup")
|
8
8
|
|
9
|
+
const alertContainer = document.querySelector(".alert-container")
|
10
|
+
let errorMsg = document.querySelector("#errorMsg")
|
11
|
+
|
12
|
+
customWord.focus()
|
13
|
+
|
14
|
+
|
15
|
+
let dictionary
|
16
|
+
async function getData() {
|
17
|
+
const response = await fetch("/dictionary.json")
|
18
|
+
const data = await response.json()
|
19
|
+
dictionary = data
|
20
|
+
}
|
21
|
+
getData()
|
22
|
+
|
23
|
+
|
24
|
+
|
9
25
|
const createWordle = (e) => {
|
10
|
-
openPopup.click()
|
11
26
|
e.preventDefault();
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
27
|
+
|
28
|
+
if (customWord.value.length < 5) {
|
29
|
+
errorMsg.innerHTML = "Not enough letters"
|
30
|
+
alertContainer.classList.add("active-alert")
|
31
|
+
setTimeout(() => {
|
32
|
+
alertContainer.classList.remove("active-alert")
|
33
|
+
}, 1000)
|
34
|
+
}
|
35
|
+
if (customWord.value.length === 5 && !dictionary.includes(customWord.value.toLocaleLowerCase())) {
|
36
|
+
errorMsg.innerHTML = "Not a valid word"
|
37
|
+
alertContainer.classList.add("active-alert")
|
38
|
+
setTimeout(() => {
|
39
|
+
alertContainer.classList.remove("active-alert")
|
40
|
+
}, 1000)
|
41
|
+
} else {
|
42
|
+
if (customWord.value.length === 5) {
|
43
|
+
openPopup.click()
|
44
|
+
copy_btn.innerHTML = "Copy"
|
45
|
+
copy_btn.style.background = "dodgerblue"
|
46
|
+
wordleGameLink.setAttribute("href", `/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`)
|
47
|
+
wordleGameLink.innerHTML = `${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`
|
48
|
+
}
|
49
|
+
}
|
16
50
|
}
|
17
51
|
form.addEventListener('submit', createWordle);
|
18
52
|
|