56 lines
1.3 KiB
HTML
56 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<base href="/">
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Terminal Emulator</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
font-family: monospace;
|
|
background-color: #000;
|
|
color: #0f0;
|
|
}
|
|
|
|
#terminal {
|
|
width: 100%;
|
|
height: 90vh;
|
|
background-color: #000;
|
|
overflow-y: auto;
|
|
padding: 10px;
|
|
border: 2px solid #333;
|
|
}
|
|
|
|
.line {
|
|
margin: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="terminal"></div>
|
|
<script>
|
|
const terminal = document.getElementById('terminal');
|
|
|
|
// Function to add a line to the terminal
|
|
function addLine(text) {
|
|
const line = document.createElement('p');
|
|
line.className = 'line';
|
|
line.textContent = text;
|
|
terminal.appendChild(line);
|
|
|
|
// Automatically scroll to the bottom
|
|
terminal.scrollTop = terminal.scrollHeight;
|
|
}
|
|
|
|
// Simulate adding lines
|
|
let lineCount = 0;
|
|
setInterval(() => {
|
|
addLine(`Line ${++lineCount}: This is a test log.`);
|
|
}, 500); // Add a new line every 500ms
|
|
</script>
|
|
</body>
|
|
|
|
</html> |