// ==UserScript==
// @name 图寻自信模式
// @namespace http://tampermonkey.net/
// @version 1.1
// @description 在对局中隐藏对方的所有信息或者每轮双方血量的变化。
// @icon https://s.chao-fan.com/tuxun/favicon.ico
// @author 专业航线规划员
// @match https://tuxun.fun/*
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
var styleOpponent = document.createElement('style');
styleOpponent.type = 'text/css';
styleOpponent.innerHTML = `
.playerName___IKlNQ { display: none !important; }
.userName___MXV57 { display: none !important; }
.maplibregl-marker.maplibregl-marker-anchor-bottom .ant-avatar.ant-avatar-circle.ant-avatar-image.css-i874aq img { display: none !important; }
.maplibregl-marker.maplibregl-marker-anchor-bottom sup { display: none !important; }
.vs___oRM_X { display: none !important; }
.hudContainer___HMMcE:not(.rightTeam___kVrbS) .avatarCover___tYu0C { background-image: url("https://s.chao-fan.com/tuxun/images/user/red_team.png") !important; }
.hudContainer___HMMcE.rightTeam___kVrbS .avatarCover___tYu0C { background-image: url("https://s.chao-fan.com/tuxun/images/user/blue_team.png") !important; }
`;
var styleScore = document.createElement('style');
styleScore.type = 'text/css';
styleScore.innerHTML = `
.hudHealthBarBox___BPbp6 { display: none !important; }
.hudHealthBarInner___atsdx span { display: none !important; }
.roundScore___OWkm_ { display: none !important; }
.mapResult___uG4SH { margin-bottom: 3.5rem; }
`;
var styleHideMap = document.createElement('style');
styleHideMap.type = 'text/css';
styleHideMap.innerHTML = `
.css-i874aq.ant-divider-horizontal { display: none !important; }
.mapResult___uG4SH { display: none !important; }
`;
const button = document.createElement('div');
button.style.cssText = 'height: 40px; width: 40px; background-color: #000c; border-radius: 50%; align-items: center; justify-content: center; display: flex; cursor: pointer; position: fixed; top: 30%; right: 24px; color: white; font-size: 20px; text-align: center; z-index: 999; user-select: none;';
button.innerHTML = '☰';
document.body.appendChild(button);
const toggleContainer = document.createElement('div');
toggleContainer.style.cssText = 'position: fixed; background: #000b; color: white; padding: 10px; right: 24px; border-radius: 8px; display: none; z-index: 999; user-select: none;';
toggleContainer.innerHTML = `
`;
document.body.appendChild(toggleContainer);
button.addEventListener('click', () => {
const rect = button.getBoundingClientRect();
toggleContainer.style.top = `${rect.bottom + 10}px`;
toggleContainer.style.display = toggleContainer.style.display === 'none' ? 'block' : 'none';
});
document.addEventListener('click', (event) => {
if (!button.contains(event.target) && !toggleContainer.contains(event.target)) {
toggleContainer.style.display = 'none';
}
});
function applyStyles() {
const currentUrl = window.location.href;
if (currentUrl.includes("tuxun.fun/challenge") || currentUrl.includes("tuxun.fun/party1") || currentUrl.includes("tuxun.fun/replay")) {
removeStyles();
} else {
if (localStorage.getItem('hideOpponent') === 'true') {
document.head.appendChild(styleOpponent);
}
if (localStorage.getItem('hideScore') === 'true') {
document.head.appendChild(styleScore);
if (localStorage.getItem('hideMap') === 'true') {
document.head.appendChild(styleHideMap);
}
}
}
}
function removeStyles() {
if (document.head.contains(styleOpponent)) {
document.head.removeChild(styleOpponent);
}
if (document.head.contains(styleScore)) {
document.head.removeChild(styleScore);
}
if (document.head.contains(styleHideMap)) {
document.head.removeChild(styleHideMap);
}
}
document.getElementById('hideOpponent').addEventListener('change', function() {
const isChecked = this.checked;
localStorage.setItem('hideOpponent', isChecked);
if (isChecked) {
document.head.appendChild(styleOpponent);
} else {
document.head.removeChild(styleOpponent);
}
});
document.getElementById('hideScore').addEventListener('change', function() {
const isChecked = this.checked;
localStorage.setItem('hideScore', isChecked);
if (isChecked) {
document.head.appendChild(styleScore);
if (localStorage.getItem('hideMap') === 'true') {
document.head.appendChild(styleHideMap);
}
} else {
document.head.removeChild(styleScore);
document.head.removeChild(styleHideMap);
}
});
document.getElementById('hideMap').addEventListener('change', function() {
const isChecked = this.checked;
localStorage.setItem('hideMap', isChecked);
if (localStorage.getItem('hideScore') === 'true' && isChecked) {
document.head.appendChild(styleHideMap);
} else {
document.head.removeChild(styleHideMap);
}
});
setInterval(applyStyles, 1000);
applyStyles();
})();