Update 3 files

- /assets/js/main.js
- /_layouts/default.html
- /_layouts/post.html
This commit is contained in:
mayx
2025-05-11 16:50:47 +00:00
parent dbc8d7fb3c
commit de996d9015
3 changed files with 15 additions and 25 deletions

View File

@@ -1,18 +1,19 @@
var message_Path = '/Live2dHistoire/live2d/';
var talkAPI = BlogAPI + "/ai_chat";
(function () {
var $backToTopTxt = "返回顶部", $backToTopEle = $('<div class="backToTop"></div>').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 = $('<div class="backToTop"></div>').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");