Skip to content

Instantly share code, notes, and snippets.

@finscn
Created February 20, 2013 15:26
Show Gist options
  • Save finscn/4996310 to your computer and use it in GitHub Desktop.
Save finscn/4996310 to your computer and use it in GitHub Desktop.
function mazed(dom) {
if (!dom){
dom=document.createElement("div");
var css=[
'font-family:courier;\
font-size:20px;\
letter-spacing:-5px;\
line-height: 14px;\
padding: 4px;\
position:absolute;top:0px;left:0px;z-index:9999;\
border:1px solid black;background:white;\
-webkit-transform:matrix(2,0,0,1,180,50);'
]
dom.style.cssText=css.join("");
document.body.appendChild(dom)
}
var m=[],line="";
for(var i = 0; i < 1600; i++) {
if(i&&!(i % 40)) {
m.push(line)
line=""
}
line += Math.random() < 0.5 ? "/" : "\\";
}
var html=m.join("<br>");
dom.innerHTML=html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment