Skip to content

Instantly share code, notes, and snippets.

@technikhil314
Last active June 19, 2021 12:13
Show Gist options
  • Save technikhil314/94ba3ae5d6faed008699ad136b7d8615 to your computer and use it in GitHub Desktop.
Save technikhil314/94ba3ae5d6faed008699ad136b7d8615 to your computer and use it in GitHub Desktop.
Single line web url to simple paint app

Copy paste following line in your favorite browsers url bar and hit enter.

data:text/html,<canvas id=v><script>d=document,P='onpointer',c=v.getContext('2d'),v.width=innerWidth,v.height=innerHeight,f=0,d[P+'down']=e=>{f=e.pointerId+1;e.preventDefault();c.beginPath();c.moveTo(e.x,e.y)};d[P+'move']=e=>{f==e.pointerId+1&&c.lineTo(e.x,e.y);c.stroke()},c.lineWidth=3,d[P+'up']=_=>f=0</script></canvas>

This is a public gist of following secret gist

Original gist by minko gechev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment