From de996d9015d603cf7ddb417c2adca17cb78f707d Mon Sep 17 00:00:00 2001 From: mayx Date: Sun, 11 May 2025 16:50:47 +0000 Subject: Update 3 files - /assets/js/main.js - /_layouts/default.html - /_layouts/post.html--- assets/js/main.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'assets/js') diff --git a/assets/js/main.js b/assets/js/main.js index 020c269..444e7cf 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,18 +1,19 @@ var message_Path = '/Live2dHistoire/live2d/'; var talkAPI = BlogAPI + "/ai_chat"; -(function () { - var $backToTopTxt = "返回顶部", $backToTopEle = $('
').appendTo($("body")) - .text($backToTopTxt).attr("title", $backToTopTxt).click(function () { - $("html, body").animate({ scrollTop: 0 }, 120); - }), $backToTopFun = function () { - var st = $(document).scrollTop(), winh = $(window).height(); - (st > 0) ? $backToTopEle.show() : $backToTopEle.hide(); - }; - $(window).bind("scroll", $backToTopFun); - $(function () { $backToTopFun(); }); -})(); $(function () { + (function () { + var $backToTopTxt = "返回顶部", $backToTopEle = $('').appendTo($("body")) + .text($backToTopTxt).attr("title", $backToTopTxt).click(function () { + $("html, body").animate({ scrollTop: 0 }, 120); + }), $backToTopFun = function () { + var st = $(document).scrollTop(), winh = $(window).height(); + (st > 0) ? $backToTopEle.show() : $backToTopEle.hide(); + }; + $(window).bind("scroll", $backToTopFun); + $(function () { $backToTopFun(); }); + })(); + function showHitCount() { $(".visitors-index").each(function () { var $elem = $(this); @@ -21,7 +22,6 @@ $(function () { }); }); } - function addCount() { var $visitor = $(".visitors:first"); $.get(BlogAPI + "/count_click_add?id=" + $visitor.attr('id'), function (data) { @@ -34,12 +34,7 @@ $(function () { showHitCount(); } - today = new Date(); - timeold = (today.getTime() - lastUpdated.getTime()); - secondsold = Math.floor(timeold / 1000); - e_daysold = timeold / (24 * 60 * 60 * 1000); - daysold = Math.floor(e_daysold); - if (daysold > 90) { + if (Math.floor((new Date().getTime() - lastUpdated.getTime()) / (24 * 60 * 60 * 1000)) > 90) { $("html")[0].style = "-webkit-filter: grayscale(100%);filter:progid:DXImageTransform.Microsoft.BasicImage(graysale=1);"; $("html")[0].innerHTML = $("html")[0].innerHTML.replace(/Mayx/g, "Ghost"); console.warn("Mayx may already be Dead"); -- cgit 1.4.1-2-gfad0