word-games-theme 0.6.7 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/wordle-solver/wordle-solver.html +45 -28
- data/assets/css/wordleSolver.css +8 -0
- data/assets/js/wordleSolver.js +59 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15f1e58caabfb91fab765215a3eeb52620b74cf3d3c6881c1e641a46d3c83d5c
|
4
|
+
data.tar.gz: c743df6174042db5daeece5026be01d13352f50069346d45047dbb93729c4b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d653de85ce68e41a12b2a0ff1112ea0b7058a4b4ecb4c9e625021b03fa1737cee7ac3dd0581f3f2615c782dfe03b4ea286e5e34a664e84ea1b800f8ad94e65e
|
7
|
+
data.tar.gz: 430bebe6104c3bb07cfd90268730daa28e00889448f2800f0a9714ebba9d4fa4c999b3a66c1489adce121c23d71c6db38fdce8ccf8e1b5a8648c4d68255add71
|
@@ -2,23 +2,28 @@
|
|
2
2
|
<div class="row">
|
3
3
|
<div class="col-md-10 mx-auto ws">
|
4
4
|
<div style="font-size: 15px;" class="alert errMessage" role="alert"></div>
|
5
|
-
|
6
5
|
<form name="verify">
|
7
6
|
<div class="form-group">
|
7
|
+
|
8
8
|
<label for="greenLetters" class="my-1 p-0 wordleSolver-label">Enter green letters at correct
|
9
9
|
position</label>
|
10
10
|
<div class="col-md-6 p-0">
|
11
11
|
<div class="d-flex">
|
12
12
|
<input data-id="0" type="text" autocomplete="off" tabIndex="0"
|
13
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
13
|
+
class="wordleSolver-field greenLetters greenWithIndex form-control px-5" maxlength="1"
|
14
|
+
id="greenLetters">
|
14
15
|
<input data-id="1" type="text" autocomplete="off" tabIndex="1"
|
15
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
16
|
+
class="wordleSolver-field greenLetters greenWithIndex form-control px-5" maxlength="1"
|
17
|
+
id="greenLetters">
|
16
18
|
<input data-id="2" type="text" autocomplete="off" tabIndex="2"
|
17
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
19
|
+
class="wordleSolver-field greenLetters greenWithIndex form-control px-5" maxlength="1"
|
20
|
+
id="greenLetters">
|
18
21
|
<input data-id="3" type="text" autocomplete="off" tabIndex="3"
|
19
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
22
|
+
class="wordleSolver-field greenLetters greenWithIndex form-control px-5" maxlength="1"
|
23
|
+
id="greenLetters">
|
20
24
|
<input data-id="4" type="text" autocomplete="off" tabIndex="4"
|
21
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
25
|
+
class="wordleSolver-field greenLetters greenWithIndex form-control px-5" maxlength="1"
|
26
|
+
id="greenLetters">
|
22
27
|
</div>
|
23
28
|
</div>
|
24
29
|
</div>
|
@@ -27,48 +32,57 @@
|
|
27
32
|
<div class="col-md-6 p-0">
|
28
33
|
<div class="d-flex">
|
29
34
|
<input type="text" autocomplete="off" tabIndex="1"
|
30
|
-
class="wordleSolver-field form-control px-5" maxlength="1"
|
31
|
-
tabIndex="5">
|
32
|
-
<input type="text" autocomplete="off"
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<input type="text" autocomplete="off"
|
39
|
-
|
35
|
+
class="wordleSolver-field yellowLetters form-control px-5" maxlength="1"
|
36
|
+
id="yellowLetters" tabIndex="5">
|
37
|
+
<input type="text" autocomplete="off"
|
38
|
+
class="wordleSolver-field yellowLetters form-control px-5" maxlength="1"
|
39
|
+
id="yellowLetters" tabIndex="6">
|
40
|
+
<input type="text" autocomplete="off"
|
41
|
+
class="wordleSolver-field yellowLetters form-control px-5" maxlength="1"
|
42
|
+
id="yellowLetters" tabIndex="7">
|
43
|
+
<input type="text" autocomplete="off"
|
44
|
+
class="wordleSolver-field yellowLetters form-control px-5" maxlength="1"
|
45
|
+
id="yellowLetters" tabIndex="8">
|
46
|
+
<input type="text" autocomplete="off"
|
47
|
+
class="wordleSolver-field yellowLetters form-control px-5" maxlength="1"
|
48
|
+
id="yellowLetters" tabIndex="9">
|
40
49
|
</div>
|
41
50
|
</div>
|
42
51
|
</div>
|
43
52
|
<div class="form-group">
|
44
53
|
<label for="greyLetters" class="my-1 p-0 wordleSolver-label">Enter letters in grey below</label>
|
45
|
-
<div class="col-md-6 p-0">
|
54
|
+
<div class="col-md-6 p-0 wrapper">
|
46
55
|
<div class="d-flex">
|
47
|
-
<input type="text" class="wordleSolver-field form-control px-5" maxlength="1"
|
56
|
+
<input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
|
48
57
|
id="greyLetters" value="" autocomplete="off" tabIndex="10">
|
49
|
-
<input type="text" class="wordleSolver-field form-control px-5" maxlength="1"
|
58
|
+
<input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
|
50
59
|
id="greyLetters" value="" autocomplete="off" tabIndex="11">
|
51
|
-
<input type="text" class="wordleSolver-field form-control px-5" maxlength="1"
|
60
|
+
<input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
|
52
61
|
id="greyLetters" value="" autocomplete="off" tabIndex="12">
|
53
|
-
<input type="text" class="wordleSolver-field form-control px-5" maxlength="1"
|
62
|
+
<input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
|
54
63
|
id="greyLetters" value="" autocomplete="off" tabIndex="13">
|
55
|
-
<input type="text" class="wordleSolver-field form-control px-5" maxlength="1"
|
64
|
+
<input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
|
56
65
|
id="greyLetters" value="" autocomplete="off" tabIndex="14">
|
57
66
|
</div>
|
58
67
|
<div class="d-flex mt-2">
|
59
68
|
<input type="text" autocomplete="off" tabIndex="15"
|
60
|
-
class="wordleSolver-field form-control px-5" maxlength="1" id="greyLetters">
|
69
|
+
class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="greyLetters">
|
61
70
|
<input type="text" autocomplete="off" tabIndex="16"
|
62
|
-
class="wordleSolver-field form-control px-5" maxlength="1" id="greyLetters">
|
71
|
+
class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="greyLetters">
|
63
72
|
<input type="text" autocomplete="off" tabIndex="17"
|
64
|
-
class="wordleSolver-field form-control px-5" maxlength="1" id="greyLetters">
|
73
|
+
class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="greyLetters">
|
65
74
|
<input type="text" autocomplete="off" tabIndex="18"
|
66
|
-
class="wordleSolver-field form-control px-5" maxlength="1" id="greyLetters">
|
75
|
+
class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="greyLetters">
|
67
76
|
<input type="text" autocomplete="off" tabIndex="19"
|
68
|
-
class="wordleSolver-field form-control px-5" maxlength="1" id="greyLetters">
|
77
|
+
class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="greyLetters">
|
69
78
|
</div>
|
70
79
|
</div>
|
80
|
+
|
81
|
+
|
71
82
|
</div>
|
83
|
+
<button type="button" data-toggle="tooltip" data-placement="top" title="Add more greyletters fields"
|
84
|
+
id="addMore"><i class="bi bi-plus"></i>
|
85
|
+
</button>
|
72
86
|
<div class="form-group text-right">
|
73
87
|
<div class="col-md-4 p-0" style="margin: 0 0 0 auto;">
|
74
88
|
<button type="submit" id="wordlesolver_submit" class="btn wordlesolver-btn mt-3">Update</button>
|
@@ -85,11 +99,14 @@
|
|
85
99
|
</div>
|
86
100
|
</div>
|
87
101
|
|
102
|
+
|
103
|
+
|
104
|
+
|
88
105
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
89
106
|
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
90
107
|
<script>
|
91
108
|
$(document).on('keypress', 'input', function (e) {
|
92
|
-
if (e.which ===
|
109
|
+
if (e.which === 32) {
|
93
110
|
e.preventDefault();
|
94
111
|
var $next = $('[tabIndex=' + (+this.tabIndex + 1) + ']');
|
95
112
|
|
data/assets/css/wordleSolver.css
CHANGED
@@ -30,6 +30,14 @@
|
|
30
30
|
box-shadow: unset !important;
|
31
31
|
border-color: #ced4da !important;
|
32
32
|
}
|
33
|
+
#addMore {
|
34
|
+
font-size: 25px;
|
35
|
+
background-color: transparent;
|
36
|
+
border: none;
|
37
|
+
width: 100%;
|
38
|
+
text-align: right;
|
39
|
+
padding-right: 2px;
|
40
|
+
}
|
33
41
|
|
34
42
|
.wordlesolver-btn {
|
35
43
|
padding: 8px 25px;
|
data/assets/js/wordleSolver.js
CHANGED
@@ -13,6 +13,30 @@ let wordlesolver_submit = document.getElementById('wordlesolver_submit')
|
|
13
13
|
let newWordsLength = 0
|
14
14
|
|
15
15
|
let errMessage = document.querySelector('.errMessage')
|
16
|
+
let wrapper = document.querySelector('.wrapper')
|
17
|
+
let addMore = document.querySelector('#addMore')
|
18
|
+
|
19
|
+
addMore.addEventListener('click', (e) => {
|
20
|
+
e.preventDefault()
|
21
|
+
let div = document.createElement('div')
|
22
|
+
div.classList.add('d-flex')
|
23
|
+
div.classList.add('mt-2')
|
24
|
+
|
25
|
+
for (let i = 20; i <= 24; i++) {
|
26
|
+
let input = document.createElement('input')
|
27
|
+
input.type = 'text'
|
28
|
+
input.setAttribute('maxlength', '1')
|
29
|
+
input.setAttribute('autocomplete', 'off')
|
30
|
+
if (i <= 24) {
|
31
|
+
input.setAttribute('tabIndex', i)
|
32
|
+
}
|
33
|
+
let classes = ['wordleSolver-field', 'greyLetters', 'form-control', 'px-5']
|
34
|
+
input.classList.add(...classes)
|
35
|
+
input.id = 'greyLetters'
|
36
|
+
div.append(input)
|
37
|
+
wrapper.append(div)
|
38
|
+
}
|
39
|
+
})
|
16
40
|
|
17
41
|
const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
18
42
|
try {
|
@@ -36,6 +60,8 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
36
60
|
wordleSolvererrorMsg.classList.add('alert-danger')
|
37
61
|
wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
|
38
62
|
} else {
|
63
|
+
wordleSolvererrorMsg.classList.remove('alert-danger')
|
64
|
+
wordleSolvererrorMsg.innerHTML = ''
|
39
65
|
wordleSolverData.innerHTML = ''
|
40
66
|
newWordsLength = ''
|
41
67
|
newWordsLength += data.length
|
@@ -86,52 +112,71 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
86
112
|
}
|
87
113
|
}
|
88
114
|
|
89
|
-
let arr = []
|
90
|
-
let greenWithIndex = []
|
91
115
|
for (let g = 0; g < greenLetters.length; g++) {
|
92
116
|
const elem = greenLetters[g]
|
93
117
|
elem.addEventListener('input', (e) => {
|
94
118
|
if (e.target.value) {
|
95
119
|
e.target.classList.add('ws-fcs')
|
96
|
-
arr.push(e.target.value)
|
97
|
-
greenWithIndex.push({
|
98
|
-
value: e.target.value,
|
99
|
-
index: e.target.dataset.id,
|
100
|
-
})
|
101
120
|
} else {
|
102
121
|
e.target.classList.remove('ws-fcs')
|
103
122
|
}
|
104
123
|
})
|
105
124
|
}
|
106
|
-
|
107
|
-
let arr2 = []
|
108
125
|
for (let y = 0; y < yellowLetters.length; y++) {
|
109
126
|
const elem = yellowLetters[y]
|
110
127
|
elem.addEventListener('input', (e) => {
|
111
128
|
if (e.target.value) {
|
112
129
|
e.target.classList.add('ws-fcs2')
|
113
|
-
arr2.push(e.target.value)
|
114
130
|
} else {
|
115
131
|
e.target.classList.remove('ws-fcs2')
|
116
132
|
}
|
117
133
|
})
|
118
134
|
}
|
119
|
-
|
120
|
-
let arr3 = []
|
121
135
|
for (let e = 0; e < greyLetters.length; e++) {
|
122
136
|
const elem = greyLetters[e]
|
123
137
|
elem.addEventListener('input', (e) => {
|
124
138
|
if (e.target.value) {
|
125
139
|
e.target.classList.add('ws-fcs3')
|
126
|
-
arr3.push(e.target.value)
|
127
140
|
} else {
|
128
141
|
e.target.classList.remove('ws-fcs3')
|
129
142
|
}
|
130
143
|
})
|
131
144
|
}
|
132
145
|
|
146
|
+
const getLetters = (object) => {
|
147
|
+
let letters = []
|
148
|
+
if (typeof object === 'string') {
|
149
|
+
object = document.querySelectorAll(object)
|
150
|
+
}
|
151
|
+
for (let item of object) {
|
152
|
+
if (item.value.trim().length === 1) {
|
153
|
+
letters.push(item.value.toLowerCase())
|
154
|
+
}
|
155
|
+
}
|
156
|
+
return letters
|
157
|
+
}
|
158
|
+
const getIndexs = (object) => {
|
159
|
+
let index = []
|
160
|
+
if (typeof object === 'string') {
|
161
|
+
object = document.querySelectorAll(object)
|
162
|
+
}
|
163
|
+
for (let item of object) {
|
164
|
+
if (item.value.trim().length === 1) {
|
165
|
+
index.push({
|
166
|
+
value: item.value.toLowerCase(),
|
167
|
+
index: item.dataset.id,
|
168
|
+
})
|
169
|
+
}
|
170
|
+
}
|
171
|
+
return index
|
172
|
+
}
|
173
|
+
|
133
174
|
function handleSubmit(e) {
|
134
175
|
e.preventDefault()
|
176
|
+
let greenLetter = getLetters('.greenLetters')
|
177
|
+
let yellowLetters = getLetters('.yellowLetters')
|
178
|
+
let greyLetters = getLetters('.greyLetters')
|
179
|
+
let greenWithIndex = getIndexs('.greenWithIndex')
|
135
180
|
if (
|
136
181
|
greenLetters[0].value !== '' ||
|
137
182
|
greenLetters[1].value !== '' ||
|
@@ -141,13 +186,12 @@ function handleSubmit(e) {
|
|
141
186
|
) {
|
142
187
|
errMessage.innerHTML = ''
|
143
188
|
errMessage.classList.remove('alert-danger')
|
144
|
-
wordleSolver(
|
189
|
+
wordleSolver(greenLetter, yellowLetters, greyLetters, greenWithIndex)
|
145
190
|
} else {
|
146
191
|
errMessage.innerHTML = 'You must enter at least 1 green letter'
|
147
192
|
errMessage.classList.add('alert-danger')
|
148
193
|
}
|
149
194
|
}
|
150
|
-
|
151
195
|
form.addEventListener('submit', handleSubmit)
|
152
196
|
|
153
197
|
// Scrabble Point Array
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: word-games-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- manpreet-appscms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|