word-games-theme 2.8.2 → 2.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17543ce741f1baf1603be070f547faa129ea0b2703492c0fa418cbea54fbd50a
4
- data.tar.gz: d8b0b9bd3b601d0a247d0c12d138bbd42c9897cf4cb40992624c384f8b6b83ba
3
+ metadata.gz: a6367a031ec15597ddaa8085ad720bce6860d7a9ea82650404a08d72c491e6ae
4
+ data.tar.gz: 2735da574dbc2e932009f362a65ddc827619307db80a0aa0470214fbf2abdae1
5
5
  SHA512:
6
- metadata.gz: 405d3f0bccfa8c5ba69aab5c1ef9e1c4208266a1a29f6e4f3425f5ebaa4578087d070c5cc5857fa446eaeb01b3818768003a9cf2f227c0391157ade011a05d5a
7
- data.tar.gz: a41b7171d014c4c82036d7935f61c8000d5b3ac06f2b8b37aef9698bad619dc3aa2d502ba07154d599fe28eba85b5b8f39e8482f2bc0439ebea9be880f2326b5
6
+ metadata.gz: 3bc991a069dacebbca46afcd0ccf7d66b0be7db58fd2a359fa0479816f902bf70fa729b1e2da09a4835bdcbae8ea0abd70a4b22ba41baff4367659f43890119f
7
+ data.tar.gz: 16b9857eb15cc4827041514b6e3e39be00bef5dcd3e341958eefe06209bcc6d517412b2daa97397fb4e38114a1f0a1e70b5b87afa59434b52a57de28cda9c02d
@@ -41,14 +41,13 @@
41
41
  </div>
42
42
  <div class="sortingFilters wrapper_dropDown justify-content-end" style="gap:10px; display: none;">
43
43
 
44
- {%- if page.letter == nil -%}
44
+
45
45
  <div class="letter-length">
46
46
  <select class="form-select length-select">
47
47
  <option selected="true" hidden>Letter Length</option>
48
48
  </select>
49
49
  </div>
50
- {%- endif -%}
51
-
50
+
52
51
  <div id="sort-select">
53
52
  <select class="form-select sort-select" id="select_dropDown">
54
53
  <option selected="true" hidden id="alpha" value="alpha">Sort by</option>
@@ -87,10 +87,7 @@
87
87
 
88
88
 
89
89
  <script defer src="/assets/js/theme.js"></script>
90
-
91
- {%- if site.noResultPage and page.letter-%}
92
- <script defer src="/assets/js/xletter-home.js"></script>
93
- {%- elsif site.noResultPage -%}
90
+ {%- if site.noResultPage -%}
94
91
  <script defer src="/assets/js/wordfinder-home.js"></script>
95
92
  {%- else -%}
96
93
  <script defer src="/assets/js/wordgames-home.js"></script>
@@ -4,6 +4,7 @@
4
4
 
5
5
 
6
6
  /* show more button */
7
+
7
8
  .showmore_btn {
8
9
  background: black;
9
10
  padding: 1rem 2rem;
@@ -11,6 +12,8 @@
11
12
  color: #fff;
12
13
  font-size: 15px;
13
14
  border: none;
15
+ position: relative;
16
+ z-index: 9999;
14
17
  }
15
18
  .points{
16
19
  position:relative; top:4px; font-size:12px
@@ -348,6 +351,7 @@ input:-webkit-autofill:active {
348
351
  color: #fff;
349
352
  }
350
353
 
354
+
351
355
  .wordListHeading>h3 {
352
356
  font-size: 20px;
353
357
  font-weight: 600;
@@ -68,22 +68,28 @@ small {
68
68
  color: #fff;
69
69
  }
70
70
 
71
- .letterswords {
72
- background-color: white !important;
73
- width: 75%;
74
- margin: 15px auto;
75
- height: auto;
76
- box-shadow: 0 0 2px rgb(0 0 0 / 20%);
77
- /* margin: 10px 0; */
78
- border-radius: 15px;
71
+ .wordList {
72
+ padding: 15px;
73
+ display: inline-flex;
74
+ width: 100%;
75
+ flex-wrap: wrap;
79
76
  }
80
77
 
81
- .letterswords>.wordListHeading {
82
- background: gray;
83
- padding: 10px 0px 5px 25px;
84
- color: #fff;
85
- border-top-right-radius: 15px;
86
- border-top-left-radius: 15px;
78
+ .wordList .anchor__style {
79
+ color: #000 !important;
80
+ font-size: 15px;
81
+ text-decoration: none !important;
82
+ font-weight: 600;
83
+ list-style: none;
84
+ padding: 8px;
85
+ background: #f8f9fa;
86
+ border-radius: 5px;
87
+ margin: 6px 6px;
88
+ width: auto;
89
+ /* min-width: 100px; */
90
+ text-align: center;
91
+ border: solid 1px var(--black-color);
92
+ box-shadow: 2px 2px 1px 0px var(--black-color);
87
93
  }
88
94
 
89
95
  .wordListHeading>.lead {
@@ -92,7 +98,7 @@ small {
92
98
 
93
99
  #certain_pos_count {
94
100
  font-size: 16px;
95
- width: 75%;
101
+ /* width: 75%; */
96
102
  margin: 10px auto;
97
103
  }
98
104
 
@@ -101,9 +107,6 @@ small {
101
107
  width: 75%;
102
108
  }
103
109
 
104
- .certainWordsList {
105
- padding: 15px;
106
- }
107
110
 
108
111
  .certainWordsList>ul {
109
112
  display: inline-flex;
@@ -122,12 +125,6 @@ small {
122
125
  text-align: center;
123
126
  }
124
127
 
125
- .certainWordsList .anchor__style {
126
- color: #000 !important;
127
- font-size: 15px;
128
- text-decoration: none !important;
129
- font-weight: 600;
130
- }
131
128
 
132
129
  .tab_link_wrapper {
133
130
  position: sticky !important;
@@ -140,6 +137,7 @@ small {
140
137
  background: #f8f9fa;
141
138
  border-radius: 40px;
142
139
  padding: 8px;
140
+ border: 2px solid var(--black-color);
143
141
  /* white-space: wrap; */
144
142
  }
145
143
 
@@ -173,7 +171,7 @@ small {
173
171
  padding: 3px;
174
172
  border: none;
175
173
  position: absolute;
176
- top: 15px;
174
+ top: 15px !important;
177
175
  right: 43px;
178
176
  }
179
177
 
@@ -185,7 +183,7 @@ small {
185
183
  padding: 3px;
186
184
  border: none;
187
185
  position: absolute;
188
- top: 15px;
186
+ top: 15px !important;
189
187
  left: 43px;
190
188
  }
191
189
 
@@ -199,6 +197,10 @@ small {
199
197
  font-size: 13px;
200
198
  }
201
199
 
200
+ .tab_link_wrapper .tab_link{
201
+ font-size: 14px !important;
202
+ }
203
+
202
204
  .allfiveletterswords,
203
205
  #certain_pos_count,
204
206
  .letterswords {
@@ -37,6 +37,22 @@ let theSelect = document.getElementById("select_dropDown");
37
37
  let sortingFilter = document.querySelector("#select_dropDown");
38
38
  const sortup = document.querySelector(".sortup-icon");
39
39
  let bool = false;
40
+
41
+
42
+ // const serachSection = document.querySelector(".serachSection")
43
+ const letterLen = serachSection.dataset.letter
44
+ const ablank = serachSection.dataset.ablank
45
+
46
+ if (ablank) {
47
+ if (!serachValue.includes("?")) {
48
+ if (serachValue.length <= letterLen || serachValue.length >= letterLen) {
49
+ serachValue = serachValue + '?'
50
+ txtBox.value = serachValue
51
+ }
52
+ }
53
+ }
54
+
55
+
40
56
  sortup.addEventListener("click", () => {
41
57
  if (bool) {
42
58
  theSelect.size = 0;
@@ -75,8 +91,11 @@ let authorsLists = document.querySelector(".authors-list")
75
91
  let serachBtn = document.querySelector(".serachBtn")
76
92
  let searchBtnContainer = document.querySelector(".search-btn-container")
77
93
 
94
+ let home_page_search_result = document.querySelector("#home_page_search_result")
95
+ let homePageSearchResult = `/?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
96
+
78
97
  // getWords define...
79
- const worker = new Worker('./assets/js/wordfinder-worker.js');
98
+ const worker = new Worker('/assets/js/wordfinder-worker.js');
80
99
  const getData = async (serachValue) => {
81
100
  try {
82
101
  document.querySelector(".main-header").style.background = "#fff"
@@ -301,6 +320,14 @@ function getWords(data) {
301
320
  lengthSelect.add(option);
302
321
  lengthSelect.style.display = "block"
303
322
  }
323
+
324
+
325
+ if(letterLen){
326
+ home_page_search_result.href = homePageSearchResult
327
+ home_page_search_result.innerHTML = `See words of any length with letters ${serachValue.split("")}`
328
+ }
329
+
330
+
304
331
  main.innerHTML += `
305
332
  <div class="allGroupWords wordlistContainer" id="alpha_${i}">
306
333
  <h3 class="wordListHeading lead">${i} Letter Words</h3>
@@ -14,6 +14,8 @@ let tab_link_wrapper = document.querySelector(".tab_link_wrapper")
14
14
  tab_link_wrapper.style.marginTop = "1rem"
15
15
  tab_link_wrapper.style.display = "none"
16
16
 
17
+
18
+ const worker = new Worker('/assets/js/words-in-certain-positions-worker.js');
17
19
  const wordsInCertainPos = async (letters, lettersWithIndex, wordLength) => {
18
20
  let maxLength = Math.max.apply(null, wordLength);
19
21
  // maxLength = maxLength + 1
@@ -22,101 +24,61 @@ const wordsInCertainPos = async (letters, lettersWithIndex, wordLength) => {
22
24
  document.querySelector('#searchData').innerHTML = ''
23
25
  spinner.classList.add('spinner-border')
24
26
  certain_pos_count.innerHTML = 'Finding words in certain position...'
25
- let response = await fetch('/.netlify/functions/wordsInCertainPositions', {
27
+
28
+ worker.postMessage({
29
+ type: "api",
26
30
  method: 'POST',
27
- body: JSON.stringify({
28
- greenLetters: letters,
29
- greenWithIndex: lettersWithIndex,
30
- }),
31
- })
32
- let data = await response.json()
33
- console.log(data);
34
-
35
- if (data.length == 0) {
36
- errMessage.innerHTML = 'Sorry!! No words found'
37
- errMessage.classList.add('alert-danger')
38
- errMessage.style.display = 'block'
39
- document.querySelector('#searchData').innerHTML = 'Search'
40
- spinner.classList.remove('spinner-border')
41
- certain_pos_words_data.innerHTML = ""
42
- tab_container.innerHTML = ""
43
- certain_pos_count.innerHTML = ""
44
- newWordsLength = 0
45
- }
46
- else {
47
- errMessage.innerHTML = ''
48
- errMessage.classList.remove('alert-danger')
49
- data = data.slice(0, 1500)
50
- document.querySelector('#searchData').innerHTML = 'Search'
51
- spinner.classList.remove('spinner-border')
52
- certain_pos_words_data.innerHTML = ""
53
- tab_container.innerHTML = ""
54
- newWordsLength = 0
55
-
56
-
57
- let ok = true
58
-
59
- for (let i = maxLength; i <= 15; i++) {
60
- let newdata = data.filter((item) => item.length === i)
61
- if (newdata.length === 0) {
62
- certain_pos_words_data.innerHTML += ''
63
- } else {
64
- newWordsLength += newdata.length
65
- certain_pos_error_msg.classList.remove('alert-danger')
66
- certain_pos_error_msg.innerHTML = ''
67
- const result = newdata.map((item) => {
68
- if (item.length === 1) {
69
- ok = false
70
- newWordsLength = newWordsLength - 1
71
- } else {
72
- let ScrabbleLetterScore = ScrabbleScore()
73
- sum = 0
74
- item = item.toLowerCase()
75
- for (let i = 0; i < item.length; i++) {
76
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
77
- }
78
- return `<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
79
- <li>${item}
80
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
81
- </li></a>`
82
- }
83
- })
84
- if (ok) {
85
- tab_link_wrapper.style.display = "inline-flex"
86
- tab_container.innerHTML += `
87
- <input type="button" id="Tab_${i}" onclick="Filtering(${i})" value="${i} Letter"
88
- class="tab_link cursorPointer" />
89
- `
90
- let tabs = document.getElementsByClassName('tab_link')
91
- tabs[0] ? tabs[0].classList.add('active-tab') : ''
92
- certain_pos_words_data.innerHTML += `
93
- <div class="letterswords wordlistContainer" id="alpha_${i}">
94
- <div class="wordListHeading">
95
- <h3 class="lead">List of ${i} letter words that contain letters ${letters}</h3>
96
- </div>
97
- <div class="certainWordsList">
98
- <ul class="ul list-unstyled">
99
- ${result.join('')}
100
- </ul>
31
+ endpoint: `/.netlify/functions/wordsInCertainPositions`,
32
+ greenLetters: letters,
33
+ greenWithIndex: lettersWithIndex
34
+ });
35
+
36
+ worker.onmessage = async (event) => {
37
+ let { data, i, newWordsLength, result, ok } = event.data
38
+
39
+ if (data.length !== 0) {
40
+ certain_pos_error_msg.innerHTML = ''
41
+ certain_pos_error_msg.classList.remove('alert-danger')
42
+ document.querySelector('#searchData').innerHTML = 'Search'
43
+ spinner.classList.remove('spinner-border')
44
+ if (ok) {
45
+ tab_link_wrapper.style.display = "inline-flex"
46
+ tab_container.innerHTML += `
47
+ <input type="button" id="Tab_${i}" onclick="Filtering(${i})" value="${i} Letter"
48
+ class="tab_link cursorPointer" />
49
+ `
50
+ let tabs = document.getElementsByClassName('tab_link')
51
+ tabs[0] ? tabs[0].classList.add('active-tab') : ''
52
+
53
+ certain_pos_words_data.innerHTML += `
54
+ <div class="allGroupWords letterswords wordlistContainer" id="alpha_${i}">
55
+ <div class="wordListHeading">
56
+ <h3 class="lead">List of ${i} letter words that contain letters ${letters}</h3>
57
+ </div>
58
+ <div class="certainWordsList">
59
+ <div class="wordList ul list-unstyled">
60
+ ${result.join('')}
61
+ </div>
62
+ </div>
101
63
  </div>
102
- </div>
103
- `
104
- }
64
+ `
105
65
  }
106
66
  }
107
67
  if (newWordsLength === 0) {
68
+ document.querySelector('#searchData').innerHTML = 'Search'
69
+ spinner.classList.remove('spinner-border')
70
+ certain_pos_words_data.innerHTML = ""
71
+ tab_container.innerHTML = ""
108
72
  certain_pos_count.innerHTML = ""
73
+ newWordsLength = 0
74
+ tab_link_wrapper.style.display = "none"
109
75
  certain_pos_error_msg.classList.add('alert-danger')
110
76
  certain_pos_error_msg.innerHTML = 'Sorry!! No words found'
111
77
  } else {
112
78
  certain_pos_count.innerHTML = `<strong>Found <span>${newWordsLength}</span>
113
- words matching your search criteria </strong>`
79
+ words matching your search criteria </strong>`
114
80
  }
115
81
 
116
-
117
-
118
-
119
-
120
82
  }
121
83
  } catch (error) {
122
84
  console.log(error)
@@ -129,7 +91,6 @@ for (let g = 0; g < greenLetters.length; g++) {
129
91
  e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
130
92
  })
131
93
  }
132
-
133
94
  const getLetters = (object) => {
134
95
  let letters = []
135
96
  if (typeof object === 'string') {
@@ -175,10 +136,70 @@ function handleSubmit(e) {
175
136
  let letters = getLetters('.greenLetters')
176
137
  let lettersWithIndex = getIndexs('.greenWithIndex')
177
138
  let wordLength = getLength('.greenWithIndex')
178
-
179
139
  wordsInCertainPos(letters, lettersWithIndex, wordLength)
180
140
  }
181
141
  form.addEventListener('submit', handleSubmit)
142
+
143
+
144
+ // Scrabble Point Array
145
+ const ScrabbleScore = () => {
146
+ let twl06_sowpods = {
147
+ a: 1,
148
+ e: 1,
149
+ i: 1,
150
+ o: 1,
151
+ u: 1,
152
+ l: 1,
153
+ n: 1,
154
+ r: 1,
155
+ s: 1,
156
+ t: 1,
157
+ d: 2,
158
+ g: 2,
159
+ b: 3,
160
+ c: 3,
161
+ m: 3,
162
+ p: 3,
163
+ f: 4,
164
+ h: 4,
165
+ v: 4,
166
+ w: 4,
167
+ y: 4,
168
+ k: 5,
169
+ j: 8,
170
+ x: 8,
171
+ q: 10,
172
+ z: 10,
173
+ }
174
+ return twl06_sowpods
175
+ }
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
182
203
 
183
204
  // handling of filter on scroll
184
205
  window.onscroll = function () {
@@ -269,35 +290,4 @@ function scroll_Left() {
269
290
  function scroll_Right() {
270
291
  tab_container.scrollLeft -= 130
271
292
  }
272
- // Scrabble Point Array
273
- const ScrabbleScore = () => {
274
- let twl06_sowpods = {
275
- a: 1,
276
- e: 1,
277
- i: 1,
278
- o: 1,
279
- u: 1,
280
- l: 1,
281
- n: 1,
282
- r: 1,
283
- s: 1,
284
- t: 1,
285
- d: 2,
286
- g: 2,
287
- b: 3,
288
- c: 3,
289
- m: 3,
290
- p: 3,
291
- f: 4,
292
- h: 4,
293
- v: 4,
294
- w: 4,
295
- y: 4,
296
- k: 5,
297
- j: 8,
298
- x: 8,
299
- q: 10,
300
- z: 10,
301
- }
302
- return twl06_sowpods
303
- }
293
+
@@ -6,6 +6,8 @@ let errorMsg = document.querySelector('.errorMsg')
6
6
  let wordCount = document.querySelector('.wordCount')
7
7
  let main = document.querySelector('.main')
8
8
 
9
+ console.log(letterLen);
10
+
9
11
  const params = new URLSearchParams(window.location.search)
10
12
  let serachValue = params.get('search').toLowerCase()
11
13
  let prefixValue = params.get('prefix')
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: 2.8.2
4
+ version: 2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll