word-games-theme 0.1.8 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -21
  3. data/README.md +2 -2
  4. data/_data/blog/alertbar.yml +3 -3
  5. data/_data/blog/blog.yml +2 -2
  6. data/_data/blog/nav.json +13 -13
  7. data/_data/blog/share.yml +26 -27
  8. data/_data/footer/en/data.json +74 -74
  9. data/_data/footer/hi/data.json +68 -68
  10. data/_data/footer/networksites.json +15 -15
  11. data/_data/header/en/data.json +68 -71
  12. data/_data/wordgames/en/anagram_word_finder.json +48 -48
  13. data/_data/wordgames/en/eight_letter_word_finder.json +223 -223
  14. data/_data/wordgames/en/eleven_letter_word_finder.json +184 -184
  15. data/_data/wordgames/en/five_letter_word_finder.json +188 -188
  16. data/_data/wordgames/en/four_letter_word_finder.json +176 -176
  17. data/_data/wordgames/en/jumble_word_finder.json +54 -62
  18. data/_data/wordgames/en/lexical_word_finder.json +60 -60
  19. data/_data/wordgames/en/nine_letter_word_finder.json +184 -184
  20. data/_data/wordgames/en/root.json +79 -79
  21. data/_data/wordgames/en/scrabble_word_finder_cheat.json +48 -48
  22. data/_data/wordgames/en/seven_letter_word_finder.json +184 -184
  23. data/_data/wordgames/en/six_letter_word_finder.json +175 -175
  24. data/_data/wordgames/en/ten_letter_word_finder.json +184 -184
  25. data/_data/wordgames/en/thirteen_letter_word_finder.json +184 -184
  26. data/_data/wordgames/en/three_letter_word_finder.json +188 -188
  27. data/_data/wordgames/en/twelve_letter_word_finder.json +184 -184
  28. data/_data/wordgames/en/two_letter_word_finder.json +188 -188
  29. data/_data/wordgames/en/words_with_friends_word_finder.json +55 -55
  30. data/_includes/Rating/rating.html +91 -87
  31. data/_includes/Rating/structureddata.html +53 -53
  32. data/_includes/author_bio.html +15 -15
  33. data/_includes/authors/authors.html +27 -27
  34. data/_includes/custom-head.html +31 -31
  35. data/_includes/disqus_comments.html +10 -10
  36. data/_includes/filterWords/index.html +10 -10
  37. data/_includes/footer/index.html +47 -43
  38. data/_includes/google-analytics.html +22 -22
  39. data/_includes/head/index.html +108 -104
  40. data/_includes/header/blogHeader.html +28 -28
  41. data/_includes/header/index.html +41 -46
  42. data/_includes/paginationBlogPage.html +34 -34
  43. data/_includes/paginationPostPage.html +14 -14
  44. data/_includes/postauthorbio.html +17 -17
  45. data/_includes/postbox.html +29 -29
  46. data/_includes/script.html +13 -13
  47. data/_includes/section/about.html +25 -25
  48. data/_includes/section/alertbar.html +11 -11
  49. data/_includes/section/blog.html +41 -41
  50. data/_includes/section/commonPage.html +99 -92
  51. data/_includes/section/count.html +23 -23
  52. data/_includes/section/feature.html +34 -34
  53. data/_includes/section/home.html +94 -89
  54. data/_includes/section/home2.html +90 -83
  55. data/_includes/section/news.html +32 -32
  56. data/_includes/section/recent_posts.html +42 -42
  57. data/_includes/section/related_categories_post.html +73 -73
  58. data/_includes/section/related_tag_post.html +59 -59
  59. data/_includes/section/wordGroup.html +6 -6
  60. data/_includes/seo.html +56 -57
  61. data/_includes/share/socialshare.html +49 -50
  62. data/_layouts/blog.html +66 -66
  63. data/_layouts/categories.html +25 -25
  64. data/_layouts/default.html +43 -43
  65. data/_layouts/disclaimer.html +115 -115
  66. data/_layouts/page.html +67 -67
  67. data/_layouts/page2.html +60 -60
  68. data/_layouts/post.html +69 -69
  69. data/_layouts/privacyPolicy.html +420 -420
  70. data/_layouts/termAndCondition.html +421 -421
  71. data/_layouts/wordMeaning.html +106 -106
  72. data/assets/css/HomePageblog.css +154 -154
  73. data/assets/css/about.css +51 -51
  74. data/assets/css/advancedFilter.css +160 -160
  75. data/assets/css/blog.css +481 -481
  76. data/assets/css/feature.css +69 -69
  77. data/assets/css/footer.css +95 -95
  78. data/assets/css/home.css +235 -234
  79. data/assets/css/news.css +62 -62
  80. data/assets/css/style.css +394 -386
  81. data/assets/css/wordGroup.css +62 -62
  82. data/assets/images/angle-arrow-down.svg +43 -43
  83. data/assets/images/facebook-square.svg +1 -0
  84. data/assets/images/facebook.svg +1 -0
  85. data/assets/images/instagram-square.svg +1 -0
  86. data/assets/images/linkedin.svg +1 -0
  87. data/assets/images/linkedin2.svg +1 -0
  88. data/assets/images/ratingStar.png +0 -0
  89. data/assets/images/right.svg +38 -38
  90. data/assets/images/right2.svg +38 -38
  91. data/assets/images/right3.svg +38 -38
  92. data/assets/images/star.svg +1 -0
  93. data/assets/images/twitter-square.svg +1 -0
  94. data/assets/images/twitter.svg +1 -0
  95. data/assets/images/twitter2.svg +1 -0
  96. data/assets/images/window-close.png +0 -0
  97. data/assets/images/window-close.svg +1 -0
  98. data/assets/images/word-games-logo.svg +52 -52
  99. data/assets/js/TopScroll.js +8 -8
  100. data/assets/js/X-letter.js +359 -378
  101. data/assets/js/advancedFilter.js +5 -5
  102. data/assets/js/advancedFilter2.js +12 -12
  103. data/assets/js/advancedFilter3.js +2 -2
  104. data/assets/js/scrabbleDictonary.js +165 -165
  105. data/assets/js/wordScrabble.js +511 -510
  106. metadata +19 -8
  107. data/_data/header/hi/data.json +0 -145
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-48.9 158.8c.2 2.8.2 5.7.2 8.5 0 86.7-66 186.6-186.6 186.6-37.2 0-71.7-10.8-100.7-29.4 5.3.6 10.4.8 15.8.8 30.7 0 58.9-10.4 81.4-28-28.8-.6-53-19.5-61.3-45.5 10.1 1.5 19.2 1.5 29.6-1.2-30-6.1-52.5-32.5-52.5-64.4v-.8c8.7 4.9 18.9 7.9 29.6 8.3a65.447 65.447 0 0 1-29.2-54.6c0-12.2 3.2-23.4 8.9-33.1 32.3 39.8 80.8 65.8 135.2 68.6-9.3-44.5 24-80.6 64-80.6 18.9 0 35.9 7.9 47.9 20.7 14.8-2.8 29-8.3 41.6-15.8-4.9 15.2-15.2 28-28.8 36.1 13.2-1.4 26-5.1 37.8-10.2-8.9 13.1-20.1 24.7-32.9 34z"/></svg>
@@ -0,0 +1 @@
1
+ <svg id="SvgjsSvg1016" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><defs id="SvgjsDefs1017"></defs><g id="SvgjsG1018"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="288" height="288"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-83.6 290.5c4.8 4.8 4.8 12.6 0 17.4l-40.5 40.5c-4.8 4.8-12.6 4.8-17.4 0L256 313.3l-66.5 67.1c-4.8 4.8-12.6 4.8-17.4 0l-40.5-40.5c-4.8-4.8-4.8-12.6 0-17.4l67.1-66.5-67.1-66.5c-4.8-4.8-4.8-12.6 0-17.4l40.5-40.5c4.8-4.8 12.6-4.8 17.4 0l66.5 67.1 66.5-67.1c4.8-4.8 12.6-4.8 17.4 0l40.5 40.5c4.8 4.8 4.8 12.6 0 17.4L313.3 256l67.1 66.5z"/></svg>
@@ -1,52 +1,52 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
- width="435.496px" height="435.496px" viewBox="0 0 435.496 435.496" style="enable-background:new 0 0 435.496 435.496;"
6
- xml:space="preserve">
7
- <g>
8
- <g>
9
- <path d="M350.914,17.811C336.771,7.082,319.188,0.637,300.053,0.637H84.398C37.791,0.637,0,38.437,0,85.035v215.664
10
- C0,321,7.181,339.617,19.125,354.191c9.62,46.004,50.48,80.668,99.297,80.668h215.645c55.93,0,101.43-45.508,101.43-101.447
11
- V117.739C435.496,67.545,398.832,25.872,350.914,17.811z M321.721,301.033h7.01v36.529h-8.252v-28.938h-0.115l-6.971,3.309
12
- l-1.396-6.406L321.721,301.033z M180.224,219.398c-37.638-12.546-52.02-32.838-51.647-54.239
13
- c0-33.947,28.773-59.393,73.412-59.393c21.027,0,39.484,5.164,50.539,10.69l-9.582,38.748
14
- c-8.129-4.428-23.983-10.337-39.111-10.337c-13.655,0-21.391,5.546-21.391,14.382c0,8.864,7.009,13.292,29.137,21.028
15
- c34.311,11.8,48.329,29.52,48.702,55.71c0,33.938-26.191,58.666-77.838,58.666c-23.61,0-44.638-5.545-58.293-12.928l9.964-39.848
16
- c10.318,6.283,31.729,13.293,48.329,13.293c16.964,0,23.973-5.527,23.973-14.756C206.416,230.834,200.879,226.408,180.224,219.398
17
- z M401.395,333.402c0,37.131-30.197,67.348-67.328,67.348H118.422c-16.706,0-31.977-6.158-43.758-16.256
18
- c3.194,0.373,6.436,0.604,9.744,0.604h215.645c46.627,0,84.389-37.791,84.389-84.398V85.045c0-4.456-0.449-8.788-1.109-13.053
19
- c11.178,12.03,18.072,28.095,18.072,45.756v215.654H401.395z"/>
20
- </g>
21
- </g>
22
- <g>
23
- </g>
24
- <g>
25
- </g>
26
- <g>
27
- </g>
28
- <g>
29
- </g>
30
- <g>
31
- </g>
32
- <g>
33
- </g>
34
- <g>
35
- </g>
36
- <g>
37
- </g>
38
- <g>
39
- </g>
40
- <g>
41
- </g>
42
- <g>
43
- </g>
44
- <g>
45
- </g>
46
- <g>
47
- </g>
48
- <g>
49
- </g>
50
- <g>
51
- </g>
52
- </svg>
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="435.496px" height="435.496px" viewBox="0 0 435.496 435.496" style="enable-background:new 0 0 435.496 435.496;"
6
+ xml:space="preserve">
7
+ <g>
8
+ <g>
9
+ <path d="M350.914,17.811C336.771,7.082,319.188,0.637,300.053,0.637H84.398C37.791,0.637,0,38.437,0,85.035v215.664
10
+ C0,321,7.181,339.617,19.125,354.191c9.62,46.004,50.48,80.668,99.297,80.668h215.645c55.93,0,101.43-45.508,101.43-101.447
11
+ V117.739C435.496,67.545,398.832,25.872,350.914,17.811z M321.721,301.033h7.01v36.529h-8.252v-28.938h-0.115l-6.971,3.309
12
+ l-1.396-6.406L321.721,301.033z M180.224,219.398c-37.638-12.546-52.02-32.838-51.647-54.239
13
+ c0-33.947,28.773-59.393,73.412-59.393c21.027,0,39.484,5.164,50.539,10.69l-9.582,38.748
14
+ c-8.129-4.428-23.983-10.337-39.111-10.337c-13.655,0-21.391,5.546-21.391,14.382c0,8.864,7.009,13.292,29.137,21.028
15
+ c34.311,11.8,48.329,29.52,48.702,55.71c0,33.938-26.191,58.666-77.838,58.666c-23.61,0-44.638-5.545-58.293-12.928l9.964-39.848
16
+ c10.318,6.283,31.729,13.293,48.329,13.293c16.964,0,23.973-5.527,23.973-14.756C206.416,230.834,200.879,226.408,180.224,219.398
17
+ z M401.395,333.402c0,37.131-30.197,67.348-67.328,67.348H118.422c-16.706,0-31.977-6.158-43.758-16.256
18
+ c3.194,0.373,6.436,0.604,9.744,0.604h215.645c46.627,0,84.389-37.791,84.389-84.398V85.045c0-4.456-0.449-8.788-1.109-13.053
19
+ c11.178,12.03,18.072,28.095,18.072,45.756v215.654H401.395z"/>
20
+ </g>
21
+ </g>
22
+ <g>
23
+ </g>
24
+ <g>
25
+ </g>
26
+ <g>
27
+ </g>
28
+ <g>
29
+ </g>
30
+ <g>
31
+ </g>
32
+ <g>
33
+ </g>
34
+ <g>
35
+ </g>
36
+ <g>
37
+ </g>
38
+ <g>
39
+ </g>
40
+ <g>
41
+ </g>
42
+ <g>
43
+ </g>
44
+ <g>
45
+ </g>
46
+ <g>
47
+ </g>
48
+ <g>
49
+ </g>
50
+ <g>
51
+ </g>
52
+ </svg>
@@ -1,8 +1,8 @@
1
- const alertbar = document.querySelector('.alertbar')
2
- window.addEventListener('scroll', () => {
3
- if (pageYOffset > 200) {
4
- alertbar.style.display = 'block'
5
- } else {
6
- alertbar.style.display = 'none'
7
- }
8
- })
1
+ const alertbar = document.querySelector('.alertbar')
2
+ window.addEventListener('scroll', () => {
3
+ if (pageYOffset > 200) {
4
+ alertbar.style.display = 'block'
5
+ } else {
6
+ alertbar.style.display = 'none'
7
+ }
8
+ })
@@ -1,378 +1,359 @@
1
- let errorMsg = document.querySelector('.errorMsg')
2
- let wordCount = document.querySelector('.wordCount')
3
- let main = document.querySelector('.main')
4
-
5
- const params = new URLSearchParams(window.location.search)
6
- let serachValue = params.get('search')
7
- let prefixValue = params.get('prefix')
8
- let containsValue = params.get('contains')
9
- let suffixValue = params.get('suffix')
10
- let lengthValue = params.get('length')
11
- let dictonary = params.get('dictonary')
12
-
13
- let tab_container = document.querySelector('.tab_container')
14
-
15
- let txtBox = document.querySelector('.txtBox')
16
- txtBox.value = serachValue
17
-
18
- var theSelect = document.getElementById('select_dropDown')
19
- document.querySelector('.select_dropDown2').value = dictonary
20
-
21
- const getData = async (serachValue) => {
22
- try {
23
- main.innerHTML = `<div class="loader">
24
- <img src='/assets/images/loading.gif'>
25
- </div>`
26
- const response = await fetch(
27
- `/.netlify/functions/getWords?name=${serachValue}`
28
- )
29
- const data = await response.json()
30
- main.innerHTML = ''
31
- x_with_letters(data)
32
- } catch (error) {
33
- console.log(error)
34
- }
35
- }
36
- // calling function
37
- getData(serachValue.toLowerCase())
38
-
39
- function x_with_letters(data) {
40
- if (typeof data === 'string') {
41
- errorMsg.innerHTML = 'No words found'
42
- wordCount.innerHTML = `<strong> 0 words with letters ${serachValue.split(
43
- ''
44
- )}</strong>`
45
- } else {
46
- let newWordsLength = 0
47
- let filterData = ''
48
-
49
- if (window.location.pathname == '/thirteen-letter-word-finder/result') {
50
- filterData = data.filter((item) => item.length == 13)
51
- } else if (
52
- window.location.pathname == '/twelve-letter-word-finder/result'
53
- ) {
54
- filterData = data.filter((item) => item.length == 12)
55
- } else if (
56
- window.location.pathname == '/eleven-letter-word-finder/result'
57
- ) {
58
- filterData = data.filter((item) => item.length == 11)
59
- } else if (window.location.pathname == '/ten-letter-word-finder/result') {
60
- filterData = data.filter((item) => item.length == 10)
61
- } else if (window.location.pathname == '/nine-letter-word-finder/result') {
62
- filterData = data.filter((item) => item.length == 9)
63
- } else if (window.location.pathname == '/eight-letter-word-finder/result') {
64
- filterData = data.filter((item) => item.length == 8)
65
- } else if (window.location.pathname == '/seven-letter-word-finder/result') {
66
- filterData = data.filter((item) => item.length == 7)
67
- } else if (window.location.pathname == '/six-letter-word-finder/result') {
68
- filterData = data.filter((item) => item.length == 6)
69
- } else if (window.location.pathname == '/five-letter-word-finder/result') {
70
- filterData = data.filter((item) => item.length == 5)
71
- } else if (window.location.pathname == '/four-letter-word-finder/result') {
72
- filterData = data.filter((item) => item.length == 4)
73
- } else if (window.location.pathname == '/three-letter-word-finder/result') {
74
- filterData = data.filter((item) => item.length == 3)
75
- } else if (window.location.pathname == '/two-letter-word-finder/result') {
76
- filterData = data.filter((item) => item.length == 2)
77
- }
78
-
79
- if (prefixValue) {
80
- filterData = filterData.filter((item2) =>
81
- item2.startsWith(prefixValue.toLowerCase())
82
- )
83
- startsWith.classList.add('tick')
84
- startsWith.value = prefixValue
85
- }
86
- if (containsValue) {
87
- filterData = filterData.filter((item) =>
88
- item.includes(containsValue.toLowerCase())
89
- )
90
- mustInclude.classList.add('tick')
91
- mustInclude.value = containsValue
92
- }
93
- if (suffixValue) {
94
- filterData = filterData.filter((item) =>
95
- item.endsWith(suffixValue.toLowerCase())
96
- )
97
- endsWith.classList.add('tick')
98
- endsWith.value = suffixValue
99
- }
100
-
101
- if (filterData.length === 0) {
102
- main.innerHTML += ''
103
- errorMsg.innerHTML = 'No words Found with this length'
104
- } else {
105
- // sort eventlistener
106
- theSelect.addEventListener('change', () => {
107
- sortValue = theSelect[theSelect.selectedIndex].text
108
- if (sortValue == 'Z-A') {
109
- sortBool = true
110
- sortby(sortBool, filterData, itemLength)
111
- } else {
112
- sortBool = false
113
- sortby(sortBool, filterData, itemLength)
114
- }
115
- if (sortValue == 'Points') {
116
- sortBool = true
117
- sortPointsby(sortBool, filterData, itemLength)
118
- }
119
- })
120
-
121
- newWordsLength += filterData.length
122
- let itemLength = ''
123
- const result = filterData.map((item) => {
124
- itemLength = item.length
125
- let ScrabbleLetterScore = ScrabbleScore()
126
- sum = 0
127
- item = item.toLowerCase()
128
- for (let i = 0; i < item.length; i++) {
129
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
130
- }
131
- wordLength.value = itemLength
132
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
133
- <li>${item}
134
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
135
- </li></a>`
136
- })
137
-
138
- tab_container.innerHTML += `
139
- <a href="#${itemLength}">
140
- <input type="button" value="${itemLength} Letter" id="Tab${itemLength}" onclick="addFilter(${itemLength})"
141
- class="tab_link">
142
- </a>
143
- `
144
-
145
- let tabs = document.getElementsByClassName('tab_link')
146
- tabs[0] ? tabs[0].classList.add('active-tab') : ''
147
-
148
- main.innerHTML += `
149
- <div class="allGroupWords">
150
- <div class="wordListHeading">
151
- <h3 class="lead">${itemLength} Letter Words</h3>
152
- </div>
153
- <div class="wordList">
154
- <ul class="ul list-unstyled">
155
- ${result.join('')}
156
- </ul>
157
- </div>
158
- </div>
159
- `
160
- }
161
- wordCount.innerHTML = `<strong>${newWordsLength} words with letters ${serachValue.split(
162
- ''
163
- )}</strong>`
164
- }
165
- }
166
-
167
- //Handling of filter counter in advanced filter
168
- function addFilterCount() {
169
- let filter_val = document.getElementsByClassName('filter_val')
170
- let filter = document.querySelector('.filter_count')
171
- let filter_count = 0
172
-
173
- filter_val[0].value = prefixValue
174
- filter_val[1].value = containsValue
175
- filter_val[2].value = suffixValue
176
- filter_val[3].value = lengthValue
177
-
178
- for (var i = 0; i < 4; i++) {
179
- if (filter_val[i].value != '') {
180
- filter_count += 1
181
- }
182
- if (filter_count === 0) {
183
- filter.style.display = 'none'
184
- } else {
185
- filter.style.display = 'inline-block'
186
- }
187
-
188
- filter.innerHTML = filter_count
189
- }
190
- }
191
- addFilterCount()
192
-
193
- // sorting by points
194
- function sortPointsby(sortValue, data, i) {
195
- if (sortValue) {
196
- main.innerHTML = ''
197
- let newArray = []
198
- data.map((item) => {
199
- let ScrabbleLetterScore = ScrabbleScore()
200
- let points = 0
201
- item = item.toLowerCase()
202
- for (let i = 0; i < item.length; i++) {
203
- points += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
204
- }
205
- const value = {
206
- words: item,
207
- points: points,
208
- }
209
- newArray.push(value)
210
- newArray.sort(function (a, b) {
211
- return b.points - a.points
212
- })
213
- })
214
- const result = newArray.map((item) => {
215
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.words}">
216
- <li>${item.words}
217
- <span class="points" value="${item.points}" style="position:relative; top:4px; font-size:12px"> ${item.points}</span>
218
- </li></a>`
219
- })
220
-
221
- main.innerHTML += `
222
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
223
- <div class="wordListHeading">
224
- <h3 class="lead">${i} Letter Words</h3>
225
- </div>
226
- <div class="wordList">
227
- <ul class="ul list-unstyled">
228
- ${result.join('')}
229
- </ul>
230
- </div>
231
- </div>
232
- `
233
- }
234
- }
235
-
236
- // sort by aplhabets
237
- function sortby(sortBool, data, i) {
238
- if (sortBool) {
239
- main.innerHTML = ''
240
- data.reverse()
241
- const result = data.map((item) => {
242
- let ScrabbleLetterScore = ScrabbleScore()
243
- let sum = 0
244
- item = item.toLowerCase()
245
- for (let i = 0; i < item.length; i++) {
246
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
247
- }
248
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
249
- <li>${item}
250
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
251
- </li></a>`
252
- })
253
-
254
- main.innerHTML += `
255
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
256
- <div class="wordListHeading">
257
- <h3 class="lead">${i} Letter Words</h3>
258
- </div>
259
- <div class="wordList">
260
- <ul class="ul list-unstyled">
261
- ${result.join('')}
262
- </ul>
263
- </div>
264
- </div>
265
-
266
- `
267
- } else {
268
- main.innerHTML = ''
269
- data.sort()
270
- const result = data.map((item) => {
271
- let ScrabbleLetterScore = ScrabbleScore()
272
- let sum = 0
273
- item = item.toLowerCase()
274
- for (let i = 0; i < item.length; i++) {
275
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
276
- }
277
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
278
- <li>${item}
279
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
280
- </li></a>`
281
- })
282
-
283
- main.innerHTML += `
284
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
285
- <div class="wordListHeading">
286
- <h3 class="lead">${i} Letter Words</h3>
287
- </div>
288
- <div class="wordList">
289
- <ul class="ul list-unstyled">
290
- ${result.join('')}
291
- </ul>
292
- </div>
293
- </div>
294
-
295
- `
296
- }
297
- }
298
-
299
- // Implement Active class
300
- const addFilter = () => {
301
- let tabs = document.getElementsByClassName('tab_link')
302
- tabs[0] ? tabs[0].classList.add('active-tab') : ''
303
-
304
- Array.from(tabs).map((item) => {
305
- item.classList.remove('active-tab')
306
- })
307
- main.innerHTML += ``
308
- let activeLetter = event.target
309
- // console.log(activeLetter)
310
- activeLetter.classList.add('active-tab')
311
- }
312
-
313
- // Scrabble Point Counts
314
- const ScrabbleScore = () => {
315
- let twl06_sowpods = {
316
- a: 1,
317
- e: 1,
318
- i: 1,
319
- o: 1,
320
- u: 1,
321
- l: 1,
322
- n: 1,
323
- r: 1,
324
- s: 1,
325
- t: 1,
326
- d: 2,
327
- g: 2,
328
- b: 3,
329
- c: 3,
330
- m: 3,
331
- p: 3,
332
- f: 4,
333
- h: 4,
334
- v: 4,
335
- w: 4,
336
- y: 4,
337
- k: 5,
338
- j: 8,
339
- x: 8,
340
- q: 10,
341
- z: 10,
342
- }
343
-
344
- let wwfScore = {
345
- a: 1,
346
- b: 4,
347
- c: 4,
348
- d: 2,
349
- e: 1,
350
- f: 4,
351
- g: 3,
352
- h: 3,
353
- i: 1,
354
- j: 10,
355
- k: 5,
356
- l: 2,
357
- m: 4,
358
- n: 2,
359
- o: 1,
360
- p: 4,
361
- q: 10,
362
- r: 1,
363
- s: 1,
364
- t: 1,
365
- u: 2,
366
- v: 5,
367
- w: 4,
368
- x: 8,
369
- y: 3,
370
- z: 10,
371
- }
372
-
373
- if (dictonary === 'wwf') {
374
- return wwfScore
375
- } else {
376
- return twl06_sowpods
377
- }
378
- }
1
+ ---
2
+ ---
3
+ const getScript=document.currentScript
4
+ const letterLen = getScript.dataset.letter
5
+
6
+ let errorMsg = document.querySelector('.errorMsg')
7
+ let wordCount = document.querySelector('.wordCount')
8
+ let main = document.querySelector('.main')
9
+
10
+ const params = new URLSearchParams(window.location.search)
11
+ let serachValue = params.get('search')
12
+ let prefixValue = params.get('prefix')
13
+ let containsValue = params.get('contains')
14
+ let suffixValue = params.get('suffix')
15
+ let lengthValue = params.get('length')
16
+ let dictonary = params.get('dictonary')
17
+
18
+ let tab_container = document.querySelector('.tab_container')
19
+
20
+ let txtBox = document.querySelector('.txtBox')
21
+ txtBox.value = serachValue
22
+
23
+ var theSelect = document.getElementById('select_dropDown')
24
+ document.querySelector('.select_dropDown2').value = dictonary
25
+
26
+ const getData = async (serachValue) => {
27
+ try {
28
+ main.innerHTML = `<div class="loader">
29
+ <img src='/assets/images/loading.gif'>
30
+ </div>`
31
+ const response = await fetch(
32
+ `/.netlify/functions/getWords?name=${serachValue}`
33
+ )
34
+ const data = await response.json()
35
+ main.innerHTML = ''
36
+ x_with_letters(data)
37
+ } catch (error) {
38
+ console.log(error)
39
+ }
40
+ }
41
+ // calling function
42
+ getData(serachValue.toLowerCase())
43
+
44
+ function x_with_letters(data) {
45
+ if (typeof data === 'string') {
46
+ errorMsg.innerHTML = 'No words found'
47
+ wordCount.innerHTML = `<strong> 0 words with letters ${serachValue.split(
48
+ ''
49
+ )}</strong>`
50
+ } else {
51
+ let newWordsLength = 0
52
+ let filterData = ''
53
+
54
+
55
+ if (letterLen) {
56
+ filterData = data.filter((item) => item.length == letterLen)
57
+ }
58
+
59
+
60
+ if (prefixValue) {
61
+ filterData = filterData.filter((item2) =>
62
+ item2.startsWith(prefixValue.toLowerCase())
63
+ )
64
+ startsWith.classList.add('tick')
65
+ startsWith.value = prefixValue
66
+ }
67
+ if (containsValue) {
68
+ filterData = filterData.filter((item) =>
69
+ item.includes(containsValue.toLowerCase())
70
+ )
71
+ mustInclude.classList.add('tick')
72
+ mustInclude.value = containsValue
73
+ }
74
+ if (suffixValue) {
75
+ filterData = filterData.filter((item) =>
76
+ item.endsWith(suffixValue.toLowerCase())
77
+ )
78
+ endsWith.classList.add('tick')
79
+ endsWith.value = suffixValue
80
+ }
81
+
82
+ if (filterData.length === 0) {
83
+ main.innerHTML += ''
84
+ errorMsg.innerHTML = 'No words Found with this length'
85
+ } else {
86
+ // sort eventlistener
87
+ theSelect.addEventListener('change', () => {
88
+ sortValue = theSelect[theSelect.selectedIndex].text
89
+ if (sortValue == 'Z-A') {
90
+ sortBool = true
91
+ sortby(sortBool, filterData, itemLength)
92
+ } else {
93
+ sortBool = false
94
+ sortby(sortBool, filterData, itemLength)
95
+ }
96
+ if (sortValue == 'Points') {
97
+ sortBool = true
98
+ sortPointsby(sortBool, filterData, itemLength)
99
+ }
100
+ })
101
+
102
+ newWordsLength += filterData.length
103
+ let itemLength = ''
104
+ const result = filterData.map((item) => {
105
+ itemLength = item.length
106
+ let ScrabbleLetterScore = ScrabbleScore()
107
+ sum = 0
108
+ item = item.toLowerCase()
109
+ for (let i = 0; i < item.length; i++) {
110
+ sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
111
+ }
112
+ wordLength.value = itemLength
113
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
114
+ <li>${item}
115
+ <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
116
+ </li></a>`
117
+ })
118
+
119
+ tab_container.innerHTML += `
120
+ <a href="#${itemLength}">
121
+ <input type="button" value="${itemLength} Letter" id="Tab${itemLength}" onclick="addFilter(${itemLength})"
122
+ class="tab_link">
123
+ </a>
124
+ `
125
+
126
+ let tabs = document.getElementsByClassName('tab_link')
127
+ tabs[0] ? tabs[0].classList.add('active-tab') : ''
128
+
129
+ main.innerHTML += `
130
+ <div class="allGroupWords">
131
+ <div class="wordListHeading">
132
+ <h3 class="lead">${itemLength} Letter Words</h3>
133
+ </div>
134
+ <div class="wordList">
135
+ <ul class="ul list-unstyled">
136
+ ${result.join('')}
137
+ </ul>
138
+ </div>
139
+ </div>
140
+ `
141
+ }
142
+ wordCount.innerHTML = `<strong>${newWordsLength} words with letters ${serachValue.split(
143
+ ''
144
+ )}</strong>`
145
+ }
146
+ }
147
+
148
+ //Handling of filter counter in advanced filter
149
+ function addFilterCount() {
150
+ let filter_val = document.getElementsByClassName('filter_val')
151
+ let filter = document.querySelector('.filter_count')
152
+ let filter_count = 0
153
+
154
+ filter_val[0].value = prefixValue
155
+ filter_val[1].value = containsValue
156
+ filter_val[2].value = suffixValue
157
+ filter_val[3].value = lengthValue
158
+
159
+ for (var i = 0; i < 4; i++) {
160
+ if (filter_val[i].value != '') {
161
+ filter_count += 1
162
+ }
163
+ if (filter_count === 0) {
164
+ filter.style.display = 'none'
165
+ } else {
166
+ filter.style.display = 'inline-block'
167
+ }
168
+
169
+ filter.innerHTML = filter_count
170
+ }
171
+ }
172
+ addFilterCount()
173
+
174
+ // sorting by points
175
+ function sortPointsby(sortValue, data, i) {
176
+ if (sortValue) {
177
+ main.innerHTML = ''
178
+ let newArray = []
179
+ data.map((item) => {
180
+ let ScrabbleLetterScore = ScrabbleScore()
181
+ let points = 0
182
+ item = item.toLowerCase()
183
+ for (let i = 0; i < item.length; i++) {
184
+ points += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
185
+ }
186
+ const value = {
187
+ words: item,
188
+ points: points,
189
+ }
190
+ newArray.push(value)
191
+ newArray.sort(function (a, b) {
192
+ return b.points - a.points
193
+ })
194
+ })
195
+ const result = newArray.map((item) => {
196
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.words}">
197
+ <li>${item.words}
198
+ <span class="points" value="${item.points}" style="position:relative; top:4px; font-size:12px"> ${item.points}</span>
199
+ </li></a>`
200
+ })
201
+
202
+ main.innerHTML += `
203
+ <div class="allGroupWords wordlistContainer" id="alpha_${i}">
204
+ <div class="wordListHeading">
205
+ <h3 class="lead">${i} Letter Words</h3>
206
+ </div>
207
+ <div class="wordList">
208
+ <ul class="ul list-unstyled">
209
+ ${result.join('')}
210
+ </ul>
211
+ </div>
212
+ </div>
213
+ `
214
+ }
215
+ }
216
+
217
+ // sort by aplhabets
218
+ function sortby(sortBool, data, i) {
219
+ if (sortBool) {
220
+ main.innerHTML = ''
221
+ data.reverse()
222
+ const result = data.map((item) => {
223
+ let ScrabbleLetterScore = ScrabbleScore()
224
+ let sum = 0
225
+ item = item.toLowerCase()
226
+ for (let i = 0; i < item.length; i++) {
227
+ sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
228
+ }
229
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
230
+ <li>${item}
231
+ <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
232
+ </li></a>`
233
+ })
234
+
235
+ main.innerHTML += `
236
+ <div class="allGroupWords wordlistContainer" id="alpha_${i}">
237
+ <div class="wordListHeading">
238
+ <h3 class="lead">${i} Letter Words</h3>
239
+ </div>
240
+ <div class="wordList">
241
+ <ul class="ul list-unstyled">
242
+ ${result.join('')}
243
+ </ul>
244
+ </div>
245
+ </div>
246
+
247
+ `
248
+ } else {
249
+ main.innerHTML = ''
250
+ data.sort()
251
+ const result = data.map((item) => {
252
+ let ScrabbleLetterScore = ScrabbleScore()
253
+ let sum = 0
254
+ item = item.toLowerCase()
255
+ for (let i = 0; i < item.length; i++) {
256
+ sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
257
+ }
258
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
259
+ <li>${item}
260
+ <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
261
+ </li></a>`
262
+ })
263
+
264
+ main.innerHTML += `
265
+ <div class="allGroupWords wordlistContainer" id="alpha_${i}">
266
+ <div class="wordListHeading">
267
+ <h3 class="lead">${i} Letter Words</h3>
268
+ </div>
269
+ <div class="wordList">
270
+ <ul class="ul list-unstyled">
271
+ ${result.join('')}
272
+ </ul>
273
+ </div>
274
+ </div>
275
+
276
+ `
277
+ }
278
+ }
279
+
280
+ // Implement Active class
281
+ const addFilter = () => {
282
+ let tabs = document.getElementsByClassName('tab_link')
283
+ tabs[0] ? tabs[0].classList.add('active-tab') : ''
284
+
285
+ Array.from(tabs).map((item) => {
286
+ item.classList.remove('active-tab')
287
+ })
288
+ main.innerHTML += ``
289
+ let activeLetter = event.target
290
+ // console.log(activeLetter)
291
+ activeLetter.classList.add('active-tab')
292
+ }
293
+
294
+ // Scrabble Point Counts
295
+ const ScrabbleScore = () => {
296
+ let twl06_sowpods = {
297
+ a: 1,
298
+ e: 1,
299
+ i: 1,
300
+ o: 1,
301
+ u: 1,
302
+ l: 1,
303
+ n: 1,
304
+ r: 1,
305
+ s: 1,
306
+ t: 1,
307
+ d: 2,
308
+ g: 2,
309
+ b: 3,
310
+ c: 3,
311
+ m: 3,
312
+ p: 3,
313
+ f: 4,
314
+ h: 4,
315
+ v: 4,
316
+ w: 4,
317
+ y: 4,
318
+ k: 5,
319
+ j: 8,
320
+ x: 8,
321
+ q: 10,
322
+ z: 10,
323
+ }
324
+
325
+ let wwfScore = {
326
+ a: 1,
327
+ b: 4,
328
+ c: 4,
329
+ d: 2,
330
+ e: 1,
331
+ f: 4,
332
+ g: 3,
333
+ h: 3,
334
+ i: 1,
335
+ j: 10,
336
+ k: 5,
337
+ l: 2,
338
+ m: 4,
339
+ n: 2,
340
+ o: 1,
341
+ p: 4,
342
+ q: 10,
343
+ r: 1,
344
+ s: 1,
345
+ t: 1,
346
+ u: 2,
347
+ v: 5,
348
+ w: 4,
349
+ x: 8,
350
+ y: 3,
351
+ z: 10,
352
+ }
353
+
354
+ if (dictonary === 'wwf') {
355
+ return wwfScore
356
+ } else {
357
+ return twl06_sowpods
358
+ }
359
+ }