blob: 88de813e47356c5a0a5e5e7910c8fca5e0ad41fe (
plain)
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<style>
#back {
width: 1000px;
height: 600px;
background-color: green;
}
#front {
width: 800px;
height: 400px;
background-color: red;
border: 50px solid blue;
padding: 50px;
}
</style>
<script>
var sizeX = 121, sizeY = 93, spaceX = 15, spaceY = 9, width = 800, height = 400;
var urls = Array(), size = Array(), position = Array(), repeat = Array(),
origin = Array(), clip = Array();
function addMasks() {
for (var x = 0; x < width; x += sizeX + spaceX) {
for (var y = 0; y < height; y += sizeY + spaceY) {
urls.push("url(resources/circle-alpha.svg)");
size.push(sizeX + "px " + sizeY + "px");
position.push(x + "px " + y + "px");
}
}
div = document.getElementById("front");
div.style.cssText += "-webkit-mask-image: " + urls.join(", ") + ";" +
"-webkit-mask-size: " + size.join(", ") + ";" +
"-webkit-mask-position: " + position.join(", ") + ";" +
"-webkit-mask-repeat: no-repeat;" +
"-webkit-mask-origin: content-box;" +
"-webkit-mask-clip: content-box;";
}
</script>
</head>
<body onload="addMasks()">
<div id="back">
<div id="front" />
</div>
</body>
</html>
|