This repository was archived by the owner on Jun 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
185 lines (157 loc) · 4.09 KB
/
index.html
File metadata and controls
185 lines (157 loc) · 4.09 KB
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
175
176
177
178
179
180
181
182
183
184
185
<style>
@font-face {
font-family: freedos;
src: url(freedos_16.woff);
}
#text_mode td {
width: 8px;
height: 19px;
}
#text_mode table {
table-layout: fixed;
border-collapse: collapse;
font-family: freedos;
font-size: 16px;
}
#console-input {
margin-top: -475px;
background: transparent;
color: transparent;
border: 0px;
cursor: default;
}
.blinking-cursor {
font-weight: 100;
font-size: 14px;
color: #fff;
position: absolute;
margin-left: -7px;
margin-top: 2px;
-webkit-animation: 1s blink step-end infinite;
-moz-animation: 1s blink step-end infinite;
-ms-animation: 1s blink step-end infinite;
-o-animation: 1s blink step-end infinite;
animation: 1s blink step-end infinite;
}
@keyframes "blink" {
from,
to {
color: white;
}
50% {
color: transparent;
}
}
@-moz-keyframes blink {
from,
to {
color: white;
}
50% {
color: transparent;
}
}
@-webkit-keyframes "blink" {
from,
to {
color: white;
}
50% {
color: transparent;
}
}
@-ms-keyframes "blink" {
from,
to {
color: white;
}
50% {
color: transparent;
}
}
@-o-keyframes "blink" {
from,
to {
color: white;
}
50% {
color: transparent;
}
}
</style>
<button onclick="bconsole.clear();$(input).focus();">Clear Console</button>
<button onclick="bconsole.moveCaretUp();$(input).focus();">↑</button>
<button onclick="bconsole.moveCaretDown();$(input).focus();">↓</button>
<button onclick="bconsole.moveCaretBack();$(input).focus();">←</button>
<button onclick="bconsole.moveCaretFore();$(input).focus();">→</button>
<button onclick="bconsole.moveCaretToHome();$(input).focus();">Home</button>
<button onclick="bconsole.moveCaretToEnd();$(input).focus();">End</button>
<button onclick="bconsole.insertLineBreak();$(input).focus();">↲ Enter</button>
<button onclick="bconsole.backSpace();$(input).focus();">⌫ del</button>
<button onclick="bconsole.moveCaretToStartOfChar();$(input).focus();">moveCaretToStartOfChar</button>
<button onclick="bconsole.moveCaretToEndOfChar();$(input).focus();">moveCaretToEndOfChar</button>
<div id="frame" class="bsc-frame" style="float: left; margin: 5px;" tabIndex="0">
<div id="screen-wrapper" class="bsc-wrapper">
<div id="text_mode" class="bsc-lores"></div>
</div>
</div>
<script src="jquery.min.js"></script>
<script src="bconsole.js"></script>
<script>
var lore = document.getElementById('text_mode');
var bconsole = new BASIC_console(lore, 80);
bconsole.init();
bconsole.write('BASIC console');
bconsole.insertLineBreak();
bconsole.write('Written by: Nauman Umer');
bconsole.insertLineBreak();
bconsole.insertLineBreak();
bconsole.write('abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ');
bconsole.insertLineBreak();
bconsole.write('1234567890.:,;\'"(!?)+-*/=');
bconsole.insertLineBreak();
bconsole.write('The quick brown fox jumps over a lazy dog. 1234567890');
bconsole.insertLineBreak();
bconsole.write('Start typing here: ');
bconsole.showCaret();
$("#console-input").keyup(function( e ) {
if(bconsole.isCaretShown){
if (e.keyCode == 13) { //enter
bconsole.insertLineBreak();
$(this).val('');
return false;
}
else if (e.keyCode == 8){ //backspace
bconsole.backSpace();
return false;
}
else if (e.keyCode == 37){ //back
bconsole.moveCaretBack();
return false;
}
else if (e.keyCode == 39){ //Fore
bconsole.moveCaretFore();
return false;
}
else if (e.keyCode == 38){ //Up
bconsole.moveCaretUp();
return false;
}
else if (e.keyCode == 40){ //down
bconsole.moveCaretDown();
return false;
}
else if (e.keyCode == 36){ //Home
bconsole.moveCaretToHome();
return false;
}
else if (e.keyCode == 35){ //End
bconsole.moveCaretToEnd();
return false;
}
var text = $(this).val();
bconsole.write(text);
$(this).val('');
}
});
</script>