Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. (function(){var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d'); var v = document.querySelector('#player'); canvas.style.cssText = "z-index:999999999;position:absolute;pointer-events:none"; canvas.width = 200; canvas.height=200; document.body.appendChild(canvas); requestAnimationFrame(function _(t) { var r = document.body.getBoundingClientRect(), s = v.getBoundingClientRect();; canvas.style.left = r.left+"px"; canvas.style.top = r.top+"px"; canvas.width = r.width; canvas.height = r.height; ctx.fillStyle = "rgba(0,0,0,0.9)"; ctx.fillRect(0,0,r.width,r.height); ctx.clearRect(s.left,s.top,s.width,s.height); ctx.save(); ctx.translate(r.width/2,r.height/2); ctx.rotate(t/1000*2*Math.PI/8); ctx.beginPath(); for (var i = 0; i < 40; ++i) { ctx.lineTo(0,r.height*i/80); ctx.rotate(Math.PI/2); } ctx.lineWidth = 2; ctx.strokeStyle = "red"; ctx.stroke(); ctx.restore(); requestAnimationFrame(_); }); })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement