-
Notifications
You must be signed in to change notification settings - Fork 827
/
index.html
69 lines (62 loc) · 1.66 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>canvas-nest.js</title>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
}
#github-iframe {
position: fixed;
left: 32px;
top: 32px;
}
#area-render {
position: fixed;
width: 320px;
height: 160px;
right: 4px;
bottom: 4px;
border: dashed 1px #ccc;
}
</style>
</head>
<body>
<div id="github-iframe"></div>
<div id="area-render"></div>
<script type="text/javascript" color="255,0,0" pointColor="255,0,0" opacity='0.7' zIndex="-2" count="100" src="dist/canvas-nest.js"></script>
<script type="text/javascript" src="dist/canvas-nest.umd.js"></script>
<script type="text/javascript">
var cn = new CanvasNest(document.getElementById('area-render'), {
color: '255,0,255',
count: 50,
});
// 下面为其他 js,无需关注
function asyncLoad() {
//async load github
var i = document.createElement("iframe");
i.src = "https://ghbtns.com/github-btn.html?user=hustcc&repo=canvas-nest.js&type=star&count=true";
i.scrolling = "no";
i.frameborder = "0";
i.border = "0";
i.setAttribute("frameborder", "0", 0);
i.width = "100px";
i.height = "20px";
document.getElementById("github-iframe").appendChild(i);
}
function loadGitHubBtn() {
if (window.addEventListener) {window.addEventListener("load", asyncLoad, false);}
else if (window.attachEvent) {window.attachEvent("onload", asyncLoad);}
else {window.onload = asyncLoad;}
}
loadGitHubBtn();
</script>
</body>
</html>