Testing support for TornPDA

This commit is contained in:
2026-07-05 22:53:49 -04:00
parent fdd96af865
commit c35abd5159
+12 -3
View File
@@ -40,16 +40,25 @@
function initClockExtension(timerElement) { function initClockExtension(timerElement) {
// Create a custom UI box to display our text safely without breaking Torn's CSS // Create a custom UI box to display our text safely without breaking Torn's CSS
const travelRoot = document.querySelector("#travel-root");
// Remove travel fact
travelRoot.querySelector('[class^="factWrapper"]').remove();
// Remove flight scene
travelRoot.querySelector('[class^="airspaceScene"]').remove();
const ogTimer = document.querySelector("#travel-root > div.viewport___cdEK9 > div.flightProgressSection___OEJoR > div.progressText___BEQ0k > div > span"); const ogTimer = document.querySelector("#travel-root > div.viewport___cdEK9 > div.flightProgressSection___OEJoR > div.progressText___BEQ0k > div > span");
ogTimer.style.cssText = 'font-weight: bold;'; if (ogTimer) {
ogTimer.style.cssText = 'font-weight: bold; font-size: 1.5rem;';
ogTimer.innerText = 'Calculating landing time...';
} else {
const timeDisplay = document.createElement('div'); const timeDisplay = document.createElement('div');
timeDisplay.style.cssText = 'padding: 10px; margin-top: 10px; color: #fff; text-align: center; border-radius: 5px; font-weight: bold; border: 1px solid #444; transition: color 0.5s ease;'; timeDisplay.style.cssText = 'padding: 10px; margin-top: 10px; color: #fff; text-align: center; border-radius: 5px; font-weight: bold; border: 1px solid #444; transition: color 0.5s ease;';
ogTimer.innerText = 'Calculating landing time...'; timerElement.parentNode.insertBefore(timeDisplay, timerElement.nextSibling);
}
//const info = document.querySelector("#travel-root > div.viewport___cdEK9.stage0 > div.factWrapper___LvERA > div"); //const info = document.querySelector("#travel-root > div.viewport___cdEK9.stage0 > div.factWrapper___LvERA > div");
//info.remove(); //info.remove();
// Insert our box right below Torn's native countdown timer // Insert our box right below Torn's native countdown timer
//timerElement.parentNode.insertBefore(timeDisplay, timerElement.nextSibling); //
// Update the landing time prediction every single second // Update the landing time prediction every single second
setInterval(() => { setInterval(() => {