word-games-theme 0.7.9 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/section/home2.html +1 -1
- data/_layouts/default.html +0 -4
- data/assets/css/footer.css +1 -1
- data/assets/js/X-letter.js +73 -2
- data/assets/js/wordScrabble.js +2 -0
- 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: 5b383e2d2ca991f0df8c99706aea73184eed922cad3c6207e9144f3795c3a38d
|
4
|
+
data.tar.gz: b70abbe49809438065ff3f2b8e8e9611633a1ab8cbf292c7f6eae8b344a80f9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23a74f922f3fd3a6301aa07618809a0894f7089c0fccce5e2e2e919c909b7d73963ee50527fcada52ced63dc40a0c27f6907dac2b140757f73ec228183f167aa
|
7
|
+
data.tar.gz: ee7afc262a84181335b87320eb085c2cb65ffba4df67805e590acb0ffc5f8e0a2eae530b3b9f50035297bb1e5de01c443ae7f713d265906d8e7093095da61e3f
|
@@ -85,7 +85,7 @@
|
|
85
85
|
</div>
|
86
86
|
</div>
|
87
87
|
</form>
|
88
|
-
{%- if page.
|
88
|
+
{%- if page.wordle == 'solver' -%}
|
89
89
|
<h2 class="m-0 mt-4 text-center" style="font-size:16px">
|
90
90
|
<a style="color:#000" href="/wordle-solver">Solve wordle quickly using our wordle solver</a>
|
91
91
|
</h2>
|
data/_layouts/default.html
CHANGED
@@ -56,13 +56,9 @@
|
|
56
56
|
<script defer src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
57
57
|
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js"></script>
|
58
58
|
<script>
|
59
|
-
|
60
59
|
let txtBox = document.querySelector('.txtBox')
|
61
|
-
let focusBorder = document.querySelector('.focus-border')
|
62
|
-
|
63
60
|
txtBox.focus()
|
64
61
|
txtBox.addEventListener('input', (e) => {
|
65
|
-
focusBorder.classList.remove('focus-border')
|
66
62
|
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
|
67
63
|
let rangeOfBlankTile = '{{ page.blanktilerange }}'
|
68
64
|
if (rangeOfBlankTile === "") {
|
data/assets/css/footer.css
CHANGED
data/assets/js/X-letter.js
CHANGED
@@ -4,6 +4,7 @@ const getScript=document.currentScript
|
|
4
4
|
const letterLen = getScript.dataset.letter
|
5
5
|
|
6
6
|
let errorMsg = document.querySelector('.errorMsg')
|
7
|
+
let script = document.currentScript
|
7
8
|
let wordCount = document.querySelector('.wordCount')
|
8
9
|
let main = document.querySelector('.main')
|
9
10
|
|
@@ -23,10 +24,43 @@ tab_link_wrapper.style.display = "none"
|
|
23
24
|
let txtBox = document.querySelector('.txtBox')
|
24
25
|
txtBox.focus()
|
25
26
|
txtBox.value = serachValue
|
27
|
+
txtBox.addEventListener('input', (e) => {
|
28
|
+
let rangeOfBlankTile = script.dataset.range
|
29
|
+
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, '')
|
30
|
+
if (rangeOfBlankTile === '') {
|
31
|
+
rangeOfBlankTile = 5
|
32
|
+
}
|
33
|
+
e.target.value = e.target.value.replace(/ /g, '?')
|
34
|
+
let data = []
|
35
|
+
data = e.target.value.split('').filter((i) => i === '?')
|
36
|
+
if (data.length > rangeOfBlankTile) {
|
37
|
+
e.target.value = e.target.value.replace(/\?$/, '')
|
38
|
+
}
|
39
|
+
})
|
26
40
|
|
27
41
|
var theSelect = document.getElementById('select_dropDown')
|
28
42
|
document.querySelector('.select_dropDown2').value = dictonary
|
29
|
-
|
43
|
+
const getDiff = (text1, text2) => {
|
44
|
+
var diffRange = []
|
45
|
+
var currentRange = undefined
|
46
|
+
for (var i = 0; i < text1.length; i++) {
|
47
|
+
if (text1[i] != text2[i]) {
|
48
|
+
if (currentRange == undefined) {
|
49
|
+
currentRange = [i]
|
50
|
+
}
|
51
|
+
}
|
52
|
+
if (currentRange != undefined && text1[i] == text2[i]) {
|
53
|
+
currentRange.push(i)
|
54
|
+
diffRange.push(currentRange)
|
55
|
+
currentRange = undefined
|
56
|
+
}
|
57
|
+
}
|
58
|
+
if (currentRange != undefined) {
|
59
|
+
currentRange.push(i)
|
60
|
+
diffRange.push(currentRange)
|
61
|
+
}
|
62
|
+
return diffRange
|
63
|
+
}
|
30
64
|
const getData = async (serachValue) => {
|
31
65
|
try {
|
32
66
|
main.innerHTML = `<div class="loader">
|
@@ -160,8 +194,45 @@ function x_with_letters(data) {
|
|
160
194
|
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
161
195
|
}
|
162
196
|
wordLength.value = itemLength
|
197
|
+
|
198
|
+
var text1 = serachValue.replace('?', '')
|
199
|
+
var text2 = item
|
200
|
+
var text3 = item
|
201
|
+
function findIndex(str, char) {
|
202
|
+
const strLength = str.length
|
203
|
+
const indexes = []
|
204
|
+
let newStr = str
|
205
|
+
while (newStr && newStr.indexOf(char) > -1) {
|
206
|
+
indexes.push(newStr.indexOf(char) + strLength - newStr.length)
|
207
|
+
newStr = newStr.substring(newStr.indexOf(char) + 1)
|
208
|
+
newStr = newStr.substring(newStr.indexOf(char) + 1)
|
209
|
+
}
|
210
|
+
return indexes
|
211
|
+
}
|
212
|
+
let chars = text1.split('')
|
213
|
+
let indexs = []
|
214
|
+
chars.map((i) => {
|
215
|
+
let findIndexes = findIndex(text3, i)
|
216
|
+
if (findIndexes.length > 0) {
|
217
|
+
text3 = text3.split('')
|
218
|
+
text3[findIndexes] = '$'
|
219
|
+
text3 = text3.join('')
|
220
|
+
indexs = [...indexs, ...findIndexes]
|
221
|
+
}
|
222
|
+
})
|
223
|
+
let itemHtml = ''
|
224
|
+
text2.split('').map((itemValue, index) => {
|
225
|
+
let check = indexs.find((i) => i === index)
|
226
|
+
if (check !== undefined) {
|
227
|
+
itemHtml += `${itemValue}`
|
228
|
+
} else {
|
229
|
+
itemHtml += `<span class='highlight'>${itemValue}</span>`
|
230
|
+
}
|
231
|
+
})
|
232
|
+
|
233
|
+
|
163
234
|
return `<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item}">
|
164
|
-
<li>${
|
235
|
+
<li>${itemHtml}
|
165
236
|
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
|
166
237
|
</li></a>`
|
167
238
|
})
|
data/assets/js/wordScrabble.js
CHANGED
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.
|
4
|
+
version: 0.8.0
|
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-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|