-
Notifications
You must be signed in to change notification settings - Fork 0
/
out.js
74 lines (73 loc) · 1.69 KB
/
out.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
(() => {
// adventure.js
adventureCommands = {
quit,
q: quit
};
async function adventure() {
this.push(adventureCommands, {
name: "adventure",
prompt: "adventure@nephh.io ",
onStart: function() {
this.clear();
this.echo("Welcome adventurer!");
}
});
}
function quit() {
this.pop();
}
// script.js
commands = {
help: function() {
this.echo("enter any of the following commands");
},
about: function() {
this.echo("this is about");
},
test: function() {
this.echo('[[;{"style": "--color: red"};]Hello World]');
},
story: async function() {
await this.echo(story, { typing: true, delay: 50 });
},
adventure,
cat: function() {
this.echo('<img src="http://cataas.com/cat"/>', { raw: true });
},
catgif: function() {
this.echo(`<img src="http://cataas.com/cat/gif"/>`, { raw: true });
}
};
var term = $("#terminal").terminal(commands, {
prompt: function() {
return `[[;#98fb98;]guest@nephh.io /$ ]`;
},
greetings: ascii,
onInit: async function(terminal) {
await terminal.echo(
`welcome to my site, enter [[;;;glow]help] to see some options`,
{ typing: true, delay: 50 }
);
},
keymap: {
"CTRL+R": function(e, original) {
return;
}
},
onClear: function(terminal) {
terminal.echo(welcome());
terminal.echo(help());
},
onBlur: function(terminal) {
return false;
}
});
async function welcome() {
return ascii;
}
async function help() {
return `welcome to my site, enter help to see some options`;
}
var script_default = commands;
})();