-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSVG.html
59 lines (48 loc) · 1.53 KB
/
SVG.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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8' />
<title>SVG Editor</title>
<link rel='stylesheet' href='svg-styles.css' />
</head>
<script src="JS/SVGMain.js"></script>
<script src="JS/SVGGeneration.js"></script>
<script>
window.onload = function () {
document.getElementById("render-button").addEventListener("click", function () {
setValues();
renderSVG();
});
document.getElementById("download-svg").addEventListener("click", function () {
setValues();
generateContentOfFile();
// Generate download of hello.txt file with some content
downloadSVG(fullFilename, completeSVG);
});
}
</script>
<style>
</style>
<h1>SVG editor</h1>
Main SVG code:<br><br>
<div id="top-div">
<div id="main-input-div">
<textarea type="text" id="main-input"></textarea>
</div>
<br>
<div id="svg-display-div">
<svg id="svg-display" width="100%" height="100%"></svg>
</div>
</div>
<div id="size-name-entry">
<br><br><br>
Set canvas width:
<input type="number" id="width-input" value="1000" autocomplete="off"></input>
Canvas height:
<input type="number" id="height-input" value="1000" autocomplete="off"></input>
File name:
<input type="text" id="filename-input" placeholder="Enter here before download" size="28" autocomplete="off"></input>.svg
<button id="render-button">Click to render</button>
<button id="download-svg">Download rendered file</button>
</div>
</html>