forked from kombai/freewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
155 lines (143 loc) · 2.64 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
<!DOCTYPE html>
<html>
<head>
<title>Page not found</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<script type="text/javascript" src="example/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="freewall.js"></script>
<style type="text/css">
body {
height: 100%;
overflow: hidden;
}
.layout {
width: 620px;
margin: auto;
}
.cell {
width: 320px;
}
</style>
</head>
<body>
<div class="layout">
<h1> Page not found </h1>
<h3>Sorry the page you requested may have been moved or deleted.</h3>
<div id="freewall" class="free-wall"></div>
</div>
<script type="text/javascript">
var temp = "<div class='cell' style='width:{width}px; height: {height}px; background-color: {color}'><div class='cover'></div></div>";
var colour = [
"#DAA520",
"#CD950C",
"#EEB422",
"#CD9B1D"
];
var w = 1, h = 1, html = '', color = '', limitItem = 244;
for (var i = 0; i < limitItem; ++i) {
h = 1 + 3 * Math.random() << 0;
w = 1 + 3 * Math.random() << 0;
color = colour[colour.length * Math.random() << 0];
html += temp.replace(/\{height\}/g, h*15).replace(/\{width\}/g, w*15).replace("{color}", color);
}
$("#freewall").html(html);
var wall = new freewall("#freewall");
wall.reset({
selector: '.cell',
animate: true,
delay: 20,
cellW: 15.5,
cellH: 15,
gutterX: 2,
gutterY: 2,
onBlockActive: function(block, setting) {
// check for showing brick;
if (block != null) {
$(this).css({
top: 3000,
left: block.left
});
} else {
$(this).css({
opacity: 0
});
}
},
onComplete: function(item, setting) {
console.log(wall);
console.log(setting);
}
});
wall.setHoles([
// 4
{
top: 6,
left: 6,
width: 2,
height: 8
},
{
top: 14,
left: 6,
width: 8,
height: 2
},
{
top: 12,
left: 10,
width: 2,
height: 6
}
]);
// 0
wall.appendHoles([
{
top: 6,
left: 16,
width: 8,
height: 2
},
{
top: 8,
left: 16,
width: 2,
height: 8
},
{
top: 8,
left: 22,
width: 2,
height: 8
},
{
top: 16,
left: 16,
width: 8,
height: 2
}
]);
// 4
wall.appendHoles([
{
top: 6,
left: 26,
width: 2,
height: 8
},
{
top: 14,
left: 26,
width: 8,
height: 2
},
{
top: 12,
left: 30,
width: 2,
height: 6
}
]);
wall.fitWidth();
</script>
</body>
</html>