word-games-theme 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/blog/nav.json +1 -1
- data/_data/header/en/data.json +10 -2
- data/_data/wordgames/en/anagram_word_finder.json +2 -0
- data/_data/wordgames/en/feature_certain_positions.json +54 -0
- data/_data/wordgames/en/find-words-that-start-with-the-letters.json +54 -0
- data/_data/wordgames/en/root.json +10 -2
- data/_data/wordleSolver/en/data.json +6 -0
- data/_includes/Monumetric/Monumetric.html +48 -0
- data/_includes/autogenerated/content.html +1 -4
- data/_includes/cssfile/links.html +12 -0
- data/_includes/custom-head.html +0 -29
- data/_includes/find-words-in-certain-positions/words-in-certain-positions.html +167 -0
- data/_includes/head/index.html +3 -29
- data/_includes/header/blogHeader.html +1 -2
- data/_includes/header/index.html +1 -1
- data/_includes/script.html +16 -12
- data/_includes/section/commonPage.html +105 -101
- data/_includes/section/feature.html +1 -1
- data/_includes/section/home2.html +1 -1
- data/_includes/section/news.html +8 -7
- data/_includes/section/related_categories_post.html +155 -150
- data/_includes/section/wordGroup.html +2 -12
- data/_includes/wordle-solver/wordle-solver.html +2 -3
- data/_layouts/allpages.html +1 -6
- data/_layouts/autogencontent.html +2 -5
- data/_layouts/blog.html +1 -2
- data/_layouts/default.html +18 -21
- data/_layouts/disclaimer.html +5 -2
- data/_layouts/page.html +7 -17
- data/_layouts/page2.html +3 -18
- data/_layouts/post.html +26 -23
- data/_layouts/privacyPolicy.html +2 -1
- data/_layouts/termAndCondition.html +1 -0
- data/_layouts/{wordleSolver.html → tools.html} +18 -11
- data/_layouts/wordMeaning.html +21 -35
- data/_layouts/xyzpages.html +1 -6
- data/assets/css/advancedFilter.css +8 -0
- data/assets/css/content.css +3 -3
- data/assets/css/home.css +58 -41
- data/assets/css/news.css +2 -2
- data/assets/css/style.css +26 -7
- data/assets/css/wordGroup.css +6 -3
- data/assets/css/wordleSolver.css +8 -14
- data/assets/css/wordsInCertainPosition.css +139 -0
- data/assets/images/wordswithletters-logo.png +0 -0
- data/assets/js/X-letter.js +15 -2
- data/assets/js/wordScrabble.js +4 -1
- data/assets/js/wordleSolver.js +25 -18
- data/assets/js/words-in-certain-positions.js +200 -0
- data/assets/js/words-starting-with.js +564 -0
- metadata +11 -3
data/assets/css/news.css
CHANGED
@@ -37,11 +37,11 @@
|
|
37
37
|
padding-right: 30px;
|
38
38
|
line-height: 1.4;
|
39
39
|
cursor: pointer;
|
40
|
-
padding-left: 48px;
|
40
|
+
/* padding-left: 48px; */
|
41
41
|
}
|
42
42
|
.meduim-text {
|
43
43
|
font-size: 14px;
|
44
|
-
padding-left: 48px;
|
44
|
+
/* padding-left: 48px; */
|
45
45
|
font-weight: 500;
|
46
46
|
line-height: 1.75;
|
47
47
|
text-align: left;
|
data/assets/css/style.css
CHANGED
@@ -30,10 +30,9 @@ header {
|
|
30
30
|
width: 100%;
|
31
31
|
position: relative;
|
32
32
|
}
|
33
|
-
|
34
|
-
.navbar-section {
|
33
|
+
.navbar {
|
35
34
|
width: 100%;
|
36
|
-
padding: 1.2rem
|
35
|
+
padding: 1.2rem 9% !important;
|
37
36
|
position: fixed;
|
38
37
|
top: 0;
|
39
38
|
left: 0;
|
@@ -54,7 +53,7 @@ header {
|
|
54
53
|
outline: none !important;
|
55
54
|
}
|
56
55
|
.navbar-nav {
|
57
|
-
margin-left:
|
56
|
+
margin-left: 14rem;
|
58
57
|
}
|
59
58
|
.navbar-nav .nav-item {
|
60
59
|
padding: 0 15px;
|
@@ -244,8 +243,13 @@ header {
|
|
244
243
|
font-size: 14px;
|
245
244
|
}
|
246
245
|
|
246
|
+
.tools_headings {
|
247
|
+
margin-top: 110px;
|
248
|
+
margin-bottom: 20px;
|
249
|
+
}
|
250
|
+
|
247
251
|
@media (max-width: 768px) {
|
248
|
-
.navbar
|
252
|
+
.navbar {
|
249
253
|
padding: 1.2rem 15px !important;
|
250
254
|
}
|
251
255
|
|
@@ -310,7 +314,6 @@ header {
|
|
310
314
|
filter: brightness();
|
311
315
|
filter: brightness(100);
|
312
316
|
}
|
313
|
-
|
314
317
|
.rating-tool {
|
315
318
|
width: 100%;
|
316
319
|
display: flex;
|
@@ -390,6 +393,9 @@ header {
|
|
390
393
|
padding: 4px 0;
|
391
394
|
}
|
392
395
|
@media (max-width: 768px) {
|
396
|
+
.rating-text,.rating-value{
|
397
|
+
font-size: 12px;
|
398
|
+
}
|
393
399
|
|
394
400
|
.social-icons {
|
395
401
|
left: 0;
|
@@ -417,7 +423,20 @@ header {
|
|
417
423
|
.social-icon:hover {
|
418
424
|
color: black;
|
419
425
|
}
|
420
|
-
|
421
426
|
.highlight {
|
422
427
|
color: #ff0000 !important;
|
423
428
|
}
|
429
|
+
.related_post_heading,.related_post_heading{
|
430
|
+
width: 100%;
|
431
|
+
font-size: 46px;
|
432
|
+
text-align: center;
|
433
|
+
font-weight: 800;
|
434
|
+
font-stretch: normal;
|
435
|
+
font-style: normal;
|
436
|
+
line-height: 1.24;
|
437
|
+
letter-spacing: normal;
|
438
|
+
color: #11304e;
|
439
|
+
margin-bottom: 45px;
|
440
|
+
padding-top: 75px;
|
441
|
+
display: inline-block;
|
442
|
+
}
|
data/assets/css/wordGroup.css
CHANGED
@@ -53,9 +53,12 @@
|
|
53
53
|
@media (max-width: 768px) {
|
54
54
|
.wordCount {
|
55
55
|
font-size: 1.3rem;
|
56
|
-
margin-top: 15px;
|
56
|
+
/* margin-top: 15px; */
|
57
57
|
}
|
58
|
-
.
|
58
|
+
.pad{
|
59
|
+
padding-bottom: 50px;
|
60
|
+
}
|
61
|
+
/* .pagePad{
|
59
62
|
padding-top: 130px !important ;
|
60
63
|
}
|
61
64
|
.pad {
|
@@ -63,5 +66,5 @@
|
|
63
66
|
}
|
64
67
|
.xyzPad{
|
65
68
|
padding-top: 50px;
|
66
|
-
}
|
69
|
+
} */
|
67
70
|
}
|
data/assets/css/wordleSolver.css
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
|
2
|
+
/* wordle solver tool css */
|
1
3
|
.ws {
|
2
4
|
display: flex;
|
3
5
|
flex-direction: column;
|
@@ -15,10 +17,7 @@
|
|
15
17
|
padding-top: 15px;
|
16
18
|
text-align: center;
|
17
19
|
}
|
18
|
-
|
19
|
-
margin-top: 110px;
|
20
|
-
margin-bottom: 20px;
|
21
|
-
}
|
20
|
+
|
22
21
|
.wordleSolver-field {
|
23
22
|
border-radius: 5px;
|
24
23
|
margin: 0 5px 0 0 !important;
|
@@ -51,8 +50,8 @@
|
|
51
50
|
.wordlesolver-btn {
|
52
51
|
padding: 8px 25px;
|
53
52
|
font-size: 15px;
|
54
|
-
background-color: #
|
55
|
-
border-color: #
|
53
|
+
background-color: #20a815;
|
54
|
+
border-color: #20a815;
|
56
55
|
color: #fff;
|
57
56
|
border-radius: 5px;
|
58
57
|
width: 100px;
|
@@ -70,7 +69,6 @@
|
|
70
69
|
font-size: 14px;
|
71
70
|
font-weight: 600;
|
72
71
|
}
|
73
|
-
|
74
72
|
.allfiveletterswords {
|
75
73
|
background-color: white !important;
|
76
74
|
width: 75%;
|
@@ -87,25 +85,22 @@
|
|
87
85
|
border-top-right-radius: 15px;
|
88
86
|
border-top-left-radius: 15px;
|
89
87
|
}
|
90
|
-
|
91
88
|
#wordleWordCount {
|
92
89
|
font-size: 18px;
|
93
90
|
width: 75%;
|
94
91
|
margin: 10px auto;
|
95
92
|
}
|
96
|
-
|
97
93
|
.ws-fcs {
|
98
94
|
color: #fff !important;
|
99
|
-
background-color: #
|
95
|
+
background-color: #20a815 !important;
|
100
96
|
}
|
101
97
|
.ws-fcs2 {
|
102
98
|
color: #fff !important;
|
103
|
-
background-color: #
|
99
|
+
background-color: #C59E28 !important;
|
104
100
|
}
|
105
|
-
|
106
101
|
.ws-fcs3 {
|
107
102
|
color: #fff !important;
|
108
|
-
background-color: #
|
103
|
+
background-color: #3D3D3E !important;
|
109
104
|
}
|
110
105
|
.related_post_heading {
|
111
106
|
width: 100%;
|
@@ -121,7 +116,6 @@
|
|
121
116
|
padding-top: 75px;
|
122
117
|
display: inline-block;
|
123
118
|
}
|
124
|
-
|
125
119
|
#wordleSolvererrorMsg {
|
126
120
|
margin: 10px auto;
|
127
121
|
width: 75%;
|
@@ -0,0 +1,139 @@
|
|
1
|
+
|
2
|
+
/* words in certain position*/
|
3
|
+
.wordsInCertainPos {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
justify-content: center;
|
7
|
+
align-items: center;
|
8
|
+
}
|
9
|
+
.errMessage {
|
10
|
+
display: none;
|
11
|
+
}
|
12
|
+
.forms_data {
|
13
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
14
|
+
padding: 0px 25px;
|
15
|
+
padding-top: 15px;
|
16
|
+
text-align: center;
|
17
|
+
}
|
18
|
+
.letter_field{
|
19
|
+
border-radius: 5px;
|
20
|
+
margin: 0 5px 0 0 !important;
|
21
|
+
font-size: 30px;
|
22
|
+
text-transform: uppercase;
|
23
|
+
text-align: center;
|
24
|
+
width: 48px;
|
25
|
+
height: 48px;
|
26
|
+
line-height: 55px;
|
27
|
+
font-weight: bold;
|
28
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
29
|
+
background: #fff;
|
30
|
+
padding: 0 !important;
|
31
|
+
outline: none !important;
|
32
|
+
}
|
33
|
+
.letter_field:focus {
|
34
|
+
box-shadow: unset !important;
|
35
|
+
border-color: #ced4da !important;
|
36
|
+
}
|
37
|
+
.wordsInCertainPos_btn {
|
38
|
+
padding: 8px 18px;
|
39
|
+
font-size: 15px;
|
40
|
+
background-color: #000;
|
41
|
+
border-color: #000;
|
42
|
+
color: #fff;
|
43
|
+
border-radius: 5px;
|
44
|
+
/* width: 100px; */
|
45
|
+
font-weight: 900;
|
46
|
+
position: relative;
|
47
|
+
}
|
48
|
+
.wordsInCertainPos_btn:focus {
|
49
|
+
outline: none;
|
50
|
+
box-shadow: unset !important;
|
51
|
+
}
|
52
|
+
.wordsInCertainPos_btn:hover {
|
53
|
+
color: #fff;
|
54
|
+
}
|
55
|
+
.letterswords {
|
56
|
+
background-color: white !important;
|
57
|
+
width: 75%;
|
58
|
+
margin: 15px auto;
|
59
|
+
height: auto;
|
60
|
+
box-shadow: 0 0 2px rgb(0 0 0 / 20%);
|
61
|
+
/* margin: 10px 0; */
|
62
|
+
border-radius: 15px;
|
63
|
+
}
|
64
|
+
.letterswords > .wordListHeading {
|
65
|
+
background: gray;
|
66
|
+
padding: 10px 0px 5px 25px;
|
67
|
+
color: #fff;
|
68
|
+
border-top-right-radius: 15px;
|
69
|
+
border-top-left-radius: 15px;
|
70
|
+
}
|
71
|
+
.wordListHeading > .lead{
|
72
|
+
font-size: 18px;
|
73
|
+
}
|
74
|
+
#certain_pos_count {
|
75
|
+
font-size: 16px;
|
76
|
+
width: 75%;
|
77
|
+
margin: 10px auto;
|
78
|
+
}
|
79
|
+
.related_post_heading {
|
80
|
+
width: 100%;
|
81
|
+
font-size: 46px;
|
82
|
+
text-align: center;
|
83
|
+
font-weight: 800;
|
84
|
+
font-stretch: normal;
|
85
|
+
font-style: normal;
|
86
|
+
line-height: 1.24;
|
87
|
+
letter-spacing: normal;
|
88
|
+
color: #11304e;
|
89
|
+
margin-bottom: 45px;
|
90
|
+
padding-top: 75px;
|
91
|
+
display: inline-block;
|
92
|
+
}
|
93
|
+
#certain_pos_error_msg {
|
94
|
+
margin: 10px auto;
|
95
|
+
width: 75%;
|
96
|
+
}
|
97
|
+
.certainWordsList {
|
98
|
+
padding: 15px;
|
99
|
+
}
|
100
|
+
.certainWordsList > ul {
|
101
|
+
display: inline-flex;
|
102
|
+
width: 100%;
|
103
|
+
flex-wrap: wrap;
|
104
|
+
}
|
105
|
+
.certainWordsList > ul li {
|
106
|
+
border: solid 2px rgba(226, 248, 198, 0.47);
|
107
|
+
padding: 8px;
|
108
|
+
background: #f8f9fa;
|
109
|
+
border-radius: 5px;
|
110
|
+
margin: 6px 6px;
|
111
|
+
width: auto;
|
112
|
+
text-align: center;
|
113
|
+
}
|
114
|
+
.certainWordsList .anchor__style {
|
115
|
+
color: #000 !important;
|
116
|
+
font-size: 15px;
|
117
|
+
text-decoration: none !important;
|
118
|
+
font-weight: 600;
|
119
|
+
}
|
120
|
+
|
121
|
+
/* #searchData:before{
|
122
|
+
content: "\1F50D";
|
123
|
+
position: absolute;
|
124
|
+
top:8px;
|
125
|
+
left: 5px;
|
126
|
+
} */
|
127
|
+
@media (max-width: 768px) {
|
128
|
+
.letterswords > .wordListHeading{
|
129
|
+
padding:10px 15px 5px 15px;
|
130
|
+
}
|
131
|
+
#certain_pos_count,.wordListHeading > .lead{
|
132
|
+
font-size: 13px ;
|
133
|
+
}
|
134
|
+
.allfiveletterswords,
|
135
|
+
#certain_pos_count,.letterswords {
|
136
|
+
width: 85%;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
Binary file
|
data/assets/js/X-letter.js
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
---
|
3
3
|
const getScript=document.currentScript
|
4
4
|
const letterLen = getScript.dataset.letter
|
5
|
-
|
6
5
|
const ablank = getScript.dataset.ablank
|
7
6
|
|
7
|
+
const siteName = getScript.dataset.name
|
8
|
+
const siteUrl = getScript.dataset.url
|
9
|
+
|
8
10
|
let errorMsg = document.querySelector('.errorMsg')
|
9
11
|
let script = document.currentScript
|
10
12
|
let wordCount = document.querySelector('.wordCount')
|
@@ -20,6 +22,7 @@ let includeValue = params.get('include')
|
|
20
22
|
let lengthValue = params.get('length')
|
21
23
|
let dictonary = params.get('dictionary')
|
22
24
|
|
25
|
+
|
23
26
|
let tab_link_wrapper = document.querySelector('.tab_link_wrapper')
|
24
27
|
tab_link_wrapper.style.display = "none"
|
25
28
|
|
@@ -77,6 +80,7 @@ const getData = async (serachValue) => {
|
|
77
80
|
try {
|
78
81
|
main.innerHTML = `<div class="loader">
|
79
82
|
<img src='/assets/images/loading.gif'>
|
83
|
+
<div style="font-weight:900;font-size:14px" >Finding words - Powered by ${siteUrl.replace(/^https?:\/\//, '')}</div>
|
80
84
|
</div>`
|
81
85
|
const response = await fetch(
|
82
86
|
`/.netlify/functions/getWords?name=${serachValue}`
|
@@ -92,7 +96,7 @@ const getData = async (serachValue) => {
|
|
92
96
|
getData(serachValue.toLowerCase())
|
93
97
|
|
94
98
|
function x_with_letters(data) {
|
95
|
-
console.log(data);
|
99
|
+
// console.log(data);
|
96
100
|
if (typeof data === 'string') {
|
97
101
|
errorMsg.innerHTML = 'No words found'
|
98
102
|
wordCount.innerHTML = `<strong>Found 0 words with letters ${serachValue.split(
|
@@ -260,6 +264,15 @@ function x_with_letters(data) {
|
|
260
264
|
// let tabs = document.getElementsByClassName('tab_link')
|
261
265
|
// tabs[0] ? tabs[0].classList.add('active-tab') : ''
|
262
266
|
|
267
|
+
|
268
|
+
if(siteName == "wordswithletters"){
|
269
|
+
let home_page_search_result = document.querySelector("#home_page_search_result")
|
270
|
+
let homePageSearchResult = `/result?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
|
271
|
+
home_page_search_result.href = homePageSearchResult
|
272
|
+
home_page_search_result.innerHTML = `See words of any length with letters ${serachValue.split("")}`
|
273
|
+
}
|
274
|
+
|
275
|
+
|
263
276
|
main.innerHTML += `
|
264
277
|
<div class="allGroupWords">
|
265
278
|
<div class="wordListHeading">
|
data/assets/js/wordScrabble.js
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
***************/
|
4
4
|
|
5
5
|
// grab some html elements
|
6
|
+
|
7
|
+
const getScript=document.currentScript
|
6
8
|
let form = document.querySelector('#form')
|
7
9
|
let wordCount = document.querySelector('.wordCount')
|
8
10
|
let main = document.querySelector('.main')
|
@@ -32,7 +34,7 @@ let wordLength = document.getElementById('wordLength')
|
|
32
34
|
let ok = true
|
33
35
|
|
34
36
|
let tab_container = document.querySelector('.tab_container')
|
35
|
-
|
37
|
+
const siteUrl = getScript.dataset.url
|
36
38
|
var sortValue
|
37
39
|
var sortBool = false
|
38
40
|
|
@@ -82,6 +84,7 @@ const getData = async (serachValue) => {
|
|
82
84
|
let selectedDictionary = document.querySelector('.select_dropDown2').value
|
83
85
|
main.innerHTML = `<div class="loader">
|
84
86
|
<img src='/assets/images/loading.gif'>
|
87
|
+
<div style="font-weight:900;font-size:14px" >Finding words - Powered by ${siteUrl.replace(/^https?:\/\//, '')}</div>
|
85
88
|
</div>`
|
86
89
|
/// loader
|
87
90
|
const response = await fetch(
|
data/assets/js/wordleSolver.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
console.log('wordle solver ...')
|
1
|
+
// console.log('wordle solver ...')
|
2
2
|
|
3
3
|
let form = document.querySelector('[name=verify')
|
4
4
|
|
@@ -54,7 +54,8 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
54
54
|
greenWithIndex: greenWithIndex,
|
55
55
|
}),
|
56
56
|
})
|
57
|
-
|
57
|
+
let data = await response.json()
|
58
|
+
data = data.slice(0,1000)
|
58
59
|
document.querySelector('#updateTxt').innerHTML = 'Solve'
|
59
60
|
spinner.classList.remove('spinner-border')
|
60
61
|
|
@@ -78,6 +79,7 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
78
79
|
ok = false
|
79
80
|
newWordsLength = newWordsLength - 1
|
80
81
|
} else {
|
82
|
+
// console.log(newWordsLength);
|
81
83
|
let ScrabbleLetterScore = ScrabbleScore()
|
82
84
|
sum = 0
|
83
85
|
item = item.toLowerCase()
|
@@ -115,7 +117,7 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
115
117
|
wordleSolvererrorMsg.classList.add('alert-danger')
|
116
118
|
wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
|
117
119
|
} else {
|
118
|
-
wordleWordCount.innerHTML = `<strong>Found <span style="color:#
|
120
|
+
wordleWordCount.innerHTML = `<strong>Found <span style="color:#20a815">${newWordsLength}</span> matching words for wordle</strong>`
|
119
121
|
}
|
120
122
|
} catch (error) {
|
121
123
|
console.log(error)
|
@@ -125,6 +127,7 @@ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
|
|
125
127
|
for (let g = 0; g < greenLetters.length; g++) {
|
126
128
|
const elem = greenLetters[g]
|
127
129
|
elem.addEventListener('input', (e) => {
|
130
|
+
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
|
128
131
|
if (e.target.value) {
|
129
132
|
e.target.classList.add('ws-fcs')
|
130
133
|
} else {
|
@@ -135,6 +138,7 @@ for (let g = 0; g < greenLetters.length; g++) {
|
|
135
138
|
for (let y = 0; y < yellowLetters.length; y++) {
|
136
139
|
const elem = yellowLetters[y]
|
137
140
|
elem.addEventListener('input', (e) => {
|
141
|
+
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
|
138
142
|
if (e.target.value) {
|
139
143
|
e.target.classList.add('ws-fcs2')
|
140
144
|
} else {
|
@@ -145,6 +149,7 @@ for (let y = 0; y < yellowLetters.length; y++) {
|
|
145
149
|
for (let e = 0; e < greyLetters.length; e++) {
|
146
150
|
const elem = greyLetters[e]
|
147
151
|
elem.addEventListener('input', (e) => {
|
152
|
+
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
|
148
153
|
if (e.target.value) {
|
149
154
|
e.target.classList.add('ws-fcs3')
|
150
155
|
} else {
|
@@ -183,26 +188,28 @@ const getIndexs = (object) => {
|
|
183
188
|
|
184
189
|
function handleSubmit(e) {
|
185
190
|
e.preventDefault()
|
191
|
+
|
186
192
|
let greenLetter = getLetters('.greenLetters')
|
187
193
|
let yellowLetters = getLetters('.yellowLetters')
|
188
194
|
let greyLetters = getLetters('.greyLetters')
|
189
195
|
let greenWithIndex = getIndexs('.greenWithIndex')
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
|
197
|
+
// if (
|
198
|
+
// greenLetters[0].value !== '' ||
|
199
|
+
// greenLetters[1].value !== '' ||
|
200
|
+
// greenLetters[2].value !== '' ||
|
201
|
+
// greenLetters[3].value !== '' ||
|
202
|
+
// greenLetters[4].value !== ''
|
203
|
+
// ) {
|
204
|
+
// errMessage.innerHTML = ''
|
205
|
+
// errMessage.classList.remove('alert-danger')
|
206
|
+
// errMessage.style.display = 'none'
|
200
207
|
wordleSolver(greenLetter, yellowLetters, greyLetters, greenWithIndex)
|
201
|
-
} else {
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
}
|
208
|
+
// } else {
|
209
|
+
// errMessage.innerHTML = 'You must enter at least 1 green letter'
|
210
|
+
// errMessage.classList.add('alert-danger')
|
211
|
+
// errMessage.style.display = 'block'
|
212
|
+
// }
|
206
213
|
}
|
207
214
|
form.addEventListener('submit', handleSubmit)
|
208
215
|
|
@@ -0,0 +1,200 @@
|
|
1
|
+
// console.log("certain position");
|
2
|
+
let form = document.querySelector('[name=verify')
|
3
|
+
let greenLetters = document.querySelectorAll('.greenLetters')
|
4
|
+
let certain_pos_words_data = document.getElementById('certain_pos_words_data')
|
5
|
+
greenLetters[0].focus()
|
6
|
+
let certain_pos_count = document.querySelector('#certain_pos_count')
|
7
|
+
let certain_pos_error_msg = document.querySelector('#certain_pos_error_msg')
|
8
|
+
let certain_pos_submit = document.getElementById('certain_pos_submit')
|
9
|
+
let newWordsLength
|
10
|
+
let errMessage = document.querySelector('.errMessage')
|
11
|
+
let spinner = document.querySelector('.spinner')
|
12
|
+
|
13
|
+
const wordsInCertainPos = async (letters, lettersWithIndex,wordLength) => {
|
14
|
+
let maxLength = Math.max.apply(null, wordLength);
|
15
|
+
// maxLength = maxLength + 1
|
16
|
+
try {
|
17
|
+
let result = ''
|
18
|
+
document.querySelector('#searchData').innerHTML = ''
|
19
|
+
spinner.classList.add('spinner-border')
|
20
|
+
certain_pos_count.innerHTML = 'Finding words in certain position...'
|
21
|
+
let response = await fetch('/.netlify/functions/wordsInCertainPositions', {
|
22
|
+
method: 'POST',
|
23
|
+
body: JSON.stringify({
|
24
|
+
greenLetters: letters,
|
25
|
+
greenWithIndex: lettersWithIndex,
|
26
|
+
}),
|
27
|
+
})
|
28
|
+
let data = await response.json()
|
29
|
+
|
30
|
+
if(data.length == 0){
|
31
|
+
errMessage.innerHTML = 'Sorry!! No words found'
|
32
|
+
errMessage.classList.add('alert-danger')
|
33
|
+
errMessage.style.display = 'block'
|
34
|
+
document.querySelector('#searchData').innerHTML = 'Search'
|
35
|
+
spinner.classList.remove('spinner-border')
|
36
|
+
certain_pos_words_data.innerHTML = ""
|
37
|
+
certain_pos_count.innerHTML = ""
|
38
|
+
newWordsLength = 0
|
39
|
+
}
|
40
|
+
else{
|
41
|
+
errMessage.innerHTML = ''
|
42
|
+
errMessage.classList.remove('alert-danger')
|
43
|
+
data = data.slice(0,1500)
|
44
|
+
document.querySelector('#searchData').innerHTML = 'Search'
|
45
|
+
spinner.classList.remove('spinner-border')
|
46
|
+
certain_pos_words_data.innerHTML = ""
|
47
|
+
newWordsLength = 0
|
48
|
+
|
49
|
+
|
50
|
+
let ok = true
|
51
|
+
|
52
|
+
for (let i = maxLength; i <= 15; i++) {
|
53
|
+
let newdata = data.filter((item) => item.length === i)
|
54
|
+
if (newdata.length === 0) {
|
55
|
+
certain_pos_words_data.innerHTML += ''
|
56
|
+
} else {
|
57
|
+
newWordsLength += newdata.length
|
58
|
+
certain_pos_error_msg.classList.remove('alert-danger')
|
59
|
+
certain_pos_error_msg.innerHTML = ''
|
60
|
+
const result = newdata.map((item) => {
|
61
|
+
if (item.length === 1) {
|
62
|
+
ok = false
|
63
|
+
newWordsLength = newWordsLength - 1
|
64
|
+
} else {
|
65
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
66
|
+
sum = 0
|
67
|
+
item = item.toLowerCase()
|
68
|
+
for (let i = 0; i < item.length; i++) {
|
69
|
+
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
70
|
+
}
|
71
|
+
return `<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
|
72
|
+
<li>${item}
|
73
|
+
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
|
74
|
+
</li></a>`
|
75
|
+
}
|
76
|
+
})
|
77
|
+
if (ok) {
|
78
|
+
certain_pos_words_data.innerHTML += `
|
79
|
+
<div class="letterswords wordsInCertainPos_Container">
|
80
|
+
<div class="wordListHeading">
|
81
|
+
<h3 class="lead">List of ${i} letter words that contain letters ${letters}</h3>
|
82
|
+
</div>
|
83
|
+
<div class="certainWordsList">
|
84
|
+
<ul class="ul list-unstyled">
|
85
|
+
${result.join('')}
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
`
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
if (newWordsLength === 0) {
|
94
|
+
certain_pos_count.innerHTML = ""
|
95
|
+
certain_pos_error_msg.classList.add('alert-danger')
|
96
|
+
certain_pos_error_msg.innerHTML = 'Sorry!! No words found'
|
97
|
+
} else {
|
98
|
+
certain_pos_count.innerHTML = `<strong>There are <span>${newWordsLength}</span>
|
99
|
+
words that contain letters ${letters}</strong>`
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
}
|
107
|
+
} catch (error) {
|
108
|
+
console.log(error)
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
for (let g = 0; g < greenLetters.length; g++) {
|
113
|
+
const elem = greenLetters[g]
|
114
|
+
elem.addEventListener('input', (e) => {
|
115
|
+
e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
|
116
|
+
})
|
117
|
+
}
|
118
|
+
|
119
|
+
const getLetters = (object) => {
|
120
|
+
let letters = []
|
121
|
+
if (typeof object === 'string') {
|
122
|
+
object = document.querySelectorAll(object)
|
123
|
+
}
|
124
|
+
for (let item of object) {
|
125
|
+
if (item.value.trim().length === 1) {
|
126
|
+
letters.push(item.value.toLowerCase())
|
127
|
+
}
|
128
|
+
}
|
129
|
+
return letters
|
130
|
+
}
|
131
|
+
const getIndexs = (object) => {
|
132
|
+
let index = []
|
133
|
+
if (typeof object === 'string') {
|
134
|
+
object = document.querySelectorAll(object)
|
135
|
+
}
|
136
|
+
for (let item of object) {
|
137
|
+
if (item.value.trim().length === 1) {
|
138
|
+
index.push({
|
139
|
+
value: item.value.toLowerCase(),
|
140
|
+
index: item.dataset.id,
|
141
|
+
})
|
142
|
+
}
|
143
|
+
}
|
144
|
+
return index
|
145
|
+
}
|
146
|
+
const getLength= (object) => {
|
147
|
+
let index = []
|
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
|
+
index.push(
|
154
|
+
item.dataset.id)
|
155
|
+
}
|
156
|
+
}
|
157
|
+
return index
|
158
|
+
}
|
159
|
+
function handleSubmit(e) {
|
160
|
+
e.preventDefault()
|
161
|
+
let letters = getLetters('.greenLetters')
|
162
|
+
let lettersWithIndex = getIndexs('.greenWithIndex')
|
163
|
+
let wordLength = getLength('.greenWithIndex')
|
164
|
+
|
165
|
+
wordsInCertainPos(letters,lettersWithIndex,wordLength)
|
166
|
+
}
|
167
|
+
form.addEventListener('submit', handleSubmit)
|
168
|
+
|
169
|
+
// Scrabble Point Array
|
170
|
+
const ScrabbleScore = () => {
|
171
|
+
let twl06_sowpods = {
|
172
|
+
a: 1,
|
173
|
+
e: 1,
|
174
|
+
i: 1,
|
175
|
+
o: 1,
|
176
|
+
u: 1,
|
177
|
+
l: 1,
|
178
|
+
n: 1,
|
179
|
+
r: 1,
|
180
|
+
s: 1,
|
181
|
+
t: 1,
|
182
|
+
d: 2,
|
183
|
+
g: 2,
|
184
|
+
b: 3,
|
185
|
+
c: 3,
|
186
|
+
m: 3,
|
187
|
+
p: 3,
|
188
|
+
f: 4,
|
189
|
+
h: 4,
|
190
|
+
v: 4,
|
191
|
+
w: 4,
|
192
|
+
y: 4,
|
193
|
+
k: 5,
|
194
|
+
j: 8,
|
195
|
+
x: 8,
|
196
|
+
q: 10,
|
197
|
+
z: 10,
|
198
|
+
}
|
199
|
+
return twl06_sowpods
|
200
|
+
}
|