@turbowarp/paper 0.12.202407161743
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS.md +18 -0
- package/CHANGELOG.md +701 -0
- package/LICENSE.txt +23 -0
- package/README.md +381 -0
- package/dist/node/canvas.js +66 -0
- package/dist/node/extend.js +156 -0
- package/dist/node/self.js +58 -0
- package/dist/node/xml.js +40 -0
- package/dist/paper-core.js +15805 -0
- package/dist/paper-full.js +17574 -0
- package/examples/Animated/AnimatedStar.html +53 -0
- package/examples/Animated/BooleanOperations.html +115 -0
- package/examples/Animated/CandyCrash.html +151 -0
- package/examples/Animated/Extruded.html +50 -0
- package/examples/Animated/Lines.html +53 -0
- package/examples/Animated/Smoothing.html +70 -0
- package/examples/Animated/Space.html +86 -0
- package/examples/Animated/SpaceUsingShapes.html +79 -0
- package/examples/Games/Paperoids.html +569 -0
- package/examples/JSON/Circle Testing.html +34 -0
- package/examples/JSON/Compound Path.html +25 -0
- package/examples/JSON/Empty Path Testing.html +31 -0
- package/examples/JSON/Gradients.html +34 -0
- package/examples/JSON/Group Transform.html +28 -0
- package/examples/JSON/Line Testing.html +44 -0
- package/examples/JSON/Random Path Testing.html +42 -0
- package/examples/JSON/Raster.html +29 -0
- package/examples/JSON/Rect and Attribute Testing.html +56 -0
- package/examples/JSON/Rotated Primitives.html +55 -0
- package/examples/JSON/Selection.html +43 -0
- package/examples/JSON/Shapes.html +54 -0
- package/examples/JSON/Symbols.html +30 -0
- package/examples/JSON/Text Testing.html +38 -0
- package/examples/JSON/Tiger.html +19 -0
- package/examples/JSON/Transform Test 1.html +32 -0
- package/examples/JSON/Transform Test 2.html +30 -0
- package/examples/Node.js/AnimatedStar.js +52 -0
- package/examples/Node.js/BooleanOperations.js +36 -0
- package/examples/Node.js/JSONtoPDF.js +20 -0
- package/examples/Node.js/Raster.js +32 -0
- package/examples/Node.js/RasterRemote.js +33 -0
- package/examples/Node.js/SvgExport.js +52 -0
- package/examples/Node.js/SvgImport.js +23 -0
- package/examples/Node.js/Tadpoles.js +16 -0
- package/examples/Node.js/Tadpoles.pjs +278 -0
- package/examples/Node.js/in.json +1 -0
- package/examples/Node.js/in.svg +16 -0
- package/examples/Paperjs.org/BooleanOperattions.html +115 -0
- package/examples/Paperjs.org/BouncingBalls.html +103 -0
- package/examples/Paperjs.org/Chain.html +54 -0
- package/examples/Paperjs.org/DivisionRaster.html +72 -0
- package/examples/Paperjs.org/FutureSplash.html +122 -0
- package/examples/Paperjs.org/HitTesting.html +103 -0
- package/examples/Paperjs.org/InteractiveTiger.html +777 -0
- package/examples/Paperjs.org/MetaBalls.html +132 -0
- package/examples/Paperjs.org/NyanRainbow.html +202 -0
- package/examples/Paperjs.org/PathIntersections.html +76 -0
- package/examples/Paperjs.org/Qbertify.html +146 -0
- package/examples/Paperjs.org/RadialRainbows.html +80 -0
- package/examples/Paperjs.org/RoundedRectangles.html +41 -0
- package/examples/Paperjs.org/SatieLikedToDraw.html +140 -0
- package/examples/Paperjs.org/Simplify.html +63 -0
- package/examples/Paperjs.org/SpiralRaster.html +120 -0
- package/examples/Paperjs.org/Tadpoles.html +283 -0
- package/examples/Paperjs.org/Voronoi.html +134 -0
- package/examples/Rasters/PhyllotaxisRaster.html +96 -0
- package/examples/Rasters/Raster.html +34 -0
- package/examples/Rasters/RotationRaster.html +44 -0
- package/examples/Rasters/Smoothing.html +48 -0
- package/examples/SVG Export/Circle Testing.html +32 -0
- package/examples/SVG Export/Clipping.html +17 -0
- package/examples/SVG Export/Compound Path.html +22 -0
- package/examples/SVG Export/Empty Path Testing.html +28 -0
- package/examples/SVG Export/Gradients.html +52 -0
- package/examples/SVG Export/Group Transform.html +25 -0
- package/examples/SVG Export/Line Testing.html +41 -0
- package/examples/SVG Export/Random Path Testing.html +39 -0
- package/examples/SVG Export/Raster.html +21 -0
- package/examples/SVG Export/Rect and Attribute Testing.html +53 -0
- package/examples/SVG Export/Rotated Primitives.html +80 -0
- package/examples/SVG Export/Shapes.html +58 -0
- package/examples/SVG Export/Symbols.html +27 -0
- package/examples/SVG Export/Text Testing.html +45 -0
- package/examples/SVG Export/Tiger.html +23 -0
- package/examples/SVG Export/Transform Test 1.html +29 -0
- package/examples/SVG Export/Transform Test 2.html +27 -0
- package/examples/SVG Import/Arcs.html +78 -0
- package/examples/SVG Import/Butterfly.html +223 -0
- package/examples/SVG Import/Circle and Ellipse Testing.html +26 -0
- package/examples/SVG Import/Clipping.html +100 -0
- package/examples/SVG Import/From File.html +30 -0
- package/examples/SVG Import/Gradient.html +138 -0
- package/examples/SVG Import/Gradients.html +30 -0
- package/examples/SVG Import/Inkscape Pivot.html +52 -0
- package/examples/SVG Import/Inkscape.html +88 -0
- package/examples/SVG Import/Line Testing.html +24 -0
- package/examples/SVG Import/MoreGradients.html +107 -0
- package/examples/SVG Import/Multiple Paths Test 1.html +42 -0
- package/examples/SVG Import/Multiple Paths Test 2.html +33 -0
- package/examples/SVG Import/Nested Groups Test.html +78 -0
- package/examples/SVG Import/Polybezier.html +43 -0
- package/examples/SVG Import/Rect Testing.html +25 -0
- package/examples/SVG Import/Symbols.html +24 -0
- package/examples/SVG Import/Testing.html +40 -0
- package/examples/SVG Import/Text Testing.html +19 -0
- package/examples/SVG Import/Tiger.html +742 -0
- package/examples/SVG Import/Transform Testing.html +22 -0
- package/examples/SVG Import/Viewbox.html +38 -0
- package/examples/Scripts/Arcs.html +39 -0
- package/examples/Scripts/BlendModes.html +77 -0
- package/examples/Scripts/BooleanOperations.html +937 -0
- package/examples/Scripts/CompoundPath.html +19 -0
- package/examples/Scripts/CurveTimeParameterization.html +61 -0
- package/examples/Scripts/HslColor.html +53 -0
- package/examples/Scripts/PathStructure.html +82 -0
- package/examples/Scripts/PathTangents.html +73 -0
- package/examples/Scripts/Resize.html +42 -0
- package/examples/Scripts/RoundRectangle.html +28 -0
- package/examples/Scripts/Shapes.html +54 -0
- package/examples/Scripts/StrokeBounds.html +101 -0
- package/examples/Scripts/StrokeScaling.html +65 -0
- package/examples/Tools/BezierTool.html +90 -0
- package/examples/Tools/Circles.html +28 -0
- package/examples/Tools/Clouds.html +35 -0
- package/examples/Tools/DrippingBrush.html +73 -0
- package/examples/Tools/FancyBrush.html +82 -0
- package/examples/Tools/Grid.html +44 -0
- package/examples/Tools/MultiLines.html +44 -0
- package/examples/Tools/MultipleTools.html +44 -0
- package/examples/Tools/PathEditing.html +95 -0
- package/examples/Tools/SquareRounded.html +76 -0
- package/examples/Tools/Stars.html +38 -0
- package/examples/Tools/Vektor.html +200 -0
- package/examples/Tools/Wave.html +50 -0
- package/examples/Tools/WormFarm.html +88 -0
- package/examples/Worker/Main.html +53 -0
- package/examples/Worker/Worker.js +14 -0
- package/examples/css/style.css +12 -0
- package/package.json +109 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Transform Testing</title>
|
|
6
|
+
<link rel="stylesheet" href="../css/style.css">
|
|
7
|
+
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
8
|
+
<script type="text/paperscript" canvas="canvas">
|
|
9
|
+
project.importSVG(document.getElementById('svg'));
|
|
10
|
+
</script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500" height="500" id="svg">
|
|
14
|
+
<g transform="scale(5) translate(15, 15) rotate(20) skewX(20) skewY(5)" >
|
|
15
|
+
<rect x="10" y="10" width="5" height="5" fill="firebrick" />
|
|
16
|
+
<circle r="10" fill="seagreen" stroke="blue"/>
|
|
17
|
+
<rect x="5" y="5" width="12" height="2" fill="grey" stroke="silver"/>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
20
|
+
<canvas id="canvas" width="500" height="500"></canvas>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Viewbox 1</title>
|
|
6
|
+
<link rel="stylesheet" href="../css/style.css">
|
|
7
|
+
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
8
|
+
<script type="text/paperscript" canvas="canvas">
|
|
9
|
+
project.importSVG(document.getElementById('svg'));
|
|
10
|
+
</script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<svg width="300" height="200"
|
|
14
|
+
viewBox="100 100 1500 1000" preserveAspectRatio="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg">
|
|
16
|
+
<desc>Example ViewBox - uses the viewBox
|
|
17
|
+
attribute to automatically create an initial user coordinate
|
|
18
|
+
system which causes the graphic to scale to fit into the
|
|
19
|
+
viewport no matter what size the viewport is.</desc>
|
|
20
|
+
|
|
21
|
+
<!-- This rectangle goes from (0,0) to (1500,1000) in user space.
|
|
22
|
+
Because of the viewBox attribute above,
|
|
23
|
+
the rectangle will end up filling the entire area
|
|
24
|
+
reserved for the SVG content. -->
|
|
25
|
+
<rect x="0" y="0" width="1500" height="1000"
|
|
26
|
+
fill="yellow" stroke="blue" stroke-width="12" />
|
|
27
|
+
|
|
28
|
+
<!-- A large, red triangle -->
|
|
29
|
+
<path fill="red" d="M 750,100 L 250,900 L 1250,900 z"/>
|
|
30
|
+
|
|
31
|
+
<!-- A text string that spans most of the viewport -->
|
|
32
|
+
<text x="100" y="600" font-size="200" font-family="Verdana" >
|
|
33
|
+
Stretch to fit
|
|
34
|
+
</text>
|
|
35
|
+
</svg>
|
|
36
|
+
<canvas id="canvas" width="300" height="200"></canvas>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Arcs</title>
|
|
6
|
+
<link rel="stylesheet" href="../css/style.css">
|
|
7
|
+
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
8
|
+
<script type="text/paperscript" canvas="canvas">
|
|
9
|
+
var values = {
|
|
10
|
+
points: 20,
|
|
11
|
+
radius: 20,
|
|
12
|
+
initialRadius: 10
|
|
13
|
+
};
|
|
14
|
+
for (var i = 0; i < 30; i++) {
|
|
15
|
+
var path = new Path({
|
|
16
|
+
fillColor: i % 2 ? 'red' : 'black',
|
|
17
|
+
closed: true
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var point = new Point({
|
|
21
|
+
length: values.initialRadius + values.radius * i,
|
|
22
|
+
angle: 0
|
|
23
|
+
});
|
|
24
|
+
for (var j = 0; j <= values.points; j++) {
|
|
25
|
+
point.angle += 360 / values.points;
|
|
26
|
+
if (j == 0) {
|
|
27
|
+
path.add(view.center + point);
|
|
28
|
+
} else {
|
|
29
|
+
path.arcTo(view.center + point);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
project.activeLayer.insertChild(0, path);
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<canvas id="canvas" resize></canvas>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|