| 
									
										
										
										
											2025-04-26 09:31:14 +00:00
										 |  |  | var message_Path = '/Live2dHistoire/live2d/'; | 
					
						
							|  |  |  | var talkAPI = BlogAPI + "/ai_chat"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-30 13:51:26 +00:00
										 |  |  | $(function () { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:50:47 +00:00
										 |  |  |     (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(); }); | 
					
						
							|  |  |  |     })(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-30 13:51:26 +00:00
										 |  |  |     function showHitCount() { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |         $(".visitors-index").each(function () { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:12:22 +00:00
										 |  |  |             var $elem = $(this); | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |             $.get(BlogAPI + "/count_click?id=" + $elem.attr('id'), function (data) { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:12:22 +00:00
										 |  |  |                 $elem.text(Number(data)); | 
					
						
							|  |  |  |             }); | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2024-09-30 13:51:26 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     function addCount() { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:12:22 +00:00
										 |  |  |         var $visitor = $(".visitors:first"); | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |         $.get(BlogAPI + "/count_click_add?id=" + $visitor.attr('id'), function (data) { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:12:22 +00:00
										 |  |  |             $visitor.text(Number(data)); | 
					
						
							| 
									
										
										
										
											2024-09-30 13:51:26 +00:00
										 |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if ($('.visitors').length == 1) { | 
					
						
							|  |  |  |         addCount(); | 
					
						
							|  |  |  |     } else if ($('.visitors-index').length > 0) { | 
					
						
							|  |  |  |         showHitCount(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-05-11 16:50:47 +00:00
										 |  |  |     if (Math.floor((new Date().getTime() - lastUpdated.getTime()) / (24 * 60 * 60 * 1000)) > 90) { | 
					
						
							| 
									
										
										
										
											2025-05-11 17:14:23 +00:00
										 |  |  |         $("html").css({ | 
					
						
							|  |  |  |             "-webkit-filter": "grayscale(100%)", | 
					
						
							|  |  |  |             "filter": "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)" | 
					
						
							|  |  |  |         }) | 
					
						
							| 
									
										
										
										
											2025-05-11 17:25:57 +00:00
										 |  |  |         $('body').html(function(_, oldHTML) { | 
					
						
							|  |  |  |             return oldHTML.replace(/Mayx/g, 'Ghost'); | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |         console.warn("Mayx may already be Dead"); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-09-30 13:51:26 +00:00
										 |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  | function getSearchJSON(callback) { | 
					
						
							| 
									
										
										
										
											2025-06-02 12:22:47 +00:00
										 |  |  |     if (typeof Storage == 'undefined') { | 
					
						
							|  |  |  |         $.getJSON("/search.json", callback); | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |     var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf())); | 
					
						
							|  |  |  |     if (!searchData) { | 
					
						
							| 
									
										
										
										
											2025-06-02 14:31:40 +00:00
										 |  |  |         for (var i = localStorage.length - 1; i >= 0; i--) { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |             var key = localStorage.key(i); | 
					
						
							| 
									
										
										
										
											2025-06-02 14:31:40 +00:00
										 |  |  |             if (key.indexOf('blog_') === 0) { | 
					
						
							| 
									
										
										
										
											2025-05-11 16:23:23 +00:00
										 |  |  |                 localStorage.removeItem(key); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $.getJSON("/search.json", function (data) { | 
					
						
							|  |  |  |             localStorage.setItem("blog_" + lastUpdated.valueOf(), JSON.stringify(data)); | 
					
						
							|  |  |  |             callback(data); | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         callback(searchData); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-04-26 09:31:14 +00:00
										 |  |  | } |