-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
156 lines (156 loc) · 4.91 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
<!DOCTYPE html>
<html>
<head>
<title>picocoo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href='//fonts.useso.com/css?family=Ubuntu+Mono:400|Ubuntu:400|Roboto+Condensed:700' rel='stylesheet' type='text/css'>
<style>
html, body {
overflow: hidden;
margin: 0;
}
body {
font-family: 'Open Sans', Arial, sans-serif;
color: #333;
}
#wrapper {
position: absolute;
left: 0;
width: 320px;
text-align: center;
top: 50%;
left: 50%;
margin-left: -160px;
margin-top: -160px;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
h1 {
position: relative;
font-family: 'Ubuntu Mono', Arial, sans-serif;
font-weight: 400;
font-size: 40px;
letter-spacing: 16px;
text-transform: uppercase;
margin: 0 0 0 16px;
}
h2 {
position: relative;
color: #555;
font-family: 'Ubuntu', Arial, sans-serif;
font-weight: 400;
font-size: 18px;
letter-spacing: 1px;
margin: 50px 0 50px 1px;
}
h2:before {
content: "";
position: absolute;
right: 100%;
top: 0;
bottom: 0;
width: 2000px;
height: 0;
margin-top: auto;
margin-bottom: auto;
margin-right: -68px;
border-top: 2px solid #f44336;
}
h2:after {
content: "";
position: absolute;
left: 100%;
top: 0;
bottom: 0;
width: 2000px;
height: 0;
margin-top: auto;
margin-bottom: auto;
margin-left: -68px;
border-top: 2px solid #f44336;
}
p {
font-family: 'Roboto Condensed', Arial, sans-serif;
font-weight: 700;
font-size: 18px;
line-height: 2em;
margin: 0;
letter-spacing: 2px;
}
canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
}
a {
color: #666;
text-decoration: none;
transition: color .2s ease;
}
a:hover {
color: #06c;
}
</style>
</head>
<body>
<div id="wrapper">
<h1>picocoo</h1>
<h2>Gateway to Infinity</h2>
<p><a href="https://github.com/picococoo" target="_blank">Github</a></p>
<p><a href="http://meizilaiyifa.sinaapp.com" target="_blank">妹子来一发</a></p>
</div>
<canvas></canvas>
<script>
document.addEventListener('touchmove', function (e) {
e.preventDefault()
})
var c = document.getElementsByTagName('canvas')[0],
x = c.getContext('2d'),
pr = window.devicePixelRatio || 1,
w = window.innerWidth,
h = window.innerHeight,
g = 1/10,
q,
m = Math,
r = 0,
u = m.PI*2,
v = m.cos,
z = m.random
c.width = w*pr
c.height = h*pr
x.scale(pr, pr)
x.globalAlpha = 0.5
function i(){
x.clearRect(0,0,w,h)
q=[{x:0,y:h*z()},{x:0,y:h*z()}]
while(q[1].x<w) d(q[0], q[1])
}
function d(i,j){
x.beginPath()
x.moveTo(i.x, i.y)
x.lineTo(j.x, j.y)
var k = j.x + g*w,
n = y(j.y)
x.lineTo(k, n)
x.closePath()
r-=u/-50
x.fillStyle = '#'+(v(r)*127+128<<16 | v(r+u/3)*127+128<<8 | v(r+u/3*2)*127+128).toString(16)
x.fill()
q[0] = q[1]
q[1] = {x:k,y:n}
}
function y(p){
var t = p + (z()*2-1.5)*h
return (t>h||t<0) ? y(p) : t
}
document.onclick = i
i()
</script>
</body>
</html>