-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (76 loc) · 1.81 KB
/
index.html
File metadata and controls
86 lines (76 loc) · 1.81 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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=1">
<title>Hello, World! Ask me anything @keanychu</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style>
* {
font-family: "Open Sans";
margin: 0;
padding: 0;
}
body {
animation-duration: 1s;
}
h1 {
font-size: 50px;
color: #fff;
cursor: default;
}
.app {
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
text-align: center;
}
a {
text-decoration: none;
color: #fff;
font-size: 22px;
}
</style>
</head>
<body>
<div class="app">
<h1></h1>
<p><a href="https://github.com/keanyc/keanyc.github.io/issues/new"></a></p>
</div>
<script>
function refreshData() {
var $body = document.querySelector('body');
var color;
var d = new Date();
var h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds();
if (h <= 9) h = '0' + h;
if (m <= 9) m = '0' + m;
if (s <= 9) s = '0' + s;
color = '#' + h + m + s;
$body.style.backgroundColor = color;
}
function rand(start, end) {
return Math.floor(Math.random() * end) + start;
}
var i = 0;
function typeIn(el, v, start, end) {
var $el = document.querySelector(el);
$el.innerHTML = $el.innerHTML + v[i++];
if (!start) start = 50;
if (!end) end = 100;
if (i < v.length)
setTimeout(function(){ typeIn(el, v); }, rand(start, end));
else
i = 0;
}
refreshData();
setInterval(refreshData, 1000);
setTimeout(function(){ typeIn('h1', 'Hello, World!'); }, 1000);
setTimeout(function(){ typeIn('a', 'Ask me anything', 10, 50); }, 4000);
</script>
</body>
</html>