-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
303 lines (273 loc) · 10.3 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
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Boiler - The frontend framework</title>
<script src="https://unpkg.com/@reactivex/rxjs/dist/global/Rx.min.js" type="text/javascript"></script>
<script src="https://unpkg.com/[email protected]/build/two.min.js" type="text/javascript"></script>
<link href="https://fonts.googleapis.com/css?family=Playfair+Display|Poppins" rel="stylesheet">
<link rel="icon" type="image/png" href="favicon.png">
<style type="text/css">
html, body {
margin: 0;
width: 100%;
height: 100%;
background: #485563; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #485563, #29323c); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #485563, #29323c); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.flex-center {
position: relative;
z-index: 9999999;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.flex-center > div {
background: #fff;
border-radius: 10px;
box-shadow: 0 0 25px 35px rgba(0,0,0,.07);
padding: 25px;
min-width: 350px;
text-align: center;
}
h1, h2, h3, h4 {
margin: 0;
color: #485563;
font-family: 'Playfair Display', Helvetica, sans-serif;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
h2, p {
margin-bottom: 25px;
padding-bottom: 25px;
border-bottom: 1px solid #eee;
}
p {
font-family: 'Poppins', Helvetica, sans-serif;
max-width: 300px;
font-size: 14px;
color: #999;
margin: 0 auto;
display: block;
line-height: 26px;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
p span {
color: #000;
font-weight: bold;
}
a#button {
display: inline-block;
margin-top: 25px;
font-size: 14px;
color: #fff;
text-transform: uppercase;
font-family: 'Poppins', Helvetica, sans-serif;
text-decoration: none;
padding: 12px 25px;
border-radius: 25px;
position: relative;
transition: all .5s cubic-bezier(0.165, 0.84, 0.44, 1);
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
a#button:hover {
background: #000 !important;
}
a#button svg {
position: relative;
top: 3px;
left: -5px;
margin-right: 5px;
}
</style>
</head>
<body>
<div class="flex-center">
<div>
<h1>Boiler</h1>
<h2>The frontend framework</h2>
<p>Want to jump into a new project with <span>swag</span>, <span>vue</span>, <span>emojis</span> and <span>awesome stuff</span>? Then this framework is what yo' need 😎🤟</p>
<a href="https://github.com/ro0t/Boiler" id="button">
<svg width="18px" height="18px" viewBox="0 0 33 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="GitHub-Mark" transform="translate(-136.000000, -331.000000)" fill="#FFFFFE">
<path d="M152.608,331.455 C143.614,331.455 136.32,338.748 136.32,347.745 C136.32,354.942 140.987,361.047 147.46,363.201 C148.275,363.351 148.572,362.848 148.572,362.416 C148.572,362.029 148.558,361.005 148.55,359.646 C144.019,360.63 143.063,357.462 143.063,357.462 C142.322,355.58 141.254,355.079 141.254,355.079 C139.775,354.069 141.366,354.089 141.366,354.089 C143.001,354.204 143.861,355.768 143.861,355.768 C145.314,358.257 147.674,357.538 148.602,357.121 C148.75,356.069 149.171,355.351 149.636,354.944 C146.019,354.533 142.216,353.135 142.216,346.893 C142.216,345.115 142.851,343.66 143.893,342.522 C143.725,342.11 143.166,340.453 144.053,338.211 C144.053,338.211 145.42,337.773 148.532,339.881 C149.831,339.519 151.225,339.339 152.61,339.332 C153.994,339.339 155.387,339.519 156.688,339.881 C159.798,337.773 161.163,338.211 161.163,338.211 C162.052,340.453 161.493,342.11 161.326,342.522 C162.37,343.66 163,345.115 163,346.893 C163,353.151 159.191,354.528 155.563,354.931 C156.147,355.434 156.668,356.428 156.668,357.947 C156.668,360.125 156.648,361.882 156.648,362.416 C156.648,362.852 156.942,363.359 157.768,363.2 C164.236,361.041 168.899,354.94 168.899,347.745 C168.899,338.748 161.605,331.455 152.608,331.455" id="Fill-51"></path>
</g>
</g>
</svg>
Open in Github
</a>
</div>
</div>
<script type="text/javascript">
// Thanks to https://codepen.io/lisilinhart/pen/PjJyRv for making this awesome background tang
"use strict";
var mouse = new Two.Vector();
var _document$documentEle = document.documentElement,
clientWidth = _document$documentEle.clientWidth,
clientHeight = _document$documentEle.clientHeight;
var diagonal = Math.sqrt(Math.pow(-clientWidth, 2) + Math.pow(-clientHeight, 2));
var container = void 0;
var offsetX = 0;
var offsetY = 0;
var colors = ["rgb(0, 191, 168)", "rgb(153, 102, 255)", "rgb(255, 100, 100)", "rgb(0, 200, 255)"];
var animationFrame$ = Rx.Observable.interval(0, Rx.Scheduler.animationFrame);
var mouse$ = Rx.Observable.fromEvent(document, "mousemove").map(function (_ref) {
var clientX = _ref.clientX,
clientY = _ref.clientY;
return {
x: clientX,
y: clientY
};
});
var resize = Rx.Observable.fromEvent(window, 'resize').debounceTime(500).subscribe(function (e) {
var _document$documentEle2 = document.documentElement,
clientWidth = _document$documentEle2.clientWidth,
clientHeight = _document$documentEle2.clientHeight;
var count = 0;
var rows = 4;
var cols = 4;
for (var i = 0; i < rows; i += 1) {
var even = !!(i % 2);
var vi = i / (rows - 1);
for (var j = 0; j < cols; j++) {
var k = j;
if (even) {
k += 0.5;
if (j >= cols - 1) {
continue;
}
}
var hi = k / (cols - 1);
if (count < container.children.length) {
var child = container.children[count];
child.origin.x = hi * clientWidth;
child.origin.y = vi * clientHeight;
child.translation.set(child.origin.x, child.origin.y);
count += 1;
}
}
}
});
function lerp(start, end) {
var dx = end.x - start.x;
var dy = end.y - start.y;
return {
x: start.x + dx * 0.1,
y: start.y + dy * 0.1
};
}
var smoothMouse$ = animationFrame$.withLatestFrom(mouse$, function (_, m) {
return m;
}).scan(lerp);
Two.prototype.makeNonagon = function (width, height, sides) {
width /= 2;
height /= 2;
var shape = this.makePath(_.map(_.range(sides), function (i) {
var pct = i / sides;
var theta = Math.PI * 2 * pct - Math.PI / 2;
var x = width * Math.cos(theta);
var y = height * Math.sin(theta);
return new Two.Anchor(x, y);
}));
return shape;
};
var toggleFill = function toggleFill(el) {
if (typeof el !== "undefined") {
el._renderer.elem.addEventListener("click", function () {
if (el.fill === "transparent") {
el.fill = el.stroke;
} else {
el.fill = "transparent";
}
});
}
};
document.addEventListener("DOMContentLoaded", function () {
var two = new Two({
type: Two.Types.svg,
fullscreen: true,
autostart: true
}).appendTo(document.body);
container = two.makeGroup();
container.parent.parent.domElement.classList += 'container';
// create elements
var rows = 4;
var cols = 4;
var sides = Math.floor(Math.random() * 3) + 3;
var color = colors[Math.floor(Math.random() * colors.length)];
// whenever a color has been selected, color the button
(document.getElementById('button')).style.backgroundColor = color;
for (var i = 0; i < rows; i += 1) {
var even = !!(i % 2);
var vi = i / (rows - 1);
for (var j = 0; j < cols; j++) {
var k = j;
if (even) {
k += 0.5;
if (j >= cols - 1) {
continue;
}
}
var hi = k / (cols - 1);
var size = (Math.floor(Math.random() * 50) + 10) / 100;
var width = Math.round(two.height * size / Math.max(rows, cols));
var shape = two.makeNonagon(width, width, sides);
shape.rotation = Math.floor(Math.random() * 4) * Math.PI / 2 + Math.PI / 4;
shape.origin = new Two.Vector(hi * two.width, vi * two.height);
shape.translation.set(shape.origin.x, shape.origin.y);
shape.stroke = color;
shape.linewidth = 4;
shape.fill = color;
if (Math.round(Math.random())) {
shape.noFill();
}
shape.step = Math.floor(Math.random() * 4) / 20 * (Math.PI / 60);
shape.step *= Math.random() > 0.5 ? -1 : 1;
container.add(shape);
}
}
two.update();
container.children.map(function (child) {
toggleFill(child);
});
two.bind("update", function () {
container.children.map(function (child) {
var delta = new Two.Vector(child.origin.x, child.origin.y);
var dist = delta.distanceTo(mouse) / diagonal;
var d = (1 - dist) / 30;
delta.lerp(mouse, d);
child.translation.copy(delta);
child.rotation += child.step;
});
});
smoothMouse$.subscribe(function (e) {
mouse.x = e.x;
mouse.y = e.y;
});
});
</script>
</body>
</html>