mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-15 01:18:26 -05:00
32 lines
765 B
HTML
32 lines
765 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
|
|
<title>RoughJS Line</title>
|
|
</head>
|
|
|
|
<body>
|
|
<canvas width="800" height="800"></canvas>
|
|
|
|
<script type="module">
|
|
import rough from '../../../bin/rough.js';
|
|
const canvas = document.querySelector('canvas');
|
|
const rc = rough.canvas(canvas, {
|
|
options: {
|
|
strokeLineDash: [15, 5],
|
|
strokeLineDashOffset: 10
|
|
}
|
|
});
|
|
|
|
rc.line(10, 10, 100, 10);
|
|
rc.line(10, 210, 500, 210);
|
|
rc.line(10, 20, 10, 110, { stroke: 'red' });
|
|
rc.line(10, 10, 100, 10);
|
|
rc.line(50, 30, 200, 100, { stroke: 'blue', strokeWidth: 5 });
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |