Files
BluemapSimpleHidder/PlayerHidder.js

28 lines
831 B
JavaScript
Raw Normal View History

2025-05-27 23:39:10 +02:00
// PlayerHidder.js
2025-05-27 23:12:40 +02:00
// CSS selector that targets the div containing player icons
2025-05-28 00:19:50 +02:00
const selector = '#map-container > div > div:nth-child(2)';
// Hide the div that contains the player icons
2025-05-28 00:19:50 +02:00
function hideDiv() {
const targetDiv = document.querySelector(selector); // Grab the div via the CSS selector
if (targetDiv) { // Ensure the element exists
targetDiv.style.display = 'none'; // Hide it
2025-05-27 23:12:40 +02:00
}
2025-05-28 00:19:50 +02:00
}
2025-05-27 23:12:40 +02:00
// Show the div that contains the player icons
2025-05-28 00:19:50 +02:00
function showDiv() {
const targetDiv = document.querySelector(selector); // Grab the div via the CSS selector
if (targetDiv) { // Ensure the element exists
targetDiv.style.display = ''; // Reset display to show it
2025-05-27 23:12:40 +02:00
}
2025-05-28 00:19:50 +02:00
}
2025-05-27 23:12:40 +02:00
// Hide the div on load
2025-05-28 00:19:50 +02:00
hideDiv();
2025-05-27 23:12:40 +02:00
// Expose helpers globally
window['open_sesame'] = showDiv;
window['close_sesame'] = hideDiv;