-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
267 lines (218 loc) · 6.8 KB
/
404.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Cảnh Nguyễn | Thiết kế đồ họa | 404</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<style>
@import url(https://fonts.googleapis.com/css?family=Inconsolata:400,700);
html {
background: #fff;
overflow-y: scroll;
}
body {
font: .875em/1.6 'Inconsolata', monospace;
color: #181818;
font-weight: 400;
max-width: 28em;
padding: 1em;
margin: 5% 0;
}
::selection{
background: #eee
}
::-webkit-selection{
background: #eee
}
::-moz-selection{
background: #eee
}
a{
color: #181818;
}
a:hover,a:focus{
background: #181818;
color:#fff;
}
h2{
font-size: 1em;
font-weight: 400;
}
p{
margin-bottom:2em;
}
abbr{
cursor: help;
}
ul{
list-style: none;
padding: 0;
}
li{
margin:1em 0 0;
}
span{
display: block;
color:#999;
line-height:1;
}
kbd{
font-family: 'Inconsolata', monospace;
border:1px solid #999;
text-transform: uppercase;
padding:0 .2em;
}
input[type="text"]{
max-width: 10em;
border: none;
font-family: inherit;
background: #fff;
padding:0 .5em;
}
input[type="text"]:focus{
background: #fff;
color: #000;
outline:none;
}
.command{
display: none;
max-width: 20em;
color: #181818;
font-weight: 700;
margin: 2em 0;
}
section{
display: none;
}
.open{
display: block;
}
</style>
<body>
<main>
<section id="home">
<h2>CLI - Command Line Interface Simulation</h2>
<p>A fun experiment for displaying simple info in a geeky manner.</p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="about">
<h2><span>»About</span></h2>
<p>This is an experiment built by <a href="https://www.heisca.com/" target="_blank">Canh Nguyen</a> for showcasing a user profile or cv in an unusual but original way by simulating a command line interface. It's nothing more than the usual hidden elements triggered by some JS to show/hide each section of content, based on input values.</p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="info">
<h2><span>»info</span></h2>
<p>This is me, <b> Canh Nguyen</b></p>
<img src="https://www.heisca.com/images/about.jpg" width=200>
<p>As a young man with high determination, I always know what should I do to reach my goals, then find the ways to get it as fast as I can. Although I am not a big person, I believe I can do big things with my own hands.</p>
<p>An old man told me nothing impossible, it just depends on the way we approach it. I hundred percent agree with that saying because of the endless of human's abilities.</p>
<p><span>See my Portfolio now at <a href="https://www.heisca.com/work.html">here</a></span></p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="hello">
<h2><span>»hello</span></h2>
<p>Hi Guy!, <br><br> Check out my new design <a href="https://www.heisca.com/work.html">here</a> <br> Or leave me some messages at <a href="https://www.heisca.com/contact.html">here</a> <br><br> Thanks!</p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="download">
<h2><span>»Download</span></h2>
<p>Download my Resume: <a href="https://www.heisca.com/images/CanhNguyen-CV-Update.pdf">https://www.heisca.com/images/CanhNguyen-CV-Update.pdf</a></br>
Or drop your message <a href="https://www.heisca.com/contact.html">Here</a></p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="error">
<p>Command not found!<p>
<p><span>Type 'help' + <kbd>Enter</kbd> -- for available commands.</span></p>
</section>
<section id="help">
<h2><span>»Help?</span></h2>
<p><span>Type [command] + <kbd>Enter</kbd></span></p>
<ul>
<li>'home' -- Thats obvious!</li>
<li>'about' -- What's this for</li>
<li>'info' -- About H Ξ I S C A</li>
<li>'download' -- Download my CV + Contact</li>
<li>'help' -- displays this list</li>
<li>'hello' -- Just Greeting!</li>
</ul>
</section>
<span class="command">H Ξ I S C A:/$<input type="text"></span>
</main>
</body>
<script>
document.addEventListener("DOMContentLoad", typeWriter, false);
var typeWriter = function (selector, type, interval) {
var el = document.querySelectorAll(selector), // Getting elements in the DOM
i = 0,
len = el.length, // Length of element on the page
list = [], // List of elements on the page in the DOM
a,
all,
text,
start,
end,
nextText,
sectionId = selector.replace(/^#/, ''),
targetSection = document.getElementById(sectionId),
sections = document.getElementsByTagName("section")[0],
targetSiblings = [].slice.call(sections.parentNode.children).filter(function(v) { return v !== targetSection }),
cmd = document.querySelector(".command"),
clear;
for (; i < len; i++) {
list.push(el[i]); // Pushing the element in the list array
}
for (a in list) {
all = list[a]; // List of all element
text = all.innerHTML; // InnerHTML of the elements
start = 0; // Start index of the text in the elements
end = 0; // End index of the text in the elements
//Setting the default interval to 100 when interval is not set by the user
if (typeof interval === "undefined") {
interval = 100;
}
if (arguments[1] === "true") {
setTimeout(function() {
targetSection.classList.add("open");
}, 200);
for(var i = 0;i < targetSiblings.length;i++) {
targetSiblings[i].classList.remove("open");
}
clear = setInterval(function () { // Animation start
var newText = text.substr(start, end);
all.innerHTML = newText;
end = end + 1; //loops through the text in the element
if (newText === text) {
clearInterval(clear); // Animation end
cmd.classList.add("open");
input.focus();
}
}, interval);
}
return all;
}
}
var input = document.querySelector("input"),
block = document.getElementsByTagName("section");
window.onload = function() {
typeWriter("#home","true",10);
var sectionArray = [];
for(var i = 0;i < block.length;i++) {
sectionArray.push(block[i].id);
}
//console.log(sectionArray);
input.addEventListener('keyup', function(e) {
if((e.keyCode || e.which) == 13) {// ENTER key pressed
var targetValue = input.value;
var destination = "#" + targetValue;
typeWriter(destination,"true",10);
input.value = "";
if(sectionArray.includes(targetValue) == false) {
typeWriter("#error","true",10);
}
}
});
};
</script>
</html>