-
-
Save SpaceShot/e418846da3065d77dfa8 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ <span id="support">No multi-touch support</span><br> <canvas id="drawSurface" width="500px" height="500px" style="border:1px solid black;"></canvas> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ window.addEventListener('load', function() { var canvas = document.getElementById("drawSurface"), context = canvas.getContext("2d"); if (window.navigator.pointerEnabled) { canvas.addEventListener("pointermove", paint, false); if(window.navigator.maxTouchPoints>1) document.querySelector("#support").innerText = "Your hardware supports multi-touch!"; } else { //Provide fallback for user agents that do not support Pointer Events canvas.addEventListener("mousemove", paint, false); } function paint(event) { if(event.buttons>0) context.fillRect(event.clientX, event.clientY, 5, 5); } }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ html { touch-action: none; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ ucnhv ----- A [Pen](http://codepen.io/anon/pen/ucnhv) by [Captain Anonymous](http://codepen.io/anon) on [CodePen](http://codepen.io/). [License](http://codepen.io/anon/pen/ucnhv/license).