Skip to content

Instantly share code, notes, and snippets.

@kidd
Created September 21, 2023 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidd/70a7812cf6f37711622a84142bd73907 to your computer and use it in GitHub Desktop.
Save kidd/70a7812cf6f37711622a84142bd73907 to your computer and use it in GitHub Desktop.
whiteboard bookmarklet
data:text/html,<canvas id="v"><script>d=document,d.body.style.margin=0,f=0,c=v.getContext("2d"),v.width=innerWidth,v.height=innerHeight,c.lineWidth=2,x=e=>e.clientX||e.touches[0].clientX,y=e=>e.clientY||e.touches[0].clientY,d.onmousedown=d.ontouchstart=e=>{f=1,e.preventDefault(),c.moveTo(x(e),y(e)),c.beginPath()},d.onmousemove=d.ontouchmove=e=>{f&&(c.lineTo(x(e),y(e)),c.stroke())},d.onmouseup=d.ontouchend=e=>f=0</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment