-
Notifications
You must be signed in to change notification settings - Fork 69
/
index.html
39 lines (39 loc) · 960 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!doctype html>
<html>
<head>
<title>svg.resize.js</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<script type="module" src="src/main.js"></script>
<script type="module">
import { SVG } from '@svgdotjs/svg.js'
const canvas = new SVG().size(1000, 700).addTo('body')
canvas
.rect(100, 100)
.move(100, 100)
.fill('red')
.select({ createHandle: (el) => el.polyline().css({ stroke: '#666' }) })
canvas
// star shape
.polygon([
[100, 100],
[200, 100],
[200, 200],
[300, 200],
[200, 300],
[200, 400],
[100, 400],
[100, 300],
[0, 300],
[0, 200],
[100, 200],
])
.move(250, 250)
.fill('blue')
.pointSelect()
.select()
</script>
</body>
</html>