-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathsvg.html
More file actions
27 lines (27 loc) · 695 Bytes
/
svg.html
File metadata and controls
27 lines (27 loc) · 695 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../index.js"></script>
<script>
var render = uhtml.render;
var html = uhtml.html;
this.onload = function () {
var content =
'<svg viewBox=${} style=${}>\
<rect x="0" y="0" width=${} height=${} fill="#f00" />\
</svg>'.split('${}');
const viewBoxText = '0 0 100 100';
render(document.body, html(
content,
'0 0 100 100',
'width: 1000px; height: 1000px;',
50, 50
));
if (document.querySelector('svg').clientWidth != 1000)
alert('SVG ERROR');
};
</script>
</head>
</html>