-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html~
164 lines (142 loc) · 3.2 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
<html>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="bootstrap-responsive.min.css">
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<style type="text/css">
body
{
overflow:hidden;
}
#menu-bar
{
height:10%;
margin:0;
padding:0;
width:100%;
}
#terminal
{
font-family:Inconsolata;
font-size:15px;
padding:10px;
background:black;
height:80%;
}
#clipboard
{
position:absolute;
left:-20%;
width:0%;
height:0%;
}
.prompt, #before, #after
{
float:left;
left:0px;
color:#22FF08;
position:relative;
}
#prompt_blink
{
float:left;
left:0px;
position:relative;
width:8px;
height:18px;
}
.line
{
color:#22FF08;width:100%;height:18px;padding:0;margin:0;
}
.line1
{
width:100%;height:18px;padding:0;margin:0;
}
.vis
{background:#22FF08 ;color:black;}
.invi
{background:black;color:#22FF08;}
</style>
<script type="text/javascript">
//////////////////////// Keywords ////////////////////////
var keywords = {'ls':'',};
//////////////////////// Keywords ////////////////////////
</script>
<script type="text/javascript">
//////////////////////// Terminal Aesthetics! ////////////////////////
var cmd, content, position;
var prompt = $('#prompt_blink');
var before = $('#before');
var after = $('#after');
var t;
function blink()
{
$('#prompt_blink').toggleClass('vis').toggleClass('invi');
t = setTimeout("blink()",700);
}
function build_command(content,position)
{
$('#before').html(content.substr(0,position));
$('#after').html(content.substr(position+1,content.length-1));
$('#prompt_blink').html(content.charAt(position));
}
function next_line()
{
var old_line = "<div class='line'><span class='prompt'>karts-$ </span><span>" + $('#clipboard').val(); + "</span></div>";
$('#clipboard').val('');
$('div.line1').before(old_line);
}
$(document).ready(function() {
$('#clipboard').focus();
$('#terminal').click(function() {
$('#clipboard').focus();
blink();
});
$('#clipboard').keydown(function() {
content = $(this).val();
clearTimeout(t);
var position = $('#clipboard').prop("selectionStart");
if(position<=content.length-1)
build_command(content,position);
else
{
$('#before').html(content);
$('#prompt_blink').html('');
$('#after').html('');
}
if(event.which==13)
next_line();
});
$('#clipboard').keyup(function() {
content = $(this).val();
blink();
var position = $('#clipboard').prop("selectionStart");
if(position<=content.length-1)
build_command(content,position);
else
{
$('#before').html(content);
$('#prompt_blink').html('');
$('#after').html('');
}
if($('#prompt_blink').html()=='')
$('#prompt_blink').css('width','8px');
else
$('#prompt_blink').css('width','auto');
});
});
//////////////////////// Terminal Aesthetics! ////////////////////////
</script>
</head>
<body>
<div id="menu-bar" class="span12"></div>
<div class="row">
<div id="terminal" class="offset1 span12">
<div class="line1"><span class="prompt">karts-$ </span><span id="before"></span><span id="prompt_blink" class="vis"></span><span id="after"></span></div>
</div>
</div>
<textarea id="clipboard"></textarea>
</body>
</html>