// ==UserScript==
// @name Tuxun Homepage Reset
// @namespace tuxun-reset
// @version 0.1.7
// @description reset tuxun homepage to 2024.3 version
// @author strombooli
// @license MIT
// @match https://tuxun.fun/
// @grant GM_xmlhttpRequest
// @downloadURL https://update.greasyfork.icu/scripts/491428/Tuxun%20Homepage%20Reset.user.js
// @updateURL https://update.greasyfork.icu/scripts/491428/Tuxun%20Homepage%20Reset.meta.js
// ==/UserScript==
(function() {
'use strict';
document.body.removeChild(document.getElementById('root')) // remove default
document.head.innerHTML += ""
var htmlTxt = "

教程文档
探索真实世界,找到你在的位置
ACTIVITIES
"
var activityList = []
GM_xmlhttpRequest({
method: "GET",
url: "https://tuxun.fun/api/v0/tuxun/activity/list",
headers: {"Content-Type": "application/json"},
onload: function(response) {
activityList = JSON.parse(response.responseText).data.normalActivities
let activityHtml = ""
for(let i=0;i" + activityList[i].title + ""
}
if (activityHtml == "") activityHtml = "
";
htmlTxt = htmlTxt.replace("ACTIVITIES", activityHtml)
var doc = new DOMParser().parseFromString(htmlTxt, "text/html");
document.body.appendChild(doc.body.children[0])
bindInLinks()
bindOutLinks()
bindPersonal()
setTotalGuess()
setInterval(function(){setTotalGuess()}, 5000)
}
});
function bindInLinks(){
let reDirs = ["friend", "message", "point-rank", "world-match", "china-match", "streak", "maps", "daily-challenge", "interact/challenge", "interact", "team", "party", "join", "event", "wonders", "random", "app", "mall"]
reDirs.forEach(function(e){
document.getElementById(e).addEventListener("click", function(){
location.href = "https://tuxun.fun/" + e;
console.log(e);
})
})
}
function bindOutLinks(){
let reDirOut = [["doc1", "https://www.yuque.com/chaofun/tuxun"],
["doc2", "https://www.yuque.com/chaofun/tuxun"],
["log", "https://www.yuque.com/chaofun/tuxun/changelog"],
["vid", "https://search.bilibili.com/all?keyword=%E5%9B%BE%E5%AF%BB"],
["forum", "https://choa.fun/f/753"],
["mizong", "https://choa.fun/f/84"],
["xiaoce", "https://xiaoce.fun"],
]
for(let i=0;i