i-eat.rocks/apps/terminal.html

77 lines
2 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Terminal</title>
2024-08-16 05:45:22 +00:00
<link rel="stylesheet" href="standard.css">
<style>
* {
background-color: black;
padding:0;
margin:0;
border:none;
color:white;
}
textarea {
width: calc(100% - 8px);
resize: none;
height: calc(100% - 30px);
padding:4px;
overflow-wrap: anywhere;
}
*:focus, *:active {
outline: none;
}
#formtext {
width: calc(100% - 30px - 95px);
}
label {
width:30px;
}
html, body {
height: 100%;
}
2024-08-16 05:45:22 +00:00
input {
background-color: black;
border:none;
}
</style>
</head>
<body>
<textarea id="output" readonly style=" border-bottom:2px white solid;">Rockterm&NewLine;Type 'help' for help</textarea>
<form id="form">
<label>&thinsp;$</label>
2024-08-16 05:45:22 +00:00
<input id="formtext" type="text" autocomplete="off" style="border: none;">
<input id="submit" type="submit" title="submit" value="submit">
</form>
<script>
const ta = document.getElementById("output");
document.getElementById("form").addEventListener("submit", event => {
event.preventDefault();
const ft = document.getElementById("formtext");
2024-08-16 20:45:56 +00:00
const command = ft.value.toLowerCase();
ft.value = "";
ta.value += "\n> " + command;
if (command != "help") {
2024-08-18 03:17:43 +00:00
window.parent.postMessage(command)
} else {
2024-08-16 05:45:22 +00:00
ta.value += "\nwin (url) (title) (width) (height) - create a window";
ta.value += "\nwg - open windowgen";
ta.value += "\nurl (url) - go to url"
}
})
</script>
</body>
</html>