-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
174 lines (144 loc) · 3.7 KB
/
index.html
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>CMD - Composable command line application library</title>
<link rel="icon" href="/cmd-favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css'>
<style>
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body,html{
margin: 0;
padding: 0;
width: 100%;
}
pre{
padding: 0;
}
body{
background-color: #fff;
font:400 15px/21px 'Source Sans Pro', 'Helvetica Neue', Arial;
}
.main-header{
background-color: #34495e;
color: #fff;
padding:40px;
}
.main-header pre{
margin :0;
font:300 13px/20px 'Courier New', 'Helvetica Neue', Helvetica, Arial;
}
.main-header pre a{
color: #fff;
text-decoration: none;
}
.main-header pre a:hover {
text-decoration: underline;
}
.main-header pre strong{
font-weight: 600;
}
.main-header-nav{
float:right;
}
.main-header-nav a {
display: inline-block;
color: #fff;
text-decoration: none;
padding: 0 0 0 20px;
}
.main-header-nav a:hover {
text-decoration: underline;
}
.main-content{
padding: 40px;
}
.shell{
color: yellow;
font-weight: 700;
}
.shell-input{
background: none;
border:none;
color:#fff;
outline:none;
font:300 13px/20px 'Courier New', 'Helvetica Neue', Helvetica, Arial;
width: 100%;
}
</style>
<link rel="stylesheet" href="/jquery.terminal.css">
</head>
<body>
<div class="main-header">
<pre><span class="shell">></span> menu -h
<strong>cmd</strong> - Composable command line application library
<strong>Usage:</strong>
<page>
<strong>Pages:</strong>
<a href="/">home</a> home page
<a href="/docs">docs</a> usage and api documention
<a href="https://github.com/cmd-js/cmd">github</a> open the Github repo
<strong>Options:</strong>
-n, --new-window open the page in a new window
<span class="shell">> <input class="shell-input" autofocus></span>
</pre>
</div>
<div class="main-content">
Future home of <strong>CMD.</strong>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/jquery.mousewheel.min.js"></script>
<script src="/jquery.terminal-0.8.8.min.js"></script>
<script>
$('body').keydown(function () {
$('.shell-input').focus()
$('document').animate({
scrollTop: $(".shell-input").offset().top
}, 180);
});
$('.shell-input').keydown(function (e) {
if (e.keyCode === 13) {
var inputs = (e.target.value || '').split(' ')
var val = inputs[0];
var flags = inputs[1];
var url = '/';
switch (val) {
case 'home': {
url = '/';
break;
}
case 'docs': {
url = '/docs';
break;
}
case 'github': {
url = 'https://github.com/cmd-js/cmd';
break;
}
default: {
alert("That's not a command or page my friend.");
url = null
}
}
if (url) {
if (flags === '-n' || flags === '--new-window') {
var win = window.open(url, '_blank');
win.focus();
}
else {
window.location = url;
}
}
setTimeout(function () {
$('.shell-input').val('');
}, 100);
}
});
</script>
</body>
</html>