-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (65 loc) · 2.09 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./lib/jsvg.css">
</link>
</head>
<body style="background-color: #222;">
<div id="app">
<div id="nav"></div>
<div id="main">
<div id="btn1"></div>
<div id="btn2"></div>
<div id="drawing"></div>
</div>
<div id="footer"></div>
</div>
<script src="./cdn_modules/opentype.min.js"></script>
<script src="./cdn_modules/svg.js@3.2.3/svg.js"></script>
<script src="./lib/jsvg.js"></script>
<script src="./lib/loader.js"></script>
<script src="./lib/class.js"></script>
<script src="./lib/groups.js"></script>
<script src="./app.js"></script>
<script>
window.addEventListener("load", async (event) => {
// drawLayout()
const iconList = ['activity', 'airplay', 'anchor']
const iconUrls = iconList.map((icon) => `imports/feathericons/${icon}.svg`)
fetchURLs(iconUrls)
.then(data => {
//console.log('Fetched data:', data)
for (i = 0; i < data.length; i++) {
elements[iconList[i]] = data[i]
}
return Promise.resolve(true)
})
.then((item) => {
drawLayout()
})
.catch(error => {
console.error('Error fetching data:', error)
});
//const b = jsvg.button({ width: 'auto' })
// alert(b)
var draw = SVG().addTo('#drawing')
var group = draw.group()
//group.path('M10,20L30,40')
var ellipse = group.ellipse(200, 100)
var line = draw.line(0, 0, 100, 150).stroke({ width: 1, color: '#fff' })
group.add(ellipse)
group.add(line)
line.center(100, 50)
const lr = line.clone()
lr.flip('x')
group.add(lr)
var svgString = draw.flatten().svg()
console.log(svgString)
draw.rounded(20, 20).fill(SVG.Color.random())
})
</script>
</body>
</html>