-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
74 lines (45 loc) · 1.93 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*--- Linux CLI | START ---*/
import {Termino} from 'https://cdn.jsdelivr.net/gh/MarketingPipeline/[email protected]/dist/termino.min.js';
function focusTermInput(){
document.querySelector(".termino-input").focus();
}
document.querySelector(".termino-input").focus();
/// Handle clicks on page
document.querySelector("#terminal").addEventListener("click", (event) => {
focusTermInput()
});
let YOUR_CUSTOM_SETTINGS = {
allow_scroll: false, // disable scroll up & down on terminal
prompt: "$", // custom prompt
command_key: 13, // custom command key
terminal_killed_placeholder: "CUSTOM DISABLED PLACEHOLDER", // custom terminal input placeholder when kill.
terminal_output: ".termino-console", // custom output query selector
terminal_input: ".termino-input", // custom input query selector
disable_terminal_input: false // disable any user commands / inputs. --- Useful for making terminal animations etc!
}
let term= Termino(document.getElementById("terminal"), null, YOUR_CUSTOM_SETTINGS)
term.echo("Hello world from https://github.com/MarketingPipeline")
term.echo("This was made by Jared Van Valkengoed.")
/// To handle older IOS devices - await needs to be inside async - fun tip!
!async function () {
// Fake loading for fun
term.echo("Loading.. ")
// delay for 2 seconds
await term.delay(2000)
term.echo(`Loaded!`)
}();
async function runBasicInput(){
// await input
let input = await term.input("")
// display a input for fun!
if(input){
term.output(`<div style="margin-bottom:20px">'${input}' is not recognized as an internal or external command,
operable program or batch file.</div>`)
}
}
runBasicInput()
/*--- Linux CLI | END ---*/
/*--- WORK | START ---*/
/* Crane Animation - START */
/* Crane Animation - END */
/*--- WORK | END ---*/