70 lines
1.7 KiB
HTML
70 lines
1.7 KiB
HTML
|
<!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>
|