Skip to content

Commit e9e97d5

Browse files
committed
wire.js
1 parent 2178171 commit e9e97d5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

wire.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
li=document.getElementsByTagName("*")
2+
a=Array(li.length)
3+
for(i=0;i<li.length;i++)
4+
{
5+
a[i]=li[i].getBoundingClientRect();
6+
}
7+
var b=document.getElementsByTagName("body")[0];
8+
var w=b.getBoundingClientRect()['width'];
9+
var h=b.getBoundingClientRect()['height'];
10+
b.innerHTML="";
11+
b.appendChild(document.createElement('canvas')).id='can';
12+
var c=document.getElementById("can");
13+
var ctx=c.getContext("2d");
14+
c.width=w;
15+
c.height=h;
16+
for(i=0;i<a.length;i++)
17+
{
18+
if(a[i]['width']>0 && a[i]['height']>0)
19+
ctx.rect(a[i]['left'],a[i]['top'],a[i]['width'],a[i]['height']);
20+
}
21+
ctx.setLineWidth=1;
22+
ctx.stroke();

0 commit comments

Comments
 (0)