2025-05-27 23:39:10 +02:00
|
|
|
// PlayerHidder.js
|
2025-05-27 23:12:40 +02:00
|
|
|
|
2025-12-16 09:11:33 +01: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)';
|
|
|
|
|
|
2025-12-16 09:11:33 +01:00
|
|
|
// Hide the div that contains the player icons
|
2025-05-28 00:19:50 +02:00
|
|
|
function hideDiv() {
|
2025-12-16 09:11:33 +01:00
|
|
|
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
|
|
|
|
2025-12-16 09:11:33 +01:00
|
|
|
// Show the div that contains the player icons
|
2025-05-28 00:19:50 +02:00
|
|
|
function showDiv() {
|
2025-12-16 09:11:33 +01:00
|
|
|
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
|
|
|
|
2025-12-16 09:11:33 +01:00
|
|
|
// Hide the div on load
|
2025-05-28 00:19:50 +02:00
|
|
|
hideDiv();
|
2025-05-27 23:12:40 +02:00
|
|
|
|
2025-12-16 09:11:33 +01:00
|
|
|
// Expose helpers globally
|
|
|
|
|
window['open_sesame'] = showDiv;
|
|
|
|
|
window['close_sesame'] = hideDiv;
|