UNPKG

@wise-community/drawing-tool

Version:
54 lines (53 loc) 1.68 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>HTML5 Drawing Tool Demo</title> <style type="text/css"> body { font-family: Arial; } #drawing-tool-1, #drawing-tool-2 { display: inline-block; } </style> </head> <body> <div class="container"> <h1>HTML5 Drawing Tool</h1> <div id="drawing-tool-1"></div> <div id="drawing-tool-2"></div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.5.0/fabric.js"></script> <link type="text/css" rel="stylesheet" href="../drawing-tool.css" /> <script src="../drawing-tool.js"></script> <script> var drawingTool = new DrawingTool("#drawing-tool-1", { width: 500, height: 600, stamps: { 'Molecules': [ 'https://interactions-resources.concord.org/stamps/simple-atom.svg', 'https://interactions-resources.concord.org/stamps/diatomic.svg', 'https://interactions-resources.concord.org/stamps/triatomic.svg' ] } }); var drawingTool2 = new DrawingTool("#drawing-tool-2", { width: 500, height: 600, proxy: function (url) { return 'https://cors-anywhere.herokuapp.com/' + url; }, stamps: { 'Molecules': [ 'https://interactions-resources.concord.org/stamps/simple-atom.svg', 'https://interactions-resources.concord.org/stamps/diatomic.svg', 'https://interactions-resources.concord.org/stamps/triatomic.svg' ] } }); </script> </body> </html>