Log Scroller
/* Basic styling for readability */
body { font-family: monospace; white-space: pre-wrap; margin: 1em; }
pre { margin: 0; }
Loading OtisLog.txt...
const logFileName = 'OtisLog.txt'; // The name of your log file
const scrollAmount = 150; // How many pixels to scroll down each time
const scrollInterval = 3000; // How often to scroll in milliseconds (3000 = 3 seconds)
// Fetch the log file content
fetch(logFileName)
.then(response => response.text()) // Get the text from the file
.then(data => {
// Put the log text into the <pre> tag
document.getElementById('log-output').textContent = data;
// Start scrolling AFTER the content is loaded
setInterval(() => {
window.scrollBy(0, scrollAmount);
}, scrollInterval);
})
.catch(error => {
// If the file isn't found or there's an error, show simple message
document.getElementById('log-output').textContent = `Error: Could not load ${logFileName}. Make sure it's in the same folder as this HTML file.`;
console.error("Log loading error:", error); // Log details to console just in case
});
Enter fullscreen mode
Exit fullscreen mode