2 Commits

Author SHA1 Message Date
111dc1e25f Update 2 files
- /assets/js/pjax.js
- /index.html
2026-05-21 08:27:59 +00:00
c4ae25dcb1 Update 10 files
- /assets/js/jquery.pjax.min.js
- /assets/js/main.js
- /assets/js/pjax.js
- /_layouts/default.html
- /_layouts/post.html
- /_data/proxylist.yml
- /_data/other_repo_list.csv
- /Live2dHistoire/live2d/js/message.js
- /index.html
- /search.html
2026-05-21 07:38:17 +00:00
10 changed files with 482 additions and 105 deletions

View File

@ -22,6 +22,8 @@ if (!norunFlag) {
var sleepTimer_ = null; var sleepTimer_ = null;
var AITalkFlag = false; var AITalkFlag = false;
var talkNum = 0; var talkNum = 0;
// 暴露到全局,供 pjax.js 在页面切换后重新调用
window._live2d = { initTips: null, showMessage: null, showHitokoto: null };
(function () { (function () {
function renderTip(template, context) { function renderTip(template, context) {
var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g; var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
@ -33,11 +35,11 @@ if (!norunFlag) {
var currentObject = context; var currentObject = context;
var i, length, variable; var i, length, variable;
for (i = 0, length = variables.length; i < length; ++i) { for (i = 0, length = variables.length; i < length; ++i) {
variable = variables[i]; variable = currentObject[variables[i]];
currentObject = currentObject[variable]; if (variable === undefined || variable === null) return '';
if (currentObject === undefined || currentObject === null) return ''; currentObject = variable;
} }
return currentObject; return String(currentObject);
}); });
} }
@ -56,14 +58,20 @@ if (!norunFlag) {
showMessage('你都复制了些什么呀,转载要记得加上出处哦~~', 5000); showMessage('你都复制了些什么呀,转载要记得加上出处哦~~', 5000);
}); });
// 缓存 message.json 数据,供 PJAX 重绑定使用
var tipsData = null;
function initTips() { function initTips() {
$.ajax({ $.ajax({
cache: true, cache: true,
url: message_Path + 'message.json', url: message_Path + 'message.json',
dataType: "json", dataType: "json",
success: function (result) { success: function (result) {
tipsData = result;
// 解绑旧事件(用命名空间避免影响其他绑定)
$.each(result.mouseover, function (index, tips) { $.each(result.mouseover, function (index, tips) {
$(tips.selector).mouseover(function () { $(tips.selector).off('mouseover._live2d_tips mouseout._live2d_tips');
$(tips.selector).on('mouseover._live2d_tips', function () {
var text = tips.text; var text = tips.text;
if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1]; if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1];
text = text.renderTip({ text: $(this).text() }); text = text.renderTip({ text: $(this).text() });
@ -72,7 +80,7 @@ if (!norunFlag) {
clearInterval(liveTlakTimer); clearInterval(liveTlakTimer);
liveTlakTimer = null; liveTlakTimer = null;
}); });
$(tips.selector).mouseout(function () { $(tips.selector).on('mouseout._live2d_tips', function () {
showHitokoto(); showHitokoto();
if (liveTlakTimer == null) { if (liveTlakTimer == null) {
liveTlakTimer = window.setInterval(function () { liveTlakTimer = window.setInterval(function () {
@ -82,7 +90,8 @@ if (!norunFlag) {
}); });
}); });
$.each(result.click, function (index, tips) { $.each(result.click, function (index, tips) {
$(tips.selector).click(function () { $(tips.selector).off('click._live2d_tips');
$(tips.selector).on('click._live2d_tips', function () {
if (hitFlag) { if (hitFlag) {
return false return false
} }
@ -106,23 +115,26 @@ if (!norunFlag) {
} }
}); });
} }
window._live2d.initTips = initTips;
initTips(); initTips();
var text; var text;
if (document.referrer !== '' && document.referrer.split('/')[2] !== window.location.host) { if (document.referrer !== '' && document.referrer.split('/')[2] !== window.location.host) {
var referrer = document.createElement('a'); var referrer = document.createElement('a');
referrer.href = document.referrer; referrer.href = document.referrer;
text = '嗨!来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友!';
var domain = referrer.hostname.split('.')[1]; var domain = referrer.hostname.split('.')[1];
if (domain == 'baidu') { if (domain == 'baidu' || domain == 'so' || domain == 'google') {
text = '嗨! 来自 百度搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>'; var source = domain == 'baidu' ? '百度搜索' : domain == 'so' ? '360搜索' : '谷歌搜索';
} else if (domain == 'so') { text = '嗨! 来自 ' + source + ' 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
text = '嗨! 来自 360搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>'; } else {
} else if (domain == 'google') { text = '嗨!来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友!';
text = '嗨! 来自 谷歌搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
} }
} else if (typeof window._pjaxGetWelcomeText === 'function') {
// 复用 pjax.js 中的欢迎语生成函数,避免重复逻辑
text = window._pjaxGetWelcomeText();
} else { } else {
if (window.location.pathname == "/") { //主页URL判断需要斜杠结尾 // pjax.js 尚未加载时的兜底(首次访问且 pjax.js 在 message.js 之后加载)
if (window.location.pathname == "/") {
var now = (new Date()).getHours(); var now = (new Date()).getHours();
if (now > 23 || now <= 5) { if (now > 23 || now <= 5) {
text = '你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?'; text = '你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?';
@ -172,6 +184,7 @@ if (!norunFlag) {
console.log(sleepTimer_); console.log(sleepTimer_);
} }
} }
window._live2d.showHitokoto = showHitokoto;
function checkSleep() { function checkSleep() {
var sleepStatu = sessionStorage.getItem("Sleepy"); var sleepStatu = sessionStorage.getItem("Sleepy");
@ -213,6 +226,7 @@ if (!norunFlag) {
//if (timeout === null) timeout = 5000; //if (timeout === null) timeout = 5000;
//hideMessage(timeout); //hideMessage(timeout);
} }
window._live2d.showMessage = showMessage;
function talkValTimer() { function talkValTimer() {
$('#live_talk').val('1'); $('#live_talk').val('1');
} }
@ -384,74 +398,100 @@ if (!norunFlag) {
}; };
}; };
//获取音乐信息初始化 //获取音乐信息初始化
var bgmListInfo = $('input[name=live2dBGM]'); var $bgm = $('#live2d_bgm');
if (bgmListInfo.length == 0) {
$('#musicButton').hide(); // 音乐按钮点击事件(幂等,使用命名空间避免重复绑定)
} else { $('#musicButton').off('click._bgm').on('click._bgm', function () {
var bgmPlayNow = parseInt($('#live2d_bgm').attr('data-bgm')); if ($('#musicButton').hasClass('play')) {
var bgmPlayTime = 0; $bgm[0].pause();
var live2dBGM_Num = sessionStorage.getItem("live2dBGM_Num"); $('#musicButton').removeClass('play');
var live2dBGM_PlayTime = sessionStorage.getItem("live2dBGM_PlayTime"); sessionStorage.setItem("live2dBGM_IsPlay", '1');
if (live2dBGM_Num) { } else {
if (live2dBGM_Num <= $('input[name=live2dBGM]').length - 1) { $bgm[0].play();
bgmPlayNow = parseInt(live2dBGM_Num);
}
}
if (live2dBGM_PlayTime) {
bgmPlayTime = parseInt(live2dBGM_PlayTime);
}
var live2dBGMSrc = bgmListInfo.eq(bgmPlayNow).val();
$('#live2d_bgm').attr('data-bgm', bgmPlayNow);
$('#live2d_bgm').attr('src', live2dBGMSrc);
$('#live2d_bgm')[0].currentTime = bgmPlayTime;
$('#live2d_bgm')[0].volume = 0.5;
var live2dBGM_IsPlay = sessionStorage.getItem("live2dBGM_IsPlay");
var live2dBGM_WindowClose = sessionStorage.getItem("live2dBGM_WindowClose");
if (live2dBGM_IsPlay == '0' && live2dBGM_WindowClose == '0') {
$('#live2d_bgm')[0].play();
$('#musicButton').addClass('play'); $('#musicButton').addClass('play');
sessionStorage.setItem("live2dBGM_IsPlay", '0');
} }
sessionStorage.setItem("live2dBGM_WindowClose", '1'); });
$('#musicButton').on('click', function () {
if ($('#musicButton').hasClass('play')) { // BGM 事件监听(仅绑定一次,使用标志位避免重复)
$('#live2d_bgm')[0].pause(); if (!window._live2d._bgmEventsBound) {
$('#musicButton').removeClass('play'); $bgm[0].addEventListener("timeupdate", function () {
sessionStorage.setItem("live2dBGM_IsPlay", '1'); sessionStorage.setItem("live2dBGM_PlayTime", $bgm[0].currentTime);
} else { });
$('#live2d_bgm')[0].play(); $bgm[0].addEventListener("ended", function () {
$('#musicButton').addClass('play'); var listNow = parseInt($bgm.attr('data-bgm'));
sessionStorage.setItem("live2dBGM_IsPlay", '0'); listNow++;
var inputs = $('input[name=live2dBGM]');
if (inputs.length === 0) return;
if (listNow > inputs.length - 1) {
listNow = 0;
} }
var listNewSrc = inputs.eq(listNow).val();
if (!listNewSrc) return;
sessionStorage.setItem("live2dBGM_Num", listNow);
$bgm.attr('src', listNewSrc);
$bgm[0].play();
$bgm.attr('data-bgm', listNow);
});
$bgm[0].addEventListener("error", function () {
$bgm[0].pause();
$('#musicButton').removeClass('play');
showMessage('音乐似乎加载不出来了呢!', 0);
}); });
window.onbeforeunload = function () { window.onbeforeunload = function () {
sessionStorage.setItem("live2dBGM_WindowClose", '0'); sessionStorage.setItem("live2dBGM_WindowClose", '0');
if ($('#musicButton').hasClass('play')) { if ($('#musicButton').hasClass('play')) {
sessionStorage.setItem("live2dBGM_IsPlay", '0'); sessionStorage.setItem("live2dBGM_IsPlay", '0');
} }
} };
document.getElementById('live2d_bgm').addEventListener("timeupdate", function () { window._live2d._bgmEventsBound = true;
var live2dBgmPlayTimeNow = document.getElementById('live2d_bgm').currentTime; }
sessionStorage.setItem("live2dBGM_PlayTime", live2dBgmPlayTimeNow);
}); // 初始化 BGM根据当前页面是否有 BGM 输入)
document.getElementById('live2d_bgm').addEventListener("ended", function () { if (typeof window._live2d.initBGM === 'function') {
var listNow = parseInt($('#live2d_bgm').attr('data-bgm')); window._live2d.initBGM();
listNow++;
if (listNow > $('input[name=live2dBGM]').length - 1) {
listNow = 0;
}
var listNewSrc = $('input[name=live2dBGM]').eq(listNow).val();
sessionStorage.setItem("live2dBGM_Num", listNow);
$('#live2d_bgm').attr('src', listNewSrc);
$('#live2d_bgm')[0].play();
$('#live2d_bgm').attr('data-bgm', listNow);
});
document.getElementById('live2d_bgm').addEventListener("error", function () {
$('#live2d_bgm')[0].pause();
$('#musicButton').removeClass('play');
showMessage('音乐似乎加载不出来了呢!', 0);
});
} }
} }
// 暴露 BGM 初始化函数,供 PJAX 重初始化时调用
window._live2d.initBGM = function() {
var bgmListInfo = $('input[name=live2dBGM]');
var $bgm = $('#live2d_bgm');
if (bgmListInfo.length === 0) {
$('#musicButton').hide();
if ($bgm.length) $bgm[0].pause();
return;
}
var bgmPlayNow = parseInt($bgm.attr('data-bgm')) || 0;
var bgmPlayTime = 0;
var live2dBGM_Num = sessionStorage.getItem("live2dBGM_Num");
var live2dBGM_PlayTime = sessionStorage.getItem("live2dBGM_PlayTime");
if (live2dBGM_Num) {
if (parseInt(live2dBGM_Num) <= bgmListInfo.length - 1) {
bgmPlayNow = parseInt(live2dBGM_Num);
}
}
if (live2dBGM_PlayTime) {
bgmPlayTime = parseFloat(live2dBGM_PlayTime);
}
var newSrc = bgmListInfo.eq(bgmPlayNow).val();
$bgm.attr('data-bgm', bgmPlayNow);
if ($bgm.attr('src') !== newSrc) {
$bgm[0].pause();
$bgm.attr('src', newSrc);
$bgm[0].currentTime = bgmPlayTime;
}
$bgm[0].volume = 0.5;
var live2dBGM_IsPlay = sessionStorage.getItem("live2dBGM_IsPlay");
var live2dBGM_WindowClose = sessionStorage.getItem("live2dBGM_WindowClose");
if (live2dBGM_IsPlay == '0' && live2dBGM_WindowClose == '0') {
$bgm[0].play();
$('#musicButton').addClass('play');
}
sessionStorage.setItem("live2dBGM_WindowClose", '1');
$('#musicButton').show();
};
$(document).ready(function () { $(document).ready(function () {
var AIimgSrc = [ var AIimgSrc = [
message_Path + "model/histoire/histoire.1024/texture_00.png", message_Path + "model/histoire/histoire.1024/texture_00.png",

View File

@ -83,7 +83,6 @@ http://207.180.229.193:3001/mayx/blog
http://34.81.52.16/mayx/blog http://34.81.52.16/mayx/blog
http://123.57.16.111:3000/mayx/blog http://123.57.16.111:3000/mayx/blog
https://lius.familyds.org:3000/mayx/blog https://lius.familyds.org:3000/mayx/blog
https://gitea.questline.coop/mayx/blog
http://git.chaojing-film.com:3000/mayx/blog http://git.chaojing-film.com:3000/mayx/blog
https://git.nusaerp.com/mayx/blog https://git.nusaerp.com/mayx/blog
http://35.207.205.18:3000/mayx/blog http://35.207.205.18:3000/mayx/blog
@ -198,7 +197,6 @@ https://gitea.dsmaster.myds.me/mayx/blog
https://gitea.primecontrols-dev.com/mayx/blog https://gitea.primecontrols-dev.com/mayx/blog
http://www.scserverddns.top:13000/mayx/blog http://www.scserverddns.top:13000/mayx/blog
https://git.lucas-michel.fr/mayx/blog https://git.lucas-michel.fr/mayx/blog
http://60.205.162.59:3000/mayx/blog
https://git.imvictor.tech:2/mayx/blog https://git.imvictor.tech:2/mayx/blog
http://47.112.137.193:3000/mayx/blog http://47.112.137.193:3000/mayx/blog
http://58.38.123.148:3176/mayx/blog http://58.38.123.148:3176/mayx/blog
@ -344,7 +342,6 @@ http://82.156.89.21:3000/mayx/blog_cn
https://git.sskuaixiu.com/mayx/blog_cn https://git.sskuaixiu.com/mayx/blog_cn
http://xujiesoft.vicp.net:3000/mayx/blog_cn http://xujiesoft.vicp.net:3000/mayx/blog_cn
http://113.44.36.103:23000/mayx/blog_cn http://113.44.36.103:23000/mayx/blog_cn
http://111.230.92.227:3000/mayx/blog_cn
https://git.mingliqiye.com/mayx/blog_cn https://git.mingliqiye.com/mayx/blog_cn
http://119.29.194.155:8894/mayx/blog_cn http://119.29.194.155:8894/mayx/blog_cn
http://43.138.249.161:3000/mayx/blog_cn http://43.138.249.161:3000/mayx/blog_cn
@ -371,7 +368,6 @@ https://git.secretserver.club/mayx/blog
https://gitea.adber.tech/mayx/blog https://gitea.adber.tech/mayx/blog
https://gitea.hello.faith/mayx/blog https://gitea.hello.faith/mayx/blog
https://tea.neuron.my/mayx/blog https://tea.neuron.my/mayx/blog
https://git.econutrix.com/mayx/blog
https://git.violka-it.net/mayx/blog https://git.violka-it.net/mayx/blog
https://git.adityagupta.dev/mayx/blog https://git.adityagupta.dev/mayx/blog
https://code.ownwire.net/mayx/blog https://code.ownwire.net/mayx/blog
@ -396,7 +392,6 @@ https://suprasage.com/mayx/blog
https://git.zakum.cn/mayx/blog https://git.zakum.cn/mayx/blog
https://gitea.amazingcoders.com/mayx/blog https://gitea.amazingcoders.com/mayx/blog
https://gitea.kamilklecha.dev/mayx/blog https://gitea.kamilklecha.dev/mayx/blog
https://forgejo.testbed.unict.it/mayx/blog
http://47.109.103.110:9000/mayx/blog_cn http://47.109.103.110:9000/mayx/blog_cn
http://47.105.124.101:3000/mayx/blog_cn http://47.105.124.101:3000/mayx/blog_cn
http://49.232.183.190:3000/mayx/blog_cn http://49.232.183.190:3000/mayx/blog_cn
@ -406,7 +401,6 @@ https://gitea.shizuka.icu/mayx/blog_cn
http://43.139.2.237:3000/mayx/blog_cn http://43.139.2.237:3000/mayx/blog_cn
http://51.159.198.233:3000/mayx/blog http://51.159.198.233:3000/mayx/blog
https://gitea.adriangonzalezbarbosa.eu/mayx/blog https://gitea.adriangonzalezbarbosa.eu/mayx/blog
http://39.108.124.198:3000/mayx/blog
https://git.legatus.ru/mayx/blog https://git.legatus.ru/mayx/blog
https://git.kayashov.keenetic.pro/mayx/blog https://git.kayashov.keenetic.pro/mayx/blog
http://43.138.83.20:3000/mayx/blog_cn http://43.138.83.20:3000/mayx/blog_cn
@ -439,7 +433,6 @@ http://36.133.248.69:3088/mayx/blog_cn
http://220.205.16.27:18081/mayx/blog_cn http://220.205.16.27:18081/mayx/blog_cn
http://81.69.221.216:3000/mayx/blog_cn http://81.69.221.216:3000/mayx/blog_cn
http://115.159.194.75:4000/mayx/blog_cn http://115.159.194.75:4000/mayx/blog_cn
http://115.190.214.62:3001/mayx/blog_cn
http://183.204.60.122:10081/mayx/blog_cn http://183.204.60.122:10081/mayx/blog_cn
http://43.139.240.37:17000/mayx/blog_cn http://43.139.240.37:17000/mayx/blog_cn
http://159.75.27.114:3000/mayx/blog_cn http://159.75.27.114:3000/mayx/blog_cn
@ -497,7 +490,6 @@ http://huanghomenas2.myqnapcloud.com:4000/mayx/blog_cn
http://43.142.166.108:10082/mayx/blog_cn http://43.142.166.108:10082/mayx/blog_cn
https://git.ueda.sk/mayx/blog_cn https://git.ueda.sk/mayx/blog_cn
https://tm-jikayo.com/mayx/blog_cn https://tm-jikayo.com/mayx/blog_cn
http://112.6.10.77:3000/mayx/blog_cn
http://zzdgitea.stnav.com/mayx/blog_cn http://zzdgitea.stnav.com/mayx/blog_cn
http://1.117.66.197:3000/mayx/blog_cn http://1.117.66.197:3000/mayx/blog_cn
http://git.zhmight.com/mayx/blog_cn http://git.zhmight.com/mayx/blog_cn
@ -509,7 +501,6 @@ http://ydds.cloud:3000/mayx/blog_cn
https://git.keruixinda.com/mayx/blog_cn https://git.keruixinda.com/mayx/blog_cn
http://120.24.50.145:3000/mayx/blog_cn http://120.24.50.145:3000/mayx/blog_cn
https://code.draussenfunker.de/mayx/blog_cn https://code.draussenfunker.de/mayx/blog_cn
https://git.gede.at/mayx/blog_cn
https://git.dinsor.co.th/mayx/blog https://git.dinsor.co.th/mayx/blog
https://ofibohost.com/mayx/blog https://ofibohost.com/mayx/blog
https://lab.iishka.net/mayx/blog https://lab.iishka.net/mayx/blog
@ -528,13 +519,10 @@ https://gitea.malxte.de/mayx/blog
https://git.nizart.me/mayx/blog https://git.nizart.me/mayx/blog
https://git.ddns.net/mayx/blog https://git.ddns.net/mayx/blog
http://222.85.214.245:9776/mayx/blog http://222.85.214.245:9776/mayx/blog
https://git.thubn.de/mayx/blog
https://git.tolyaneblan.ru/mayx/blog
https://git.kraevsky.ru/mayx/blog https://git.kraevsky.ru/mayx/blog
https://ruyiscx.cloud:3000/mayx/blog https://ruyiscx.cloud:3000/mayx/blog
https://git.0xee.eu/mayx/blog https://git.0xee.eu/mayx/blog
https://gitea.deitglobal.com/mayx/blog https://gitea.deitglobal.com/mayx/blog
https://git.sprunk.me/mayx/blog
https://www.mygitea.ru/mayx/blog https://www.mygitea.ru/mayx/blog
https://git.crwlr.ir/mayx/blog https://git.crwlr.ir/mayx/blog
https://git.nozora.top/mayx/blog https://git.nozora.top/mayx/blog
@ -549,15 +537,15 @@ http://47.108.255.216:3000/mayx/blog_cn
https://gitea.molietech.com/mayx/blog_cn https://gitea.molietech.com/mayx/blog_cn
http://58.87.88.234:3000/mayx/blog_cn http://58.87.88.234:3000/mayx/blog_cn
http://210.75.240.13:3000/mayx/blog_cn http://210.75.240.13:3000/mayx/blog_cn
https://gitea.twomiracles.xyz/mayx/blog_cn
https://git.xz-i.com:30443/mayx/blog_cn https://git.xz-i.com:30443/mayx/blog_cn
http://111.229.64.148:8080/mayx/blog_cn http://111.229.64.148:8080/mayx/blog_cn
https://git.fynn.vip/mayx/blog_cn https://git.fynn.vip/mayx/blog_cn
http://119.91.212.17:3000/mayx/blog_cn http://119.91.212.17:3000/mayx/blog_cn
https://git.serhii.ru/mayx/blog_cn
https://gitea.y8o.de/mayx/blog_cn
http://git.hbg99.com:8080/mayx/blog_cn http://git.hbg99.com:8080/mayx/blog_cn
https://git.eplg.services/mayx/blog https://git.eplg.services/mayx/blog
http://89.167.38.168:3001/mayx/blog http://89.167.38.168:3001/mayx/blog
http://namonba.asuscomm.com:3001/mayx/blog http://namonba.asuscomm.com:3001/mayx/blog
http://109.199.98.226:3001/mayx/blog http://109.199.98.226:3001/mayx/blog
https://git.extra.eiffel.com/mayx/blog
https://gitea.digitanie.org/mayx/blog
http://124.207.0.162:30000/mayx/blog

Internal Server Error - xll
500 Internal Server Error

Gitea Version: 1.24.2