jekyll-theme-simplix 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/assets/script.js +10 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27db881f44f7469cb213680c98a59e09ac7f1d178e272d9eb8fd3b9bed096274
4
- data.tar.gz: 249d985eab9df442e81e16805f2c423025d82b6134cd3365c6ee6d7bb93d8504
3
+ metadata.gz: 27d32720b4bcccd99d67754350f04fb43f323d4393831ff4a6e3c05c65f7c636
4
+ data.tar.gz: dd953e09de01f180690e7d1d810a72c06ef496a53bc64d1d1049b7fc63a93904
5
5
  SHA512:
6
- metadata.gz: 6214c3c9b61d4be170387e18409d7327db629a5d3feedb7be7ebd663a54b0feae168884142c0820e026a07c4608575aecdd2201f66680d81b3bc132559d07c8e
7
- data.tar.gz: db78aff388b7fa8345cc316dab0cc265d6a1355d3101f461df8852e335dc0bc9df7542e4f2f80a5cb22bc7c0c01e46591cea7437513c2e5506327a8b71b5e0f4
6
+ metadata.gz: c73248ddb69f2afc21cd59be0798afe629d235c769a173ac3a5f4af4bf4bcbfdea419697956f56d2bd135d762dc0fc69c23ce362ee47b7c3f40e651c42496143
7
+ data.tar.gz: 37972db94f49a3a633986ef777c2d916fe8d369a252da9edf38c759f8707becc83ca2e7552e3268936093679c049d05aebb86dff3fe0fcf7ee1d20b484480cc1
data/assets/script.js CHANGED
@@ -23,14 +23,18 @@
23
23
  document.body.id = "main__theme-" + (th_val == "dark" || th_val == "light" ? th_val : th_match ? "dark" : "light");
24
24
 
25
25
  // Initialize navigation menu
26
- const nav = document.querySelector("nav"), nav_btn = nav.querySelector("button"), nav_links = nav.querySelector(".nav__links"), nav_ev = function() {if(nav.classList.contains("nav__multi")) nav_btn.innerHTML = nav.classList.toggle("nav__open") ? "\ue4f6 Close" : "\ue2f0 Menu"};
27
- nav.style.display = "flex";
28
- nav_btn.onclick = function() {
29
- nav_ev();
30
- navigator.userAgentData.mobile && history.pushState(null, null, window.location.pathname);
26
+ const nav = document.querySelector("nav"), nav_btn = nav.querySelector("button"), nav_links = nav.querySelector(".nav__links"), nav_ev = function(i) {
27
+ if(nav.classList.contains("nav__multi")) {
28
+ i ? nav.classList.add("nav__open") : nav.classList.remove("nav__open");
29
+ nav_btn.innerHTML = i ? '<i class="ph ph-x"></i> Close' : '<i class="ph ph-list"></i> Menu';
30
+ return i;
31
+ } else return false;
31
32
  };
33
+ nav.style.display = "flex";
34
+ nav_btn.onclick = function() {nav_ev(nav.classList.toggle("nav__open")) ? history.pushState(null, null, window.location.pathname) : history.back()};
35
+ window.onpopstate = function() {nav_ev(false)};
32
36
  nav_links.onclick = function(e) {e.target.tagName != "a" && nav_ev()};
33
- navigator.userAgentData && navigator.userAgentData.mobile ? window.onpopstate = nav_ev : nav_links.addEventListener("wheel", function(e) {
37
+ nav_links.addEventListener("wheel", function(e) {
34
38
  if(window.innerWidth >= 768) {
35
39
  e.preventDefault();
36
40
  nav_links.scrollLeft += e.deltaY;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-simplix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lithier94675