PageSourceSearch

https://hirak0.github.io/js/footer.js

js hirak0.github.io collected 2026-10-03 09:17:49 UTC 2,348 bytes, 81 lines download raw bytes

1
2$(document).ready(function () {
3  //img lazy loaded
4  const observer = lozad();
5  observer.observe();
6
7  $(document).on('click', '.has-sub', function () {
8    var _this = $(this)
9    if (!$(this).hasClass('expanded')) {
10      setTimeout(function () {
11        _this.find('ul').attr("style", "")
12      }, 300);
13
14    } else {
15      $('.has-sub ul').each(function (id, ele) {
16        var _that = $(this)
17        if (_this.find('ul')[0] != ele) {
18          setTimeout(function () {
19            _that.attr("style", "")
20          }, 300);
21        }
22      })
23    }
24  })
25  $('.user-info-menu .hidden-sm').click(function () {
26    if ($('.sidebar-menu').hasClass('collapsed')) {
27      $('.has-sub.expanded > ul').attr("style", "")
28    } else {
29      $('.has-sub.expanded > ul').show()
30    }
31  })
32  $("#main-menu li ul li").click(function () {
33    $(this).siblings('li').removeClass('active'); // 删除其他兄弟元素的样式
34    $(this).addClass('active'); // 添加当前元素的样式
35  });
36  $("a.smooth").click(function (ev) {
37    ev.preventDefault();
38
39    public_vars.$mainMenu.add(public_vars.$sidebarProfile).toggleClass('mobile-is-visible');
40    ps_destroy();
41    $("html, body").animate({
42      scrollTop: $($(this).attr("href")).offset().top - 30
43    }, {
44      duration: 500,
45      easing: "swing"
46    });
47  });
48  return false;
49});
50
51var href = "";
52var pos = 0;
53$("a.smooth").click(function (e) {
54  $("#main-menu li").each(function () {
55    $(this).removeClass("active");
56  });
57  $(this).parent("li").addClass("active");
58  e.preventDefault();
59  href = $(this).attr("href");
60  pos = $(href).position().top - 30;
61});
62(function () {
63  if (document.cookie.replace(/(?:(?:^|.*;\s*)night\s*\=\s*([^;]*).*$)|^.*$/, "$1") === '') {
64    if (new Date().getHours() > 22 || new Date().getHours() < 6) {
65      document.body.classList.add('night');
66      document.cookie = "night=1;path=/";
67      console.log('夜间模式开启');
68    } else {
69      document.body.classList.remove('night');
70      document.cookie = "night=0;path=/";
71      console.log('夜间模式关闭');
72    }
73  } else {
74    var night = document.cookie.replace(/(?:(?:^|.*;\s*)night\s*\=\s*([^;]*).*$)|^.*$/, "$1") || '0';
75    if (night == '0') {
76      document.body.classList.remove('night');
77    } else if (night == '1') {
78      document.body.classList.add('night');
79    }
80  }
81})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.