Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Wave</title>
  6. <link rel="stylesheet" href="../css/style.css">
  7. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  8. <script type="text/paperscript" canvas="canvas">
  9. //////////////////////////////////////////////////////////////////////
  10. // Values
  11. tool.minDistance = 10;
  12. var values = {
  13. curviness: 0.5,
  14. distance: tool.minDistance,
  15. offset: 10,
  16. mouseOffset: true
  17. };
  18. //////////////////////////////////////////////////////////////////////
  19. // Mouse handling
  20. var path;
  21. function onMouseDown(event) {
  22. path = new Path({
  23. strokeColor: '#000000'
  24. });
  25. }
  26. var mul = 1;
  27. function onMouseDrag(event) {
  28. var step = event.delta.rotate(90 * mul);
  29. if (!values.mouseOffset)
  30. step.length = values.offset;
  31. path.add({
  32. point: event.point + step,
  33. handleIn: -event.delta * values.curviness,
  34. handleOut: event.delta * values.curviness
  35. });
  36. mul *= -1;
  37. }
  38. </script>
  39. </head>
  40. <body>
  41. <canvas id="canvas" resize></canvas>
  42. </body>
  43. </html>