Create Not-2
Browse files
Not-2
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Echo Print Results</title>
|
| 7 |
+
<!-- Include jQuery and jQuery.Terminal -->
|
| 8 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css">
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/jquery"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal/js/jquery.terminal.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
body {
|
| 13 |
+
margin: 0;
|
| 14 |
+
background: black;
|
| 15 |
+
color: green;
|
| 16 |
+
}
|
| 17 |
+
#terminal {
|
| 18 |
+
height: 100vh;
|
| 19 |
+
}
|
| 20 |
+
</style>
|
| 21 |
+
</head>
|
| 22 |
+
<body>
|
| 23 |
+
<div id="terminal"></div>
|
| 24 |
+
|
| 25 |
+
<script>
|
| 26 |
+
$(function () {
|
| 27 |
+
const terminal = $('#terminal').terminal({
|
| 28 |
+
// Echo Command: Basic Example
|
| 29 |
+
echo: function (...args) {
|
| 30 |
+
this.echo(`[[;cyan;]${args.join(' ')}]`);
|
| 31 |
+
},
|
| 32 |
+
|
| 33 |
+
// Example: Printing Results in a Clear Format
|
| 34 |
+
print_results: function (title, results) {
|
| 35 |
+
this.echo(`[[;yellow;]${title}]`);
|
| 36 |
+
results.forEach((result, index) => {
|
| 37 |
+
this.echo(`[[;green;]- Result ${index + 1}: ${result}]`);
|
| 38 |
+
});
|
| 39 |
+
this.echo('[[;cyan;]End of results.]');
|
| 40 |
+
},
|
| 41 |
+
|
| 42 |
+
// Example: Simulated Operation with Output
|
| 43 |
+
simulate: function (operation) {
|
| 44 |
+
this.echo(`[[;yellow;]Simulating ${operation}...]`);
|
| 45 |
+
this.pause();
|
| 46 |
+
setTimeout(() => {
|
| 47 |
+
const results = ['Step 1 completed', 'Step 2 completed', 'Operation successful'];
|
| 48 |
+
this.print_results(`${operation} Simulation Results`, results);
|
| 49 |
+
this.resume();
|
| 50 |
+
}, 2000);
|
| 51 |
+
},
|
| 52 |
+
|
| 53 |
+
// Help Command
|
| 54 |
+
help: function () {
|
| 55 |
+
this.echo(`
|
| 56 |
+
[[;yellow;]Available Commands:]
|
| 57 |
+
- echo <text> : Echoes back the input text
|
| 58 |
+
- print_results : Displays a formatted list of results
|
| 59 |
+
- simulate <action> : Simulates an action and prints results
|
| 60 |
+
- help : Displays this help menu
|
| 61 |
+
`);
|
| 62 |
+
}
|
| 63 |
+
}, {
|
| 64 |
+
greetings: '[[;yellow;]Welcome to the Echo Terminal]',
|
| 65 |
+
name: 'echo_terminal',
|
| 66 |
+
prompt: '>> '
|
| 67 |
+
});
|
| 68 |
+
});
|
| 69 |
+
</script>
|
| 70 |
+
</body>
|
| 71 |
+
</html>
|