77 lines
No EOL
2 KiB
HTML
77 lines
No EOL
2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Terminal</title>
|
|
|
|
<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%;
|
|
}
|
|
|
|
input {
|
|
background-color: black;
|
|
border:none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<textarea id="output" readonly style=" border-bottom:2px white solid;">Rockterm
Type 'help' for help</textarea>
|
|
<form id="form">
|
|
<label> $</label>
|
|
<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");
|
|
const command = ft.value.toLowerCase();
|
|
|
|
ft.value = "";
|
|
ta.value += "\n> " + command;
|
|
|
|
if (command != "help") {
|
|
window.parent.postMessage(command)
|
|
} else {
|
|
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> |