mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Create an example page for ImportSVG
This commit is contained in:
parent
64f34e6dfd
commit
0b8e940798
1 changed files with 32 additions and 0 deletions
32
examples/Scripts/ImportSVG.html
Normal file
32
examples/Scripts/ImportSVG.html
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<title>Stroke Bounds</title>
|
||||||
|
<link rel="stylesheet" href="../css/style.css">
|
||||||
|
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||||
|
<script type="text/paperscript" canvas="canvas">
|
||||||
|
project.currentStyle = {
|
||||||
|
strokeColor: 'black',
|
||||||
|
strokeWidth: 2,
|
||||||
|
strokeCap: 'round'
|
||||||
|
};
|
||||||
|
var isvg = new ImportSVG;
|
||||||
|
isvg.importSVG(document.getElementById('svg'));
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="width:500px; height:500px; background:black;" id="svg">
|
||||||
|
<g>
|
||||||
|
<line x1="4" y1="20" x2="200" y2="200" style="stroke:red;stroke-width:1" id="line" />
|
||||||
|
<rect x="200" y="20" rx="20" ry="10" width="150" height="150" style="fill:green" id="round" />
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<rect x="250" y="180" width="150" height="150" style="fill:blue" id="rect" />
|
||||||
|
<ellipse cx="120" cy="250" rx="100" ry="50" style="fill:yellow;" id="oval" />
|
||||||
|
</g>
|
||||||
|
<text x="20" y="15" fill="green">I love SVG</text>
|
||||||
|
</svg>
|
||||||
|
<canvas id="canvas" width="500" height="500"></canvas>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue