word-games-theme 1.3.2 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898fc619f72069ab95131273d148ae3fb3800efc12cc692d18068d94c558635b
4
- data.tar.gz: 43d334aad0175860fcd3d8aaaa14ab97dc7fed1e37311e9d96e57c3ea505edcc
3
+ metadata.gz: c6d7cd08fe45ed14416c231d87f34d78d7bc33fbec749b9824dc93028c73c632
4
+ data.tar.gz: e9508723d4c4d0f3c10e9de368809d1be1e2eb9ebf08d0dee1a3fb75cfdd27d4
5
5
  SHA512:
6
- metadata.gz: e83c03aa95f990360f2a462d3a71a7373f821dfc55742b95d02613208d0383aedac81cb58a332ded96d7212f6dc6a08fdebc1dfb63c1bcfcd210a1587bb82860
7
- data.tar.gz: 025c42627fb28322839d935ed09c1be95de9900b2d856a582cd11397916e4d26306f8b46deee25e4e19c7cc24dac4ba1fcdf3c0071e9654afc899162b0603c89
6
+ metadata.gz: a938e80aba4ad5af01a27b98e1808cfc291bee7bc5b2b260b59b28fa17994a1ee3856d3dc34c71d58c3bde16e4fe26434872889d8518d6a438f06227b0636415
7
+ data.tar.gz: b52f6bf0f82ccc0a0465de4950aa10954473ca14b0008b92e2cd634cdacb3e73f1118afcb55aaff47d22572e927eb822781d63e93fcde422317050767a93ddac
data/_data/blog/blog.yml CHANGED
@@ -1,2 +1,3 @@
1
1
  ---
2
2
  h1: Wordfinders Blog
3
+ description: ram
@@ -56,9 +56,9 @@
56
56
  }
57
57
  ],
58
58
  "jsfilepaths": [
59
- ""
59
+ "/assets/js/wordleSolver.js"
60
60
  ],
61
61
  "cssfilepaths": [
62
- "../assets/css/wordleSolver.css"
62
+ "/assets/css/wordleSolver.css"
63
63
  ]
64
64
  }
@@ -0,0 +1,64 @@
1
+ {
2
+ "title": "Solve wordle easily in minimum guesses",
3
+ "h1": "Solve todays wordle by entering letters used so far",
4
+ "h2": "Enters letters in gray, yellow, and green to see potential words",
5
+ "meta": "Input letters in grey, yellow and green, and get list of matching 5 letter words to solve todays wordle in mimimum attempts, and impress your friends",
6
+ "tags": "",
7
+ "categories": "wordle",
8
+ "featureNo": "02",
9
+ "feature_title": "Features",
10
+ "featureList": [
11
+ {
12
+ "feature_heading": "",
13
+ "feature_text": "",
14
+ "fa_class": "../assets/images/star.svg"
15
+ },
16
+ {
17
+ "feature_heading": "",
18
+ "feature_text": "",
19
+ "fa_class": "../assets/images/star.svg"
20
+ },
21
+ {
22
+ "feature_heading": "",
23
+ "feature_text": "",
24
+ "fa_class": "../assets/images/star.svg"
25
+ },
26
+ {
27
+ "feature_heading": "",
28
+ "feature_text": "",
29
+ "fa_class": "../assets/images/star.svg"
30
+ },
31
+ {
32
+ "feature_heading": "",
33
+ "feature_text": "",
34
+ "fa_class": "../assets/images/star.svg"
35
+ },
36
+ {
37
+ "feature_heading": "",
38
+ "feature_text": "",
39
+ "fa_class": "../assets/images/star.svg"
40
+ }
41
+ ],
42
+ "HOW_TO_CONTENT": {
43
+ "logoImageUrl": "https://smallpdf.com/build/73d77e3d204fd7defc9de80bf83fcbeb.svg",
44
+ "heading": "How to set alarm for $variable minutes:",
45
+ "steps": [
46
+ "Click on set alarm ",
47
+ "Set $variable minutes for alarm.",
48
+ "Choose sound of your choice.",
49
+ "Click submit to set alarm, that's it !."
50
+ ]
51
+ },
52
+ "faqList": [
53
+ {
54
+ "Question": "",
55
+ "Answer": ""
56
+ }
57
+ ],
58
+ "jsfilepaths": [
59
+ "/assets/js/wordleSolverResult.js"
60
+ ],
61
+ "cssfilepaths": [
62
+ "../assets/css/wordleSolver.css"
63
+ ]
64
+ }
@@ -34,6 +34,16 @@ writer is hidden in me. You can found me with my laptop either coding or writing
34
34
  {% assign shubhangi = "Shubhangi Singh&&/assets/images/sona.jpeg&&I am pursuing a degree in computer science and love
35
35
  reading. I am also a BTS Army and enjoy anime and K-dramas. My favourite pastime is reading on Wattpad.&&N/A" | split:
36
36
  '&&' %}
37
+ {% assign balark = "Balark Singhal&&/assets/images/balark.jpeg&&I am a poet and a writer, a few of them also got
38
+ published
39
+ in some anthologies like Brave Heart of the motherland, and Scarlet Wings.I love to write Shayari and poetries and also
40
+ in my free time I like to do skating, swimming and read books.&&N/A" | split:
41
+ '&&' %}
42
+ {% assign udit = "Udit Agarwal&&/assets/images/udit.jpg&&Udit Agarwal is a Digital Marketer and a Content
43
+ Marketing Specialist, He enjoys technical as well as non-technical writing. His passion and urge for gaining new
44
+ insights has led him here. He quenches his thirst for technology through his action oriented writing skills and a
45
+ profound ability to stay up to date with latest industry trends.&&N/A" | split:
46
+ '&&' %}
37
47
  {%- assign postAuthor = post.author | split: " " -%}
38
48
  {%- assign author = postAuthor.first | downcase -%}
39
49
  {%- assign collection = [author] -%}
@@ -8,7 +8,8 @@
8
8
  {{site.data.customcdns.customcdns.jsfiles}}
9
9
  {%- if scriptData.jsfilepaths -%}
10
10
  {%- for path in scriptData.jsfilepaths -%}
11
- <script src="{{path}}"></script>
11
+ <script src="{{path}}" data-folderName="{{page.folderName}}" data-lang="{{page.lang}}" data-fileName="{{page.fileName}}"
12
+ data-tool="{{page.tool}}" data-permalink="{{page.permalink}}"></script>
12
13
  {%- endfor -%}
13
14
  {%- endif -%}
14
15
  {%- if scriptData.jscdns -%}
@@ -15,7 +15,7 @@
15
15
  <div class="card h-100">
16
16
  <a href="{{ post.url }}">
17
17
  <img src="{{ post.image }}" class="card-img-top" height="215px" width="100%"
18
- loading="lazy" alt="">
18
+ loading="lazy" alt="{{post.title}}">
19
19
  </a>
20
20
  <div class="card-body">
21
21
  <a class="text-decoration-none text-dark" href="{{ post.url }}" class="anchor_link">
@@ -57,7 +57,7 @@
57
57
  <div class="card h-100">
58
58
  <a href="{{ post.url }}">
59
59
  <img src="{{ post.image }}" class="card-img-top" height="215px" width="100%" loading="lazy"
60
- alt="">
60
+ alt="{{post.title}}">
61
61
  </a>
62
62
  <div class="card-body">
63
63
  <a class="text-decoration-none text-dark" href="{{ post.url }}" class="anchor_link">
@@ -3,7 +3,6 @@
3
3
  <div class="col-md-10 mx-auto ws">
4
4
  <div style="font-size: 15px;" class="alert errMessage" role="alert"></div>
5
5
  <form name="verify" class="forms_data">
6
-
7
6
  <div class="form-group">
8
7
  <label for="greenLetters" class="my-1 p-0 wordleSolver-label">Enter green letters at correct
9
8
  position</label>
@@ -31,19 +30,19 @@
31
30
  <label for="yellowLetters" class="my-1 p-0 wordleSolver-label">Enter letters in yellow below</label>
32
31
  <div class="col-md-6 p-0">
33
32
  <div class="d-flex">
34
- <input type="text" autocomplete="off" tabIndex="1"
33
+ <input data-id="0" type="text" autocomplete="off"
35
34
  class="wordleSolver-field yellowLetters form-control px-5" maxlength="1" id="six"
36
35
  tabIndex="5" onkeyup="move(this,'seven')">
37
- <input type="text" autocomplete="off"
36
+ <input data-id="1" type="text" autocomplete="off"
38
37
  class="wordleSolver-field yellowLetters form-control px-5" maxlength="1" id="seven"
39
38
  tabIndex="6" onkeyup="move(this,'eight')">
40
- <input type="text" autocomplete="off"
39
+ <input data-id="2" type="text" autocomplete="off"
41
40
  class="wordleSolver-field yellowLetters form-control px-5" maxlength="1" id="eight"
42
41
  tabIndex="7" onkeyup="move(this,'nine')">
43
- <input type="text" autocomplete="off"
42
+ <input data-id="3" type="text" autocomplete="off"
44
43
  class="wordleSolver-field yellowLetters form-control px-5" maxlength="1" id="nine"
45
44
  tabIndex="8" onkeyup="move(this,'ten')">
46
- <input type="text" autocomplete="off"
45
+ <input data-id="4" type="text" autocomplete="off"
47
46
  class="wordleSolver-field yellowLetters form-control px-5" maxlength="1" id="ten"
48
47
  tabIndex="9" onkeyup="move(this,'eleven')">
49
48
  </div>
@@ -53,31 +52,36 @@
53
52
  <label for="greyLetters" class="my-1 p-0 wordleSolver-label">Enter letters in grey below</label>
54
53
  <div class="col-md-6 p-0 wrapper_div">
55
54
  <div class="d-flex">
56
- <input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
57
- id="eleven" value="" autocomplete="off" tabIndex="10" onkeyup="move(this,'twelve')">
58
- <input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
59
- id="twelve" value="" autocomplete="off" tabIndex="11" onkeyup="move(this,'thirteen')">
60
- <input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
61
- id="thirteen" value="" autocomplete="off" tabIndex="12" onkeyup="move(this,'fourteen')">
62
- <input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
63
- id="fourteen" value="" autocomplete="off" tabIndex="13" onkeyup="move(this,'fifteen')">
64
- <input type="text" class="wordleSolver-field greyLetters form-control px-5" maxlength="1"
65
- id="fifteen" value="" autocomplete="off" tabIndex="14" onkeyup="move(this,'sixteen')">
55
+ <input data-id="0" type="text" class="wordleSolver-field greyLetters form-control px-5"
56
+ maxlength="1" id="eleven" value="" autocomplete="off" tabIndex="10"
57
+ onkeyup="move(this,'twelve')">
58
+ <input data-id="1" type="text" class="wordleSolver-field greyLetters form-control px-5"
59
+ maxlength="1" id="twelve" value="" autocomplete="off" tabIndex="11"
60
+ onkeyup="move(this,'thirteen')">
61
+ <input data-id="2" type="text" class="wordleSolver-field greyLetters form-control px-5"
62
+ maxlength="1" id="thirteen" value="" autocomplete="off" tabIndex="12"
63
+ onkeyup="move(this,'fourteen')">
64
+ <input data-id="3" type="text" class="wordleSolver-field greyLetters form-control px-5"
65
+ maxlength="1" id="fourteen" value="" autocomplete="off" tabIndex="13"
66
+ onkeyup="move(this,'fifteen')">
67
+ <input data-id="4" type="text" class="wordleSolver-field greyLetters form-control px-5"
68
+ maxlength="1" id="fifteen" value="" autocomplete="off" tabIndex="14"
69
+ onkeyup="move(this,'sixteen')">
66
70
  </div>
67
71
  <div class="d-flex mt-2">
68
- <input type="text" autocomplete="off" tabIndex="15"
72
+ <input data-id="5" type="text" autocomplete="off" tabIndex="15"
69
73
  class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="sixteen"
70
74
  onkeyup="move(this,'seventeen')">
71
- <input type="text" autocomplete="off" tabIndex="16"
75
+ <input data-id="6" type="text" autocomplete="off" tabIndex="16"
72
76
  class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="seventeen"
73
77
  onkeyup="move(this,'eightteen')">
74
- <input type="text" autocomplete="off" tabIndex="17"
78
+ <input data-id="7" type="text" autocomplete="off" tabIndex="17"
75
79
  class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="eightteen"
76
80
  onkeyup="move(this,'nineteen')">
77
- <input type="text" autocomplete="off" tabIndex="18"
81
+ <input data-id="8" type="text" autocomplete="off" tabIndex="18"
78
82
  class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="nineteen"
79
83
  onkeyup="move(this,'twenty')">
80
- <input type="text" autocomplete="off" tabIndex="19"
84
+ <input data-id="9" type="text" autocomplete="off" tabIndex="19"
81
85
  class="wordleSolver-field greyLetters form-control px-5" maxlength="1" id="twenty"
82
86
  onkeyup="move(this,'eleven')">
83
87
  </div>
@@ -142,5 +146,4 @@
142
146
  document.getElementById(last).focus()
143
147
  }
144
148
  }
145
- </script>
146
- <script defer src="/assets/js/wordleSolver.js"></script>
149
+ </script>
@@ -138,13 +138,14 @@
138
138
  color:#fff !important
139
139
  }
140
140
  .createWordleLink{
141
+ text-decoration: underline;
141
142
  text-align: center;
142
143
  display: block;
143
144
  box-shadow: 0 0 1px rgb(0 0 0 / 10%);
144
145
  border: none;
145
146
  padding: 10px 15px;
146
147
  width: 320px;
147
- background: #90ee90;
148
+ background: #345234;
148
149
  border-radius: 20px;
149
150
  font-size: 15px;
150
151
  margin-bottom: 2rem;
Binary file
Binary file
@@ -1,131 +1,11 @@
1
- // console.log('wordle solver ...')
2
-
1
+ let getScript = document.currentScript
2
+ let fileName = getScript.dataset.filename
3
+ let permalink = getScript.dataset.permalink
3
4
  let form = document.querySelector('[name=verify')
4
-
5
5
  let greenLetters = document.querySelectorAll('.greenLetters')
6
6
  let yellowLetters = document.querySelectorAll('.yellowLetters')
7
7
  let greyLetters = document.querySelectorAll('.greyLetters')
8
- let wordleSolverData = document.getElementById('wordleSolverData')
9
8
  greenLetters[0].focus()
10
- let wordleWordCount = document.querySelector('#wordleWordCount')
11
- let wordleSolvererrorMsg = document.querySelector('#wordleSolvererrorMsg')
12
- let wordlesolver_submit = document.getElementById('wordlesolver_submit')
13
- let newWordsLength = 0
14
-
15
- let errMessage = document.querySelector('.errMessage')
16
- let wrapper_div = document.querySelector('.wrapper_div')
17
-
18
-
19
-
20
- // let addMore = document.querySelector('#addMore')
21
-
22
- // addMore.addEventListener('click', (e) => {
23
- // e.preventDefault()
24
- // let div = document.createElement('div')
25
- // div.classList.add('d-flex')
26
- // div.classList.add('mt-2')
27
-
28
- // for (let i = 20; i <= 24; i++) {
29
- // let input = document.createElement('input')
30
- // input.type = 'text'
31
- // input.setAttribute('maxlength', '1')
32
- // input.setAttribute('autocomplete', 'off')
33
- // if (i <= 24) {
34
- // input.setAttribute('tabIndex', i)
35
- // }
36
- // let classes = ['wordleSolver-field', 'greyLetters', 'form-control', 'px-5']
37
- // input.classList.add(...classes)
38
- // input.id = 'greyLetters'
39
- // div.append(input)
40
- // wrapper_div.append(div)
41
- // }
42
- // })
43
-
44
- let spinner = document.querySelector('.spinner')
45
- const wordleSolver = async (value, value2, value3, greenWithIndex) => {
46
- try {
47
- let result = ''
48
- document.querySelector('#updateTxt').innerHTML = ''
49
- spinner.classList.add('spinner-border')
50
- wordleWordCount.innerHTML = 'Searching for best possible letters...'
51
- let response = await fetch('/.netlify/functions/wordleSolver', {
52
- method: 'POST',
53
- body: JSON.stringify({
54
- greenLetters: value,
55
- yellowLetters: value2,
56
- greyLetters: value3,
57
- greenWithIndex: greenWithIndex,
58
- }),
59
- })
60
- let data = await response.json()
61
- data = data.slice(0, 1000)
62
- document.querySelector('#updateTxt').innerHTML = 'Solve'
63
- spinner.classList.remove('spinner-border')
64
-
65
- let ok = true
66
- if (data.length === 0) {
67
- newWordsLength = ''
68
- wordleSolverData.innerHTML = ''
69
- wordleSolvererrorMsg.classList.add('alert-danger')
70
- wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
71
- wordleWordCount.style.display = 'none'
72
- // console.log(wordleWordCount)
73
- } else {
74
- wordleWordCount.style.display = 'block'
75
- wordleSolverData.innerHTML = ''
76
- wordleSolvererrorMsg.classList.remove('alert-danger')
77
- wordleSolvererrorMsg.innerHTML = ''
78
- newWordsLength = ''
79
- newWordsLength += data.length
80
- result = data.map((item) => {
81
- if (item.length === 1) {
82
- ok = false
83
- newWordsLength = newWordsLength - 1
84
- } else {
85
- // console.log(newWordsLength);
86
- let ScrabbleLetterScore = ScrabbleScore()
87
- sum = 0
88
- item = item.toLowerCase()
89
- for (let i = 0; i < item.length; i++) {
90
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
91
- }
92
- return `
93
- <a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
94
- <li>
95
- ${item.toLowerCase()}
96
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
97
- </li>
98
- </a>
99
- `
100
- }
101
- })
102
- if (ok) {
103
- wordleSolverData.innerHTML += `
104
- <div class="allfiveletterswords wordlistContainer">
105
- <div class="wordListHeading">
106
- <h3 class="lead">Solve wordle with these words</h3>
107
- </div>
108
- <div class="wordList">
109
- <ul class="ul list-unstyled">
110
- ${result.join('')}
111
- </ul>
112
- </div>
113
- </div>
114
- `
115
- }
116
- }
117
-
118
- if (newWordsLength === 0) {
119
- console.log(true)
120
- wordleSolvererrorMsg.classList.add('alert-danger')
121
- wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
122
- } else {
123
- wordleWordCount.innerHTML = `<strong>Found <span style="color:#20a815">${newWordsLength}</span> matching words for wordle</strong>`
124
- }
125
- } catch (error) {
126
- console.log(error)
127
- }
128
- }
129
9
 
130
10
  for (let g = 0; g < greenLetters.length; g++) {
131
11
  const elem = greenLetters[g]
@@ -161,101 +41,34 @@ for (let e = 0; e < greyLetters.length; e++) {
161
41
  })
162
42
  }
163
43
 
164
- const getLetters = (object) => {
165
- let letters = []
166
- if (typeof object === 'string') {
167
- object = document.querySelectorAll(object)
168
- }
169
- for (let item of object) {
170
- if (item.value.trim().length === 1) {
171
- letters.push(item.value.toLowerCase())
172
- }
173
- }
174
- return letters
175
- }
176
- const getIndexs = (object) => {
177
- let index = []
178
- if (typeof object === 'string') {
179
- object = document.querySelectorAll(object)
180
- }
181
- for (let item of object) {
182
- if (item.value.trim().length === 1) {
183
- index.push({
184
- value: item.value.toLowerCase(),
185
- index: item.dataset.id,
186
- })
187
- }
188
- }
189
- return index
190
- }
191
-
192
44
  function handleSubmit(e) {
193
- document.querySelector(".refineSerach").style.display = "block"
194
45
  e.preventDefault()
46
+ let corretLettterArray = []
47
+ Array.from(greenLetters).map((item) => {
48
+ if (!item.value) {
49
+ corretLettterArray.push(item.value.replace("", "_"))
50
+ } else {
51
+ corretLettterArray.push(item.value)
52
+ }
53
+ })
54
+ let includesLettterArray = []
55
+ Array.from(yellowLetters).map((item) => {
56
+ if (!item.value) {
57
+ includesLettterArray.push(item.value.replace("", "_"))
58
+ } else {
59
+ includesLettterArray.push(item.value)
60
+ }
61
+ })
62
+ let exculdesLettterArray = []
63
+ Array.from(greyLetters).map((item) => {
64
+ if (!item.value) {
65
+ exculdesLettterArray.push(item.value.replace("", "_"))
66
+ } else {
67
+ exculdesLettterArray.push(item.value)
68
+ }
69
+ })
195
70
 
196
- let wordleSolverData = document.querySelector("#wordleSolverData")
197
- const scrollingElement = (document.scrollingElement || document.body);
198
-
199
- scrollingElement.scroll({ top: 515, behavior: 'smooth' });
200
-
201
- let greenLetter = getLetters('.greenLetters')
202
- let yellowLetters = getLetters('.yellowLetters')
203
- let greyLetters = getLetters('.greyLetters')
204
- let greenWithIndex = getIndexs('.greenWithIndex')
205
-
206
- // if (
207
- // greenLetters[0].value !== '' ||
208
- // greenLetters[1].value !== '' ||
209
- // greenLetters[2].value !== '' ||
210
- // greenLetters[3].value !== '' ||
211
- // greenLetters[4].value !== ''
212
- // ) {
213
- // errMessage.innerHTML = ''
214
- // errMessage.classList.remove('alert-danger')
215
- // errMessage.style.display = 'none'
216
- wordleSolver(greenLetter, yellowLetters, greyLetters, greenWithIndex)
217
- // } else {
218
- // errMessage.innerHTML = 'You must enter at least 1 green letter'
219
- // errMessage.classList.add('alert-danger')
220
- // errMessage.style.display = 'block'
221
- // }
222
- }
223
- document.querySelector(".refineSerach").addEventListener("click", () => {
224
- const scrollingElement = (document.scrollingElement || document.body);
225
-
226
- scrollingElement.scroll({ top: 0, behavior: 'smooth' });
227
- })
228
- form.addEventListener('submit', handleSubmit)
229
-
230
- // Scrabble Point Array
231
- const ScrabbleScore = () => {
232
- let twl06_sowpods = {
233
- a: 1,
234
- e: 1,
235
- i: 1,
236
- o: 1,
237
- u: 1,
238
- l: 1,
239
- n: 1,
240
- r: 1,
241
- s: 1,
242
- t: 1,
243
- d: 2,
244
- g: 2,
245
- b: 3,
246
- c: 3,
247
- m: 3,
248
- p: 3,
249
- f: 4,
250
- h: 4,
251
- v: 4,
252
- w: 4,
253
- y: 4,
254
- k: 5,
255
- j: 8,
256
- x: 8,
257
- q: 10,
258
- z: 10,
259
- }
260
- return twl06_sowpods
71
+ window.location = `/${permalink}/result` + '?' + "correct" + "=" + corretLettterArray.join("")
72
+ + '&includes' + '=' + includesLettterArray.join("") + "&excludes" + '=' + exculdesLettterArray.join("")
261
73
  }
74
+ form.addEventListener('submit', handleSubmit)
@@ -0,0 +1,328 @@
1
+ let form = document.querySelector('[name=verify')
2
+
3
+ let greenLetters = document.querySelectorAll('.greenLetters')
4
+ let yellowLetters = document.querySelectorAll('.yellowLetters')
5
+ let greyLetters = document.querySelectorAll('.greyLetters')
6
+ let wordleSolverData = document.getElementById('wordleSolverData')
7
+ greenLetters[0].focus()
8
+ let wordleWordCount = document.querySelector('#wordleWordCount')
9
+ let wordleSolvererrorMsg = document.querySelector('#wordleSolvererrorMsg')
10
+ let wordlesolver_submit = document.getElementById('wordlesolver_submit')
11
+ let newWordsLength = 0
12
+
13
+ let errMessage = document.querySelector('.errMessage')
14
+ let wrapper_div = document.querySelector('.wrapper_div')
15
+
16
+ const params = new URLSearchParams(window.location.search)
17
+ let correct = params.get('correct')
18
+ let includes = params.get('includes')
19
+ let excludes = params.get('excludes')
20
+
21
+
22
+ // let addMore = document.querySelector('#addMore')
23
+
24
+ // addMore.addEventListener('click', (e) => {
25
+ // e.preventDefault()
26
+ // let div = document.createElement('div')
27
+ // div.classList.add('d-flex')
28
+ // div.classList.add('mt-2')
29
+
30
+ // for (let i = 20; i <= 24; i++) {
31
+ // let input = document.createElement('input')
32
+ // input.type = 'text'
33
+ // input.setAttribute('maxlength', '1')
34
+ // input.setAttribute('autocomplete', 'off')
35
+ // if (i <= 24) {
36
+ // input.setAttribute('tabIndex', i)
37
+ // }
38
+ // let classes = ['wordleSolver-field', 'greyLetters', 'form-control', 'px-5']
39
+ // input.classList.add(...classes)
40
+ // input.id = 'greyLetters'
41
+ // div.append(input)
42
+ // wrapper_div.append(div)
43
+ // }
44
+ // })
45
+
46
+ let spinner = document.querySelector('.spinner')
47
+ const wordleSolver = async (value, value2, value3, greenWithIndex) => {
48
+ try {
49
+ let result = ''
50
+ document.querySelector('#updateTxt').innerHTML = ''
51
+ spinner.classList.add('spinner-border')
52
+ wordleWordCount.innerHTML = 'Searching for best possible letters...'
53
+ let response = await fetch('/.netlify/functions/wordleSolver', {
54
+ method: 'POST',
55
+ body: JSON.stringify({
56
+ greenLetters: value,
57
+ yellowLetters: value2,
58
+ greyLetters: value3,
59
+ greenWithIndex: greenWithIndex,
60
+ }),
61
+ })
62
+ let data = await response.json()
63
+ data = data.slice(0, 1000)
64
+ document.querySelector('#updateTxt').innerHTML = 'Solve'
65
+ spinner.classList.remove('spinner-border')
66
+
67
+ let ok = true
68
+ if (data.length === 0) {
69
+ newWordsLength = ''
70
+ wordleSolverData.innerHTML = ''
71
+ wordleSolvererrorMsg.classList.add('alert-danger')
72
+ wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
73
+ wordleWordCount.style.display = 'none'
74
+ // console.log(wordleWordCount)
75
+ } else {
76
+ wordleWordCount.style.display = 'block'
77
+ wordleSolverData.innerHTML = ''
78
+ wordleSolvererrorMsg.classList.remove('alert-danger')
79
+ wordleSolvererrorMsg.innerHTML = ''
80
+ newWordsLength = ''
81
+ newWordsLength += data.length
82
+ result = data.map((item) => {
83
+ if (item.length === 1) {
84
+ ok = false
85
+ newWordsLength = newWordsLength - 1
86
+ } else {
87
+ // console.log(newWordsLength);
88
+ let ScrabbleLetterScore = ScrabbleScore()
89
+ sum = 0
90
+ item = item.toLowerCase()
91
+ for (let i = 0; i < item.length; i++) {
92
+ sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
93
+ }
94
+ return `
95
+ <a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
96
+ <li>
97
+ ${item.toLowerCase()}
98
+ <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
99
+ </li>
100
+ </a>
101
+ `
102
+ }
103
+ })
104
+ if (ok) {
105
+ wordleSolverData.innerHTML += `
106
+ <div class="allfiveletterswords wordlistContainer">
107
+ <div class="wordListHeading">
108
+ <h3 class="lead">Solve wordle with these words</h3>
109
+ </div>
110
+ <div class="wordList">
111
+ <ul class="ul list-unstyled">
112
+ ${result.join('')}
113
+ </ul>
114
+ </div>
115
+ </div>
116
+ `
117
+ }
118
+ }
119
+
120
+ if (newWordsLength === 0) {
121
+ console.log(true)
122
+ wordleSolvererrorMsg.classList.add('alert-danger')
123
+ wordleSolvererrorMsg.innerHTML = 'Sorry!! No words found'
124
+ } else {
125
+ wordleWordCount.innerHTML = `<strong>Found <span style="color:#20a815">${newWordsLength}</span> matching words for wordle</strong>`
126
+ }
127
+ } catch (error) {
128
+ console.log(error)
129
+ }
130
+ }
131
+
132
+ for (let g = 0; g < greenLetters.length; g++) {
133
+ const elem = greenLetters[g]
134
+ let values = correct.split("")
135
+ values.map((item, index) => {
136
+ if (Number(elem.dataset.id) === index) {
137
+ elem.value = item.replace("_", "")
138
+ if (elem.value != "") {
139
+ elem.classList.add('ws-fcs')
140
+ }
141
+ }
142
+ })
143
+ elem.addEventListener('input', (e) => {
144
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
145
+ if (e.target.value) {
146
+ e.target.classList.add('ws-fcs')
147
+ } else {
148
+ e.target.classList.remove('ws-fcs')
149
+ }
150
+ })
151
+ }
152
+ for (let y = 0; y < yellowLetters.length; y++) {
153
+ const elem = yellowLetters[y]
154
+ let values = includes.split("")
155
+ values.map((item, index) => {
156
+ if (Number(elem.dataset.id) === index) {
157
+ elem.value = item.replace("_", "")
158
+ if (elem.value != "") {
159
+ elem.classList.add('ws-fcs2')
160
+ }
161
+ }
162
+ })
163
+ elem.addEventListener('input', (e) => {
164
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
165
+ if (e.target.value) {
166
+ e.target.classList.add('ws-fcs2')
167
+ } else {
168
+ e.target.classList.remove('ws-fcs2')
169
+ }
170
+ })
171
+ }
172
+ for (let e = 0; e < greyLetters.length; e++) {
173
+ const elem = greyLetters[e]
174
+ let values = excludes.split("")
175
+ values.map((item, index) => {
176
+ if (Number(elem.dataset.id) === index) {
177
+ elem.value = item.replace("_", "")
178
+ if (elem.value != "") {
179
+ elem.classList.add('ws-fcs3')
180
+ }
181
+ }
182
+ })
183
+
184
+ elem.addEventListener('input', (e) => {
185
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
186
+ if (e.target.value) {
187
+ e.target.classList.add('ws-fcs3')
188
+ } else {
189
+ e.target.classList.remove('ws-fcs3')
190
+ }
191
+ })
192
+ }
193
+
194
+ const getLetters = (object) => {
195
+ let letters = []
196
+ if (typeof object === 'string') {
197
+ object = document.querySelectorAll(object)
198
+ }
199
+ for (let item of object) {
200
+ if (item.value.trim().length === 1) {
201
+ letters.push(item.value.toLowerCase())
202
+ }
203
+ }
204
+ return letters
205
+ }
206
+ const getIndexs = (object) => {
207
+ let index = []
208
+ if (typeof object === 'string') {
209
+ object = document.querySelectorAll(object)
210
+ }
211
+ for (let item of object) {
212
+ if (item.value.trim().length === 1) {
213
+ index.push({
214
+ value: item.value.toLowerCase(),
215
+ index: item.dataset.id,
216
+ })
217
+ }
218
+ }
219
+ return index
220
+ }
221
+
222
+
223
+ function handleSubmit(e) {
224
+ e.preventDefault()
225
+ document.querySelector(".refineSerach").style.display = "block"
226
+ const scrollingElement = (document.scrollingElement || document.body);
227
+ scrollingElement.scroll({ top: 515, behavior: 'smooth' });
228
+
229
+ let greenWithIndex = getIndexs('.greenWithIndex')
230
+
231
+ let corretLettterArray = []
232
+ let getGreenLetters = []
233
+ Array.from(greenLetters).map((item) => {
234
+ if (!item.value) {
235
+ corretLettterArray.push(item.value.replace("", "_"))
236
+ } else {
237
+ getGreenLetters.push(item.value)
238
+ corretLettterArray.push(item.value)
239
+ }
240
+ })
241
+ let includesLettersArray = []
242
+ let getYellowLetters = []
243
+ Array.from(yellowLetters).map((item) => {
244
+ if (!item.value) {
245
+ console.log(item.value)
246
+ includesLettersArray.push(item.value.replace("", "_"))
247
+ } else {
248
+ getYellowLetters.push(item.value)
249
+ includesLettersArray.push(item.value)
250
+ }
251
+ })
252
+ let excludesLettersArray = []
253
+ let getGreyLetters = []
254
+ Array.from(greyLetters).map((item) => {
255
+ if (!item.value) {
256
+ excludesLettersArray.push(item.value.replace("", "_"))
257
+ } else {
258
+ getGreyLetters.push(item.value)
259
+ excludesLettersArray.push(item.value)
260
+ }
261
+ })
262
+
263
+ if (history.pushState) {
264
+ var newurl = window.location.protocol + "//" + window.location.host +
265
+ window.location.pathname + '?' + "correct" + "=" + corretLettterArray.join("")
266
+ + '&includes' + '=' + includesLettersArray.join("") + "&excludes" + '=' + excludesLettersArray.join("")
267
+ window.history.pushState({ path: newurl }, '', newurl);
268
+
269
+ const params = new URLSearchParams(window.location.search)
270
+ let correct = params.get('correct')
271
+ let includes = params.get('includes')
272
+ let excludes = params.get('excludes')
273
+
274
+ gtag('event', 'page_view', {
275
+ page_location: window.location.pathname + location.search,
276
+ })
277
+ }
278
+ wordleSolver(getGreenLetters, getYellowLetters, getGreyLetters, greenWithIndex)
279
+ }
280
+
281
+
282
+ if (correct === "" && includes === "" && excludes === "") {
283
+ const scrollingElement = (document.scrollingElement || document.body);
284
+ scrollingElement.scroll({ top: 515, behavior: 'smooth' });
285
+ wordleSolver("", "", "", "")
286
+ } else {
287
+ window.onload = function (e) {
288
+ handleSubmit(e);
289
+ };
290
+ form.addEventListener('submit', handleSubmit)
291
+ }
292
+
293
+ document.querySelector(".refineSerach").addEventListener("click", () => {
294
+ const scrollingElement = (document.scrollingElement || document.body);
295
+ scrollingElement.scroll({ top: 0, behavior: 'smooth' });
296
+ })
297
+
298
+ const ScrabbleScore = () => {
299
+ let twl06_sowpods = {
300
+ a: 1,
301
+ e: 1,
302
+ i: 1,
303
+ o: 1,
304
+ u: 1,
305
+ l: 1,
306
+ n: 1,
307
+ r: 1,
308
+ s: 1,
309
+ t: 1,
310
+ d: 2,
311
+ g: 2,
312
+ b: 3,
313
+ c: 3,
314
+ m: 3,
315
+ p: 3,
316
+ f: 4,
317
+ h: 4,
318
+ v: 4,
319
+ w: 4,
320
+ y: 4,
321
+ k: 5,
322
+ j: 8,
323
+ x: 8,
324
+ q: 10,
325
+ z: 10,
326
+ }
327
+ return twl06_sowpods
328
+ }
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: 1.3.2
4
+ version: 1.3.5
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-06-06 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -128,6 +128,7 @@ files:
128
128
  - _data/wordgames/zh-TW/four_letter_word_finder.json
129
129
  - _data/wordgames/zh/four_letter_word_finder.json
130
130
  - _data/wordleSolver/en/data.json
131
+ - _data/wordleSolver/en/resultData.json
131
132
  - _data/xyzPagesData/en/unscramble-letters-jumble.json
132
133
  - _data/xyzPagesData/en/words-with-letters-cheat.json
133
134
  - _includes/Monumetric/Monumetric.html
@@ -223,6 +224,7 @@ files:
223
224
  - assets/images/adblock.svg
224
225
  - assets/images/alka.webp
225
226
  - assets/images/angle-arrow-down.svg
227
+ - assets/images/balark.jpeg
226
228
  - assets/images/bg_elements.png
227
229
  - assets/images/bg_elements.svg
228
230
  - assets/images/board-game.png
@@ -268,6 +270,7 @@ files:
268
270
  - assets/images/twitter.svg
269
271
  - assets/images/twitter2.svg
270
272
  - assets/images/twitters.svg
273
+ - assets/images/udit.jpg
271
274
  - assets/images/uo.svg
272
275
  - assets/images/whatsapp.svg
273
276
  - assets/images/window-close.png
@@ -294,6 +297,7 @@ files:
294
297
  - assets/js/wordScrabble-test.js
295
298
  - assets/js/wordScrabble.js
296
299
  - assets/js/wordleSolver.js
300
+ - assets/js/wordleSolverResult.js
297
301
  - assets/js/words-in-certain-positions.js
298
302
  - assets/js/words-starting-with.js
299
303
  - assets/js/xyz.js