Removed old code
This commit is contained in:
@@ -49,12 +49,6 @@
|
|||||||
travelRoot.querySelector('[class^="airspaceScene"]').remove();
|
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");
|
||||||
var timerContainer = null;
|
var timerContainer = null;
|
||||||
/* if (ogTimer) {
|
|
||||||
ogTimer.style.cssText = 'font-weight: bold; font-size: 1.5rem;';
|
|
||||||
ogTimer.innerText = 'Calculating landing time...';
|
|
||||||
timerContainer = ogTimer;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
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; font-weight: bold; font-size: 1.5rem;';
|
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; font-weight: bold; font-size: 1.5rem;';
|
||||||
//timerElement.parentNode.insertBefore(timeDisplay, timerElement.nextSibling);
|
//timerElement.parentNode.insertBefore(timeDisplay, timerElement.nextSibling);
|
||||||
@@ -62,12 +56,6 @@
|
|||||||
timeDisplay.innerText = 'Calculating landing time...';
|
timeDisplay.innerText = 'Calculating landing time...';
|
||||||
timerContainer = timeDisplay;
|
timerContainer = timeDisplay;
|
||||||
|
|
||||||
//const info = document.querySelector("#travel-root > div.viewport___cdEK9.stage0 > div.factWrapper___LvERA > div");
|
|
||||||
//info.remove();
|
|
||||||
|
|
||||||
// Insert our box right below Torn's native countdown timer
|
|
||||||
//
|
|
||||||
|
|
||||||
// Update the landing time prediction every single second
|
// Update the landing time prediction every single second
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const timeString = timerElement.innerText; // Grabs 'HH:MM:SS' from the page
|
const timeString = timerElement.innerText; // Grabs 'HH:MM:SS' from the page
|
||||||
@@ -83,7 +71,6 @@
|
|||||||
const msRemaining = ((hours * 60 * 60) + (minutes * 60) + seconds) * 1000;
|
const msRemaining = ((hours * 60 * 60) + (minutes * 60) + seconds) * 1000;
|
||||||
// Blink the text if time left is < 2 minutes.
|
// Blink the text if time left is < 2 minutes.
|
||||||
if (msRemaining <= 120000) {
|
if (msRemaining <= 120000) {
|
||||||
//ogTimer.style.cssText += ' color: #aa0000;'
|
|
||||||
// Add the blinking class to the text.
|
// Add the blinking class to the text.
|
||||||
timerContainer.classList.add('pulse-text');
|
timerContainer.classList.add('pulse-text');
|
||||||
|
|
||||||
@@ -92,10 +79,6 @@
|
|||||||
// Add the flight duration to the current system date/time
|
// Add the flight duration to the current system date/time
|
||||||
const landingTime = new Date(Date.now() + msRemaining);
|
const landingTime = new Date(Date.now() + msRemaining);
|
||||||
|
|
||||||
// Remove OG timer
|
|
||||||
|
|
||||||
//ogTimer.remove();
|
|
||||||
|
|
||||||
// Format the output neatly (e.g., "16:24:05")
|
// Format the output neatly (e.g., "16:24:05")
|
||||||
timerContainer.innerText = `Estimated Landing: ${landingTime.toLocaleTimeString()}`;
|
timerContainer.innerText = `Estimated Landing: ${landingTime.toLocaleTimeString()}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user