-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
88 lines (80 loc) · 1.88 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
html {
overflow: hidden;
touch-action: none;
content-zooming: none;
}
body {
margin: 0;
padding: 0;
background: #000;
position: absolute;
width: 100%;
height: 100%;
}
#screen {
position: absolute;
width: 100%;
height: 100%;
}
#screen .img {
position: absolute;
cursor: pointer;
width: 100%;
height: 100%;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#screen .frame {
position: absolute;
width: 50%;
height: 50%;
}
#images {
display: none;
}
</style>
<body>
<div id="screen"></div>
<div id="images">
<img src="http://www.dhteumeuleu.com/images/frame.jpg">
<img src="http://www.dhteumeuleu.com/images/frame0.jpg">
</div>
<script type="text/javascript">
window.addEventListener('load', function() {
var src = document.getElementById("images").getElementsByTagName("img"),
img = function img(el, x, y) {
var d = document.createElement("div");
d.className = "frame";
d.style.left = 50 * x + "%";
d.style.top = 50 * y + "%";
var img = document.createElement("img");
img.className = "img";
img.src = src[Math.floor(Math.random() * src.length)].src;
img.onmousedown = function() {
div(this.parentNode);
this.parentNode.removeChild(this);
}
d.appendChild(img);
el.appendChild(d);
},
div = function div(el) {
img(el, 0, 0);
img(el, 1, 0);
img(el, 0, 1);
img(el, 1, 1);
};
div(document.getElementById("screen"));
window.ondragstart = function() { return false; }
}, false);
</script>
</body>
</html>