UNPKG

sketch

Version:

Sketch canvas drawing component

24 lines 830 B
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Sketch</title> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width"> </head> <body> <style>body { background: #eee }</style> <link rel="stylesheet" href="build/build.css" /> <canvas width=1000 height=600 style='border: 1px solid #eee; background: white'></canvas> <script src="build/build.js"></script> <script> document.body.addEventListener('touchmove', function(e){ e.preventDefault(); }); var autoscale = require('autoscale-canvas'); var canvas = document.querySelector('canvas'); var sketch = require('sketch'); sketch(canvas); autoscale(canvas); </script> </body> </html>