word-games-theme 2.9.4 → 2.9.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 +4 -4
- data/assets/js/theme.js +27 -50
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0811628371d094ba8e6511f09dc9d4e8baf5c607bb413d1c12f87266d352a1b7'
|
|
4
|
+
data.tar.gz: f2d94a24451e5cd3b6334f727dbc06422a51faa9ee8d830106f746093284ae69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f30f2fefe4113e7fc6ac556fcba8f6bab4e5539b04708066e00eca28cb1a8e49a9b38fa7c1093072b7f1382da3d01dbe127674cb506c17646b79682e7225b617
|
|
7
|
+
data.tar.gz: a77777769b56d97c5fa3c9e195678ea0adbef2de82387de2fdac649118b396bca8fd896d3abb1d9830602c96ed4b56bace01e32b6b3277cd6c5d8d00bb125e53
|
data/assets/js/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
---
|
|
3
3
|
|
|
4
|
-
console.log(document.querySelectorAll('*').length);
|
|
4
|
+
console.log(document.querySelectorAll('*').length);
|
|
5
5
|
|
|
6
6
|
if ("{{ site.removeBootstrapJs }}" === "true") {
|
|
7
7
|
const languagesModal = document.querySelector("#staticBackdrop");
|
|
@@ -24,57 +24,32 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
var mediaQuery = window.matchMedia("(max-width: 768px)")
|
|
29
|
-
|
|
30
|
-
let dropmenu = document.querySelector(".dropmenu");
|
|
31
|
-
// navbarDropdown.addEventListener("click", () => {
|
|
32
|
-
// if (dropmenu.classList.contains("show")) {
|
|
33
|
-
// dropmenu.classList.remove("show");
|
|
34
|
-
// dropmenu.style.display = "none"
|
|
35
|
-
// } else {
|
|
36
|
-
// dropmenu.classList.add("show");
|
|
37
|
-
// if (mediaQuery.matches) {
|
|
38
|
-
// dropmenu.style.display = "block"
|
|
39
|
-
// } else {
|
|
40
|
-
// dropmenu.style.display = "grid"
|
|
41
|
-
// dropmenu.style.padding = "3.5rem"
|
|
42
|
-
// dropmenu.style.gridTemplateColumns = "auto auto";
|
|
43
|
-
// dropmenu.style.columnGap = "5rem";
|
|
44
|
-
// dropmenu.style.rowGap = "1rem";
|
|
45
|
-
// dropmenu.style.borderBottom = "1px solid rgba(0, 0, 0, 0.1)"
|
|
46
|
-
// dropmenu.style.borderLeft = "1px solid rgba(0, 0, 0, 0.1)"
|
|
47
|
-
// dropmenu.style.borderRight = "1px solid rgba(0, 0, 0, 0.1)"
|
|
48
|
-
// }
|
|
49
|
-
|
|
50
|
-
// }
|
|
51
|
-
// });
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
|
|
54
29
|
const wordGamesToolbarListItems = document.querySelectorAll(
|
|
55
30
|
".wordgames-toolbar-list-item-span"
|
|
56
31
|
);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
item.nextElementSibling.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
32
|
+
if (mediaQuery.matches) {
|
|
33
|
+
Array.from(wordGamesToolbarListItems).map((item) => {
|
|
34
|
+
item.addEventListener("click", (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
var style = window.getComputedStyle(item.nextElementSibling);
|
|
37
|
+
var maxHeight = style.getPropertyValue("max-height");
|
|
38
|
+
if (maxHeight && maxHeight !== "0px") {
|
|
39
|
+
// If the item is expanded, collapse it
|
|
40
|
+
item.nextElementSibling.style.maxHeight = "0";
|
|
41
|
+
item.nextElementSibling.style.opacity = "0";
|
|
42
|
+
item.nextElementSibling.style.height = "0";
|
|
43
|
+
} else {
|
|
44
|
+
// If the item is collapsed, expand it
|
|
45
|
+
item.nextElementSibling.style.maxHeight =
|
|
46
|
+
item.nextElementSibling.scrollHeight + "px";
|
|
47
|
+
item.nextElementSibling.style.opacity = "1";
|
|
48
|
+
item.nextElementSibling.style.height = "auto";
|
|
49
|
+
}
|
|
50
|
+
});
|
|
76
51
|
});
|
|
77
|
-
}
|
|
52
|
+
}
|
|
78
53
|
|
|
79
54
|
|
|
80
55
|
|
|
@@ -83,7 +58,6 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
|
|
|
83
58
|
const menuIcon = '/assets/images/hamburger-menu.svg';
|
|
84
59
|
const closeIcon = '/assets/images/close-menu.svg';
|
|
85
60
|
const imgElement = navbarToggler.querySelector('img');
|
|
86
|
-
|
|
87
61
|
navbarToggler.addEventListener('click', () => {
|
|
88
62
|
if (navBar.classList.contains('show')) {
|
|
89
63
|
navBar.classList.remove('show');
|
|
@@ -125,9 +99,13 @@ function displayResults(results) {
|
|
|
125
99
|
|
|
126
100
|
// Handle search input
|
|
127
101
|
const searchInput = document.querySelector('.searchBar input');
|
|
102
|
+
let data;
|
|
128
103
|
searchInput.addEventListener('input', async (event) => {
|
|
129
104
|
const query = event.target.value;
|
|
130
|
-
|
|
105
|
+
if (!data) {
|
|
106
|
+
// Fetch the data only if it hasn't been fetched before
|
|
107
|
+
data = await fetchData();
|
|
108
|
+
}
|
|
131
109
|
const filteredResults = filterData(data, query);
|
|
132
110
|
displayResults(filteredResults);
|
|
133
111
|
|
|
@@ -136,7 +114,6 @@ searchInput.addEventListener('input', async (event) => {
|
|
|
136
114
|
'event_label': 'Search Box',
|
|
137
115
|
'value': query
|
|
138
116
|
});
|
|
139
|
-
|
|
140
117
|
});
|
|
141
118
|
|
|
142
119
|
// Hide results when clicking outside search input and results container
|
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.9.
|
|
4
|
+
version: 2.9.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: 2024-07-
|
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|