-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
123 lines (111 loc) · 6.14 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"><!--<![endif]--><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!--<link rel="stylesheet" href="css/normalize.css">-->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<link rel="stylesheet" href="css/index.css">
<script src="http//www.google-analytics.com/ga.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->
<div class="container" role=main>
<header class="row-offset">
<h1>Victor</h1>
<h2>Convert your SVG files to lightweight, Raphael-compatible JSON</h2>
</header>
<div class="row row-offset">
<div class="span2 offset5 pagination-centered">
<input type="file" accept="image/*" id="file-input" />
<input type="button" id="file-button" class="btn btn-large btn-primary" value="Select File"/>
</div>
</div>
<div class="row row-offset pagination-centered">
<p class="span4">Raw SVG</p>
<p class="span4">JSON</p>
<p class="span4">Output</p>
</div>
<div class="row">
<div class="span4 square" id="canvas-input">
<p id="tiger">Give the <input type="button" class="btn btn-small" id="tiger-button" value="Tiger"/> a try</p>
</div>
<textarea class="span4 square" id="json-output" resizable=false></textarea>
<div id="canvas-output" class="span4 square">
</div>
</div>
<div class="row row-offset">
<div class="span5">
<h3>Limitations</h3>
<p>Raphael supports only a subset of SVG features <small>(for the sake of VML compatibility)</small>. Here's a list of the most notable limitations:</p>
<ul class="small-list">
<li>
no <code><g></code> elements (see <a href="http://raphaeljs.com/reference.html#Paper.set">Paper.set()</a> alternative),
</li>
<li>
no <code><switch></code> elements,
</li>
<li>
no <code>filter</code> elements (blur, shadow, etc.),
</li>
<li>
limited support of <code>stroke-dasharray</code> (see <a href="http://raphaeljs.com/reference.html#Element.attr">Element.attr()</a>),
</li>
<li>
no support of <code>marker-*</code> (see <code>arrow-end</code> in <a href="http://raphaeljs.com/reference.html#Element.attr">Element.attr()</a>),
</li>
<li>
specific syntax for gradients, limited to simple gradients for <code><path></code> elements
(see Gradients in <a href="http://raphaeljs.com/reference.html#Element.attr">Element.attr()</a>).
</li>
</ul>
<p>In addition, Victor doesn't yet fully support the following Raphael features:</p>
<ul class="small-list">
<li>conversion of <code><g></code> elements (planned),</li>
<li>conversion of <code>transform</code>s (planned),</li>
<li>approximative conversion of gradients (planned),</li>
<li>approximative conversion of <code>marker-end</code> (planned),</li>
<li><code>clip-rect</code>, <code>stroke-dasharray</code>, <code>stroke-linejoin</code>, <code>stroke-linecap</code>, <code>stroke-miterlimit</code> (trivial).</li>
</ul>
</div>
<div class="span5 offset2">
<h3>Preparing svg files</h3>
<p>Some tweaks can be applied to svg files to improve compatibility with the web. Here's what <a href="http://inkscape.org/download/">Inkscape</a> <small>(free-OSS editor)</small> allows:</p>
<ul class="small-list">
<li>ungroup all groups of elements,</li>
<li>apply transforms to paths by selecting them all, grouping them and ungrouping them,</li>
<li>convert other transformed elements (rectangles, ellipses, circles, text) to paths,</li>
<li>convert text elements winth non-standard font-family to paths,</li>
<li>replace gradients with plain colors,</li>
<li>remove filters.</li>
</ul>
<p>A screencast should be posted to help unexperienced users.</p>
</div>
</div>
<iframe id="svg-frame" class="invisible" frameborder=0></iframe>
</div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.6.1/lodash.min.js"></script>
<script src="script/victor.js"></script>
<script>window.Victor = Raphael.ninja();</script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<!--<script src="script/raphael.js"></script>-->
<script src="script/svgtojs.js"></script>
<script src="script/index.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body></html>