summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormayx <mayx@outlook.com>2025-05-11 18:50:47 +0200
committermayx <mayx@outlook.com>2025-05-11 18:50:47 +0200
commitde996d9015d603cf7ddb417c2adca17cb78f707d (patch)
tree39bdfb3330075932a86dac72af16d330b92b5f7e
parentdbc8d7fb3cb30133ede3b1a9e8135e15c200046b (diff)
Update 3 files
- /assets/js/main.js - /_layouts/default.html - /_layouts/post.html
-rw-r--r--_layouts/default.html2
-rw-r--r--_layouts/post.html7
-rw-r--r--assets/js/main.js31
3 files changed, 15 insertions, 25 deletions
diff --git a/_layouts/default.html b/_layouts/default.html
index db770f7..54fdaed 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -22,7 +22,7 @@
<script src="/assets/js/jquery.min.js"></script>
<script>
- var lastUpdated = new Date("{{ site.time | date_to_xmlschema }}");
+ var lastUpdated = new Date("{{ site.time | date_to_rfc822 }}");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
diff --git a/_layouts/post.html b/_layouts/post.html
index 45fd562..95dd40d 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -12,12 +12,7 @@ layout: default
<br /><br />
</div>
<script>
- BirthDay = new Date("{{ page.date | date_to_xmlschema }}");
- today = new Date();
- timeold = (today.getTime() - BirthDay.getTime());
- secondsold = Math.floor(timeold / 1000);
- e_daysold = timeold / (24 * 60 * 60 * 1000);
- daysold = Math.floor(e_daysold);
+ daysold = Math.floor((new Date().getTime() - new Date("{{ page.date | date_to_rfc822 }}").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
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 = $('<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");