Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<body></body>
<script>
  
  var cnv = document.createElement('canvas')
  cnv.style.border = '1px solid red'
  document.body.appendChild(cnv)
  cnv.width = 480
  cnv.height = 320
  var ctx = cnv.getContext('2d');
  var img = new Image()
  img.src = 'https://i.ibb.co/wphVwkF/ruleta.png'
  img.onload = function(){
    ctx.translate(cnv.width/2, cnv.height/2)
    setInterval(function(){
      ctx.rotate(Math.PI/180 * 5)
      ctx.drawImage(img, -img.width/2, -img.height/2)
    }, 50)
  }
</script>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers