paper 0.12.18 → 0.12.20

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.
Files changed (231) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +5 -14
  3. package/dist/docs/assets/js/paper.js +94 -54
  4. package/dist/docs/classes/Color.html +2 -2
  5. package/dist/docs/classes/CompoundPath.html +2 -2
  6. package/dist/docs/classes/Curve.html +2 -2
  7. package/dist/docs/classes/CurveLocation.html +2 -2
  8. package/dist/docs/classes/Event.html +2 -2
  9. package/dist/docs/classes/Gradient.html +2 -2
  10. package/dist/docs/classes/GradientStop.html +2 -2
  11. package/dist/docs/classes/Group.html +2 -2
  12. package/dist/docs/classes/HitResult.html +2 -2
  13. package/dist/docs/classes/Item.html +2 -2
  14. package/dist/docs/classes/Key.html +2 -2
  15. package/dist/docs/classes/KeyEvent.html +2 -2
  16. package/dist/docs/classes/Layer.html +2 -2
  17. package/dist/docs/classes/Matrix.html +2 -2
  18. package/dist/docs/classes/MouseEvent.html +2 -2
  19. package/dist/docs/classes/PaperScope.html +2 -2
  20. package/dist/docs/classes/PaperScript.html +2 -2
  21. package/dist/docs/classes/Path.html +2 -2
  22. package/dist/docs/classes/PathItem.html +2 -2
  23. package/dist/docs/classes/Point.html +2 -2
  24. package/dist/docs/classes/PointText.html +2 -2
  25. package/dist/docs/classes/Project.html +2 -2
  26. package/dist/docs/classes/Raster.html +2 -2
  27. package/dist/docs/classes/Rectangle.html +2 -2
  28. package/dist/docs/classes/Segment.html +2 -2
  29. package/dist/docs/classes/Shape.html +2 -2
  30. package/dist/docs/classes/Size.html +2 -2
  31. package/dist/docs/classes/Style.html +2 -2
  32. package/dist/docs/classes/SymbolDefinition.html +2 -2
  33. package/dist/docs/classes/SymbolItem.html +2 -2
  34. package/dist/docs/classes/TextItem.html +2 -2
  35. package/dist/docs/classes/Tool.html +2 -2
  36. package/dist/docs/classes/ToolEvent.html +2 -2
  37. package/dist/docs/classes/Tween.html +2 -2
  38. package/dist/docs/classes/View.html +2 -2
  39. package/dist/docs/classes/global.html +2 -2
  40. package/dist/docs/classes/index.html +2 -2
  41. package/dist/docs/index.html +1 -1
  42. package/dist/node/canvas.js +9 -7
  43. package/dist/node/self.js +9 -1
  44. package/dist/paper-core.js +93 -53
  45. package/dist/paper-core.min.js +3 -3
  46. package/dist/paper-full.js +94 -54
  47. package/dist/paper-full.min.js +3 -3
  48. package/dist/paper.d.ts +2 -2
  49. package/package.json +11 -7
  50. package/dist/paperjs/LICENSE.txt +0 -23
  51. package/dist/paperjs/dist/node/canvas.js +0 -66
  52. package/dist/paperjs/dist/node/extend.js +0 -156
  53. package/dist/paperjs/dist/node/self.js +0 -58
  54. package/dist/paperjs/dist/node/xml.js +0 -40
  55. package/dist/paperjs/dist/paper-core.d.ts +0 -1
  56. package/dist/paperjs/dist/paper-core.js +0 -15703
  57. package/dist/paperjs/dist/paper-core.min.js +0 -32
  58. package/dist/paperjs/dist/paper-full.js +0 -17472
  59. package/dist/paperjs/dist/paper-full.min.js +0 -32
  60. package/dist/paperjs/dist/paper.d.ts +0 -7394
  61. package/dist/paperjs/docs/assets/css/docs.css +0 -414
  62. package/dist/paperjs/docs/assets/js/codemirror.js +0 -4
  63. package/dist/paperjs/docs/assets/js/docs.js +0 -493
  64. package/dist/paperjs/docs/assets/js/jquery.js +0 -6
  65. package/dist/paperjs/docs/assets/js/paper.js +0 -17472
  66. package/dist/paperjs/docs/classes/Color.html +0 -2188
  67. package/dist/paperjs/docs/classes/CompoundPath.html +0 -8877
  68. package/dist/paperjs/docs/classes/Curve.html +0 -2323
  69. package/dist/paperjs/docs/classes/CurveLocation.html +0 -672
  70. package/dist/paperjs/docs/classes/Event.html +0 -176
  71. package/dist/paperjs/docs/classes/Gradient.html +0 -240
  72. package/dist/paperjs/docs/classes/GradientStop.html +0 -273
  73. package/dist/paperjs/docs/classes/Group.html +0 -6864
  74. package/dist/paperjs/docs/classes/HitResult.html +0 -239
  75. package/dist/paperjs/docs/classes/Item.html +0 -6628
  76. package/dist/paperjs/docs/classes/Key.html +0 -139
  77. package/dist/paperjs/docs/classes/KeyEvent.html +0 -308
  78. package/dist/paperjs/docs/classes/Layer.html +0 -6850
  79. package/dist/paperjs/docs/classes/Matrix.html +0 -1744
  80. package/dist/paperjs/docs/classes/MouseEvent.html +0 -355
  81. package/dist/paperjs/docs/classes/PaperScope.html +0 -459
  82. package/dist/paperjs/docs/classes/PaperScript.html +0 -198
  83. package/dist/paperjs/docs/classes/Path.html +0 -11775
  84. package/dist/paperjs/docs/classes/PathItem.html +0 -8639
  85. package/dist/paperjs/docs/classes/Point.html +0 -2699
  86. package/dist/paperjs/docs/classes/PointText.html +0 -7029
  87. package/dist/paperjs/docs/classes/Project.html +0 -1305
  88. package/dist/paperjs/docs/classes/Raster.html +0 -7843
  89. package/dist/paperjs/docs/classes/Rectangle.html +0 -1654
  90. package/dist/paperjs/docs/classes/Segment.html +0 -939
  91. package/dist/paperjs/docs/classes/Shape.html +0 -7363
  92. package/dist/paperjs/docs/classes/Size.html +0 -1825
  93. package/dist/paperjs/docs/classes/Style.html +0 -919
  94. package/dist/paperjs/docs/classes/SymbolDefinition.html +0 -311
  95. package/dist/paperjs/docs/classes/SymbolItem.html +0 -6755
  96. package/dist/paperjs/docs/classes/TextItem.html +0 -6869
  97. package/dist/paperjs/docs/classes/Tool.html +0 -761
  98. package/dist/paperjs/docs/classes/ToolEvent.html +0 -446
  99. package/dist/paperjs/docs/classes/Tween.html +0 -374
  100. package/dist/paperjs/docs/classes/View.html +0 -1772
  101. package/dist/paperjs/docs/classes/global.html +0 -425
  102. package/dist/paperjs/docs/classes/index.html +0 -88
  103. package/dist/paperjs/docs/index.html +0 -11
  104. package/dist/paperjs/examples/Animated/AnimatedStar.html +0 -53
  105. package/dist/paperjs/examples/Animated/BooleanOperations.html +0 -115
  106. package/dist/paperjs/examples/Animated/CandyCrash.html +0 -151
  107. package/dist/paperjs/examples/Animated/Extruded.html +0 -50
  108. package/dist/paperjs/examples/Animated/Lines.html +0 -53
  109. package/dist/paperjs/examples/Animated/Smoothing.html +0 -70
  110. package/dist/paperjs/examples/Animated/Space.html +0 -86
  111. package/dist/paperjs/examples/Animated/SpaceUsingShapes.html +0 -79
  112. package/dist/paperjs/examples/Games/Paperoids.html +0 -569
  113. package/dist/paperjs/examples/JSON/Circle Testing.html +0 -34
  114. package/dist/paperjs/examples/JSON/Compound Path.html +0 -25
  115. package/dist/paperjs/examples/JSON/Empty Path Testing.html +0 -31
  116. package/dist/paperjs/examples/JSON/Gradients.html +0 -34
  117. package/dist/paperjs/examples/JSON/Group Transform.html +0 -28
  118. package/dist/paperjs/examples/JSON/Line Testing.html +0 -44
  119. package/dist/paperjs/examples/JSON/Random Path Testing.html +0 -42
  120. package/dist/paperjs/examples/JSON/Raster.html +0 -29
  121. package/dist/paperjs/examples/JSON/Rect and Attribute Testing.html +0 -56
  122. package/dist/paperjs/examples/JSON/Rotated Primitives.html +0 -55
  123. package/dist/paperjs/examples/JSON/Selection.html +0 -43
  124. package/dist/paperjs/examples/JSON/Shapes.html +0 -54
  125. package/dist/paperjs/examples/JSON/Symbols.html +0 -30
  126. package/dist/paperjs/examples/JSON/Text Testing.html +0 -38
  127. package/dist/paperjs/examples/JSON/Tiger.html +0 -19
  128. package/dist/paperjs/examples/JSON/Transform Test 1.html +0 -32
  129. package/dist/paperjs/examples/JSON/Transform Test 2.html +0 -30
  130. package/dist/paperjs/examples/Node.js/AnimatedStar.js +0 -52
  131. package/dist/paperjs/examples/Node.js/BooleanOperations.js +0 -36
  132. package/dist/paperjs/examples/Node.js/JSONtoPDF.js +0 -20
  133. package/dist/paperjs/examples/Node.js/Raster.js +0 -32
  134. package/dist/paperjs/examples/Node.js/RasterRemote.js +0 -33
  135. package/dist/paperjs/examples/Node.js/SvgExport.js +0 -52
  136. package/dist/paperjs/examples/Node.js/SvgImport.js +0 -23
  137. package/dist/paperjs/examples/Node.js/Tadpoles.js +0 -16
  138. package/dist/paperjs/examples/Node.js/Tadpoles.pjs +0 -278
  139. package/dist/paperjs/examples/Node.js/in.json +0 -1
  140. package/dist/paperjs/examples/Node.js/in.svg +0 -16
  141. package/dist/paperjs/examples/Paperjs.org/BooleanOperattions.html +0 -115
  142. package/dist/paperjs/examples/Paperjs.org/BouncingBalls.html +0 -103
  143. package/dist/paperjs/examples/Paperjs.org/Chain.html +0 -54
  144. package/dist/paperjs/examples/Paperjs.org/DivisionRaster.html +0 -72
  145. package/dist/paperjs/examples/Paperjs.org/FutureSplash.html +0 -122
  146. package/dist/paperjs/examples/Paperjs.org/HitTesting.html +0 -103
  147. package/dist/paperjs/examples/Paperjs.org/InteractiveTiger.html +0 -777
  148. package/dist/paperjs/examples/Paperjs.org/MetaBalls.html +0 -132
  149. package/dist/paperjs/examples/Paperjs.org/NyanRainbow.html +0 -202
  150. package/dist/paperjs/examples/Paperjs.org/PathIntersections.html +0 -76
  151. package/dist/paperjs/examples/Paperjs.org/Qbertify.html +0 -146
  152. package/dist/paperjs/examples/Paperjs.org/RadialRainbows.html +0 -80
  153. package/dist/paperjs/examples/Paperjs.org/RoundedRectangles.html +0 -41
  154. package/dist/paperjs/examples/Paperjs.org/SatieLikedToDraw.html +0 -140
  155. package/dist/paperjs/examples/Paperjs.org/Simplify.html +0 -63
  156. package/dist/paperjs/examples/Paperjs.org/SpiralRaster.html +0 -120
  157. package/dist/paperjs/examples/Paperjs.org/Tadpoles.html +0 -283
  158. package/dist/paperjs/examples/Paperjs.org/Voronoi.html +0 -134
  159. package/dist/paperjs/examples/Rasters/PhyllotaxisRaster.html +0 -96
  160. package/dist/paperjs/examples/Rasters/Raster.html +0 -34
  161. package/dist/paperjs/examples/Rasters/RotationRaster.html +0 -44
  162. package/dist/paperjs/examples/Rasters/Smoothing.html +0 -36
  163. package/dist/paperjs/examples/SVG Export/Circle Testing.html +0 -32
  164. package/dist/paperjs/examples/SVG Export/Clipping.html +0 -17
  165. package/dist/paperjs/examples/SVG Export/Compound Path.html +0 -22
  166. package/dist/paperjs/examples/SVG Export/Empty Path Testing.html +0 -28
  167. package/dist/paperjs/examples/SVG Export/Gradients.html +0 -52
  168. package/dist/paperjs/examples/SVG Export/Group Transform.html +0 -25
  169. package/dist/paperjs/examples/SVG Export/Line Testing.html +0 -41
  170. package/dist/paperjs/examples/SVG Export/Random Path Testing.html +0 -39
  171. package/dist/paperjs/examples/SVG Export/Raster.html +0 -21
  172. package/dist/paperjs/examples/SVG Export/Rect and Attribute Testing.html +0 -53
  173. package/dist/paperjs/examples/SVG Export/Rotated Primitives.html +0 -80
  174. package/dist/paperjs/examples/SVG Export/Shapes.html +0 -58
  175. package/dist/paperjs/examples/SVG Export/Symbols.html +0 -27
  176. package/dist/paperjs/examples/SVG Export/Text Testing.html +0 -45
  177. package/dist/paperjs/examples/SVG Export/Tiger.html +0 -23
  178. package/dist/paperjs/examples/SVG Export/Transform Test 1.html +0 -29
  179. package/dist/paperjs/examples/SVG Export/Transform Test 2.html +0 -27
  180. package/dist/paperjs/examples/SVG Import/Arcs.html +0 -78
  181. package/dist/paperjs/examples/SVG Import/Butterfly.html +0 -223
  182. package/dist/paperjs/examples/SVG Import/Circle and Ellipse Testing.html +0 -26
  183. package/dist/paperjs/examples/SVG Import/Clipping.html +0 -100
  184. package/dist/paperjs/examples/SVG Import/From File.html +0 -30
  185. package/dist/paperjs/examples/SVG Import/Gradient.html +0 -138
  186. package/dist/paperjs/examples/SVG Import/Gradients.html +0 -30
  187. package/dist/paperjs/examples/SVG Import/Inkscape Pivot.html +0 -52
  188. package/dist/paperjs/examples/SVG Import/Inkscape.html +0 -88
  189. package/dist/paperjs/examples/SVG Import/Line Testing.html +0 -24
  190. package/dist/paperjs/examples/SVG Import/MoreGradients.html +0 -107
  191. package/dist/paperjs/examples/SVG Import/Multiple Paths Test 1.html +0 -42
  192. package/dist/paperjs/examples/SVG Import/Multiple Paths Test 2.html +0 -33
  193. package/dist/paperjs/examples/SVG Import/Nested Groups Test.html +0 -78
  194. package/dist/paperjs/examples/SVG Import/Polybezier.html +0 -43
  195. package/dist/paperjs/examples/SVG Import/Rect Testing.html +0 -25
  196. package/dist/paperjs/examples/SVG Import/Symbols.html +0 -24
  197. package/dist/paperjs/examples/SVG Import/Testing.html +0 -40
  198. package/dist/paperjs/examples/SVG Import/Text Testing.html +0 -19
  199. package/dist/paperjs/examples/SVG Import/Tiger.html +0 -742
  200. package/dist/paperjs/examples/SVG Import/Transform Testing.html +0 -22
  201. package/dist/paperjs/examples/SVG Import/Viewbox.html +0 -38
  202. package/dist/paperjs/examples/Scripts/Arcs.html +0 -39
  203. package/dist/paperjs/examples/Scripts/BlendModes.html +0 -77
  204. package/dist/paperjs/examples/Scripts/BooleanOperations.html +0 -937
  205. package/dist/paperjs/examples/Scripts/CompoundPath.html +0 -19
  206. package/dist/paperjs/examples/Scripts/CurveTimeParameterization.html +0 -61
  207. package/dist/paperjs/examples/Scripts/HslColor.html +0 -53
  208. package/dist/paperjs/examples/Scripts/PathStructure.html +0 -82
  209. package/dist/paperjs/examples/Scripts/PathTangents.html +0 -73
  210. package/dist/paperjs/examples/Scripts/Resize.html +0 -42
  211. package/dist/paperjs/examples/Scripts/RoundRectangle.html +0 -28
  212. package/dist/paperjs/examples/Scripts/Shapes.html +0 -54
  213. package/dist/paperjs/examples/Scripts/StrokeBounds.html +0 -101
  214. package/dist/paperjs/examples/Scripts/StrokeScaling.html +0 -65
  215. package/dist/paperjs/examples/Tools/BezierTool.html +0 -90
  216. package/dist/paperjs/examples/Tools/Circles.html +0 -28
  217. package/dist/paperjs/examples/Tools/Clouds.html +0 -35
  218. package/dist/paperjs/examples/Tools/DrippingBrush.html +0 -73
  219. package/dist/paperjs/examples/Tools/FancyBrush.html +0 -82
  220. package/dist/paperjs/examples/Tools/Grid.html +0 -44
  221. package/dist/paperjs/examples/Tools/MultiLines.html +0 -44
  222. package/dist/paperjs/examples/Tools/MultipleTools.html +0 -44
  223. package/dist/paperjs/examples/Tools/PathEditing.html +0 -95
  224. package/dist/paperjs/examples/Tools/SquareRounded.html +0 -76
  225. package/dist/paperjs/examples/Tools/Stars.html +0 -38
  226. package/dist/paperjs/examples/Tools/Vektor.html +0 -200
  227. package/dist/paperjs/examples/Tools/Wave.html +0 -50
  228. package/dist/paperjs/examples/Tools/WormFarm.html +0 -88
  229. package/dist/paperjs/examples/Worker/Main.html +0 -53
  230. package/dist/paperjs/examples/Worker/Worker.js +0 -14
  231. package/dist/paperjs/examples/css/style.css +0 -12
@@ -1,151 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Candy Crash</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
- // kynd.info 2014
10
-
11
- function Ball(r, p, v) {
12
- this.radius = r;
13
- this.point = p;
14
- this.vector = v;
15
- this.maxVec = 15;
16
- this.numSegment = Math.floor(r / 3 + 2);
17
- this.boundOffset = [];
18
- this.boundOffsetBuff = [];
19
- this.sidePoints = [];
20
- this.path = new Path({
21
- fillColor: {
22
- hue: Math.random() * 360,
23
- saturation: 1,
24
- brightness: 1
25
- },
26
- blendMode: 'lighter'
27
- });
28
-
29
- for (var i = 0; i < this.numSegment; i ++) {
30
- this.boundOffset.push(this.radius);
31
- this.boundOffsetBuff.push(this.radius);
32
- this.path.add(new Point());
33
- this.sidePoints.push(new Point({
34
- angle: 360 / this.numSegment * i,
35
- length: 1
36
- }));
37
- }
38
- }
39
-
40
- Ball.prototype = {
41
- iterate: function() {
42
- this.checkBorders();
43
- if (this.vector.length > this.maxVec)
44
- this.vector.length = this.maxVec;
45
- this.point += this.vector;
46
- this.updateShape();
47
- },
48
-
49
- checkBorders: function() {
50
- var size = view.size;
51
- if (this.point.x < -this.radius)
52
- this.point.x = size.width + this.radius;
53
- if (this.point.x > size.width + this.radius)
54
- this.point.x = -this.radius;
55
- if (this.point.y < -this.radius)
56
- this.point.y = size.height + this.radius;
57
- if (this.point.y > size.height + this.radius)
58
- this.point.y = -this.radius;
59
- },
60
-
61
- updateShape: function() {
62
- var segments = this.path.segments;
63
- for (var i = 0; i < this.numSegment; i ++)
64
- segments[i].point = this.getSidePoint(i);
65
-
66
- this.path.smooth();
67
- for (var i = 0; i < this.numSegment; i ++) {
68
- if (this.boundOffset[i] < this.radius / 4)
69
- this.boundOffset[i] = this.radius / 4;
70
- var next = (i + 1) % this.numSegment;
71
- var prev = (i > 0) ? i - 1 : this.numSegment - 1;
72
- var offset = this.boundOffset[i];
73
- offset += (this.radius - offset) / 15;
74
- offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3;
75
- this.boundOffsetBuff[i] = this.boundOffset[i] = offset;
76
- }
77
- },
78
-
79
- react: function(b) {
80
- var dist = this.point.getDistance(b.point);
81
- if (dist < this.radius + b.radius && dist != 0) {
82
- var overlap = this.radius + b.radius - dist;
83
- var direc = (this.point - b.point).normalize(overlap * 0.015);
84
- this.vector += direc;
85
- b.vector -= direc;
86
-
87
- this.calcBounds(b);
88
- b.calcBounds(this);
89
- this.updateBounds();
90
- b.updateBounds();
91
- }
92
- },
93
-
94
- getBoundOffset: function(b) {
95
- var diff = this.point - b;
96
- var angle = (diff.angle + 180) % 360;
97
- return this.boundOffset[Math.floor(angle / 360 * this.boundOffset.length)];
98
- },
99
-
100
- calcBounds: function(b) {
101
- for (var i = 0; i < this.numSegment; i ++) {
102
- var tp = this.getSidePoint(i);
103
- var bLen = b.getBoundOffset(tp);
104
- var td = tp.getDistance(b.point);
105
- if (td < bLen) {
106
- this.boundOffsetBuff[i] -= (bLen - td) / 2;
107
- }
108
- }
109
- },
110
-
111
- getSidePoint: function(index) {
112
- return this.point + this.sidePoints[index] * this.boundOffset[index];
113
- },
114
-
115
- updateBounds: function() {
116
- for (var i = 0; i < this.numSegment; i ++)
117
- this.boundOffset[i] = this.boundOffsetBuff[i];
118
- }
119
- };
120
-
121
- //--------------------- main ---------------------
122
-
123
- var balls = [];
124
- var numBalls = 18;
125
- for (var i = 0; i < numBalls; i++) {
126
- var position = Point.random() * view.size;
127
- var vector = new Point({
128
- angle: 360 * Math.random(),
129
- length: Math.random() * 10
130
- });
131
- var radius = Math.random() * 60 + 60;
132
- balls.push(new Ball(radius, position, vector));
133
- }
134
-
135
- function onFrame() {
136
- for (var i = 0; i < balls.length - 1; i++) {
137
- for (var j = i + 1; j < balls.length; j++) {
138
- balls[i].react(balls[j]);
139
- }
140
- }
141
- for (var i = 0, l = balls.length; i < l; i++) {
142
- balls[i].iterate();
143
- }
144
- }
145
-
146
- </script>
147
- </head>
148
- <body>
149
- <canvas id="canvas" resize hidpi="off" style="background:black"></canvas>
150
- </body>
151
- </html>
@@ -1,50 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Extruded</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 lineGroup = new Group();
10
- var lineCount = 100;
11
- for (var i = 0; i < lineCount; i++) {
12
- var linePath = new Path.Line([0, 0], [0, 0]);
13
- lineGroup.addChild(linePath);
14
- }
15
- lineGroup.strokeColor = 'red';
16
-
17
- var path1 = new Path('M63.39307,265.71387c10.8667,6.96631 26.4707,12.26025 43.18896,12.26025c24.79932,0 39.28857,-13.09619 39.28857,-32.04346c0,-17.27588 -10.03125,-27.58545 -35.38721,-37.05908c-30.65088,-11.146 -49.59814,-27.30713 -49.59814,-53.49902c0,-29.25732 24.2417,-50.9917 60.74365,-50.9917c18.94727,0 33.1582,4.4585 41.23877,9.19531L156.18018,133.35986c-5.85156,-3.62256 -18.39014,-8.9165 -35.38721,-8.9165c-25.63525,0 -35.3877,15.3252 -35.3877,28.14258c0,17.5542 11.42432,26.19238 37.33789,36.22314c31.76514,12.26025 47.64795,27.58545 47.64795,55.1709c0,28.979 -21.17676,54.33496 -65.48096,54.33496c-18.11133,0 -37.89502,-5.57275 -47.92578,-12.26025z');
18
- path1.position = view.center;
19
-
20
- var path2 = path1.clone();
21
- path1.scale(1.5);
22
- path2.scale(2);
23
-
24
- var length1 = path1.length;
25
- var length2 = path2.length;
26
- function onFrame(event) {
27
- var vector = new Point({
28
- angle: -event.count % 360,
29
- length: 100
30
- });
31
- path1.rotate(-0.5);
32
- path1.position = view.center - vector;
33
-
34
- path2.rotate(-0.5);
35
- path2.position = view.center + vector.normalize(50);
36
-
37
- for (var i = 0; i < lineCount; i++) {
38
- var path = lineGroup.children[i];
39
- var l1 = (length1 / lineCount * (i + event.count / 10)) % length1;
40
- var l2 = (length2 / lineCount * (i + event.count / 10)) % length2;
41
- path.firstSegment.point = path1.getPointAt(l1),
42
- path.lastSegment.point = path2.getPointAt(l2);
43
- }
44
- }
45
- </script>
46
- </head>
47
- <body>
48
- <canvas id="canvas" resize></canvas>
49
- </body>
50
- </html>
@@ -1,53 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Lines</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 amount = 45;
10
- for (var i = 0; i < amount; i++) {
11
- var path = new Path({
12
- fillColor: {
13
- hue: 1,
14
- saturation: 1,
15
- brightness: Math.random()
16
- },
17
- closed: true
18
- });
19
- }
20
-
21
- var position = view.center;
22
- var mousePos = view.center;
23
- var children = project.activeLayer.children;
24
-
25
- function iterate(count) {
26
- var delta = mousePos - position;
27
- position += delta / 10;
28
- for (var i = 1; i < amount; i++) {
29
- var path = children[i];
30
- var length = Math.abs(Math.sin(i + count / 40) * 300);
31
- path.segments = [
32
- position + delta / 1.5,
33
- position + { angle: i / amount * 360, length: length },
34
- position + { angle: (i + 1) / amount * 360, length: length }
35
- ];
36
- path.fillColor.hue = count - length;
37
- }
38
- }
39
-
40
- function onFrame(event) {
41
- iterate(event.count);
42
- }
43
-
44
- function onMouseMove(event) {
45
- iterate();
46
- mousePos = event.point;
47
- }
48
- </script>
49
- </head>
50
- <body style="background:black">
51
- <canvas id="canvas" resize></canvas>
52
- </body>
53
- </html>
@@ -1,70 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Smoothing</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 width, height, center;
10
- var points = 10;
11
- var smooth = true;
12
- var path = new Path({
13
- fillColor: 'black'
14
- });
15
- var mousePos = view.center / 2;
16
- var pathHeight = mousePos.y;
17
- initializePath();
18
-
19
- function initializePath() {
20
- center = view.center;
21
- width = view.size.width;
22
- height = view.size.height / 2;
23
- path.segments = [];
24
- path.add(view.bounds.bottomLeft);
25
- for (var i = 1; i < points; i++) {
26
- var point = new Point(width / points * i, center.y);
27
- path.add(point);
28
- }
29
- path.add(view.bounds.bottomRight);
30
- path.fullySelected = true;
31
- }
32
-
33
- function onFrame(event) {
34
- pathHeight += (center.y - mousePos.y - pathHeight) / 10;
35
- for (var i = 1; i < points; i++) {
36
- var sinSeed = event.count + (i + i % 10) * 100;
37
- var sinHeight = Math.sin(sinSeed / 200) * pathHeight;
38
- var yPos = Math.sin(sinSeed / 100) * sinHeight + height;
39
- path.segments[i].point.y = yPos;
40
- }
41
- if (smooth)
42
- path.smooth({ type: 'continuous' });
43
- }
44
-
45
- function onMouseMove(event) {
46
- mousePos = event.point;
47
- }
48
-
49
- function onMouseDown(event) {
50
- smooth = !smooth;
51
- if (!smooth) {
52
- // If smooth has been turned off, we need to reset
53
- // the handles of the path:
54
- for (var i = 0, l = path.segments.length; i < l; i++) {
55
- var segment = path.segments[i];
56
- segment.handleIn = segment.handleOut = null;
57
- }
58
- }
59
- }
60
-
61
- // Reposition the path whenever the window is resized:
62
- function onResize(event) {
63
- initializePath();
64
- }
65
- </script>
66
- </head>
67
- <body>
68
- <canvas id="canvas" resize></canvas>
69
- </body>
70
- </html>
@@ -1,86 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Space</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
- // The amount of symbol we want to place;
10
- var count = 150;
11
-
12
- // Create a symbol, which we will use to place instances of later:
13
- var path = new Path.Circle({
14
- center: new Point(0, 0),
15
- radius: 5,
16
- fillColor: 'white',
17
- strokeColor: 'black'
18
- });
19
-
20
- var symbol = new SymbolDefinition(path);
21
-
22
- // Place the instances of the symbol:
23
- for (var i = 0; i < count; i++) {
24
- // The center position is a random point in the view:
25
- var center = Point.random() * view.size;
26
- var placed = symbol.place(center);
27
- var scale = (i + 1) / count;
28
- placed.scale(scale);
29
- placed.data.vector = new Point({
30
- angle: Math.random() * 360,
31
- length : scale * Math.random() / 5
32
- });
33
- }
34
-
35
- var vector = new Point({
36
- angle: 45,
37
- length: 0
38
- });
39
-
40
- var mouseVector = vector.clone();
41
-
42
- function onMouseMove(event) {
43
- mouseVector = view.center - event.point;
44
- }
45
-
46
- // The onFrame function is called up to 60 times a second:
47
- function onFrame(event) {
48
- vector = vector + (mouseVector - vector) / 30;
49
-
50
- // Run through the active layer's children list and change
51
- // the position of the placed symbols:
52
- for (var i = 0; i < count; i++) {
53
- var item = project.activeLayer.children[i];
54
- var size = item.bounds.size;
55
- var length = vector.length / 10 * size.width / 10;
56
- item.position += vector.normalize(length) + item.data.vector;
57
- keepInView(item);
58
- }
59
- }
60
-
61
- function keepInView(item) {
62
- var position = item.position;
63
- var itemBounds = item.bounds;
64
- var bounds = view.bounds;
65
- if (itemBounds.left > bounds.width) {
66
- position.x = -item.bounds.width;
67
- }
68
-
69
- if (position.x < -itemBounds.width) {
70
- position.x = bounds.width + itemBounds.width;
71
- }
72
-
73
- if (itemBounds.top > view.size.height) {
74
- position.y = -itemBounds.height;
75
- }
76
-
77
- if (position.y < -itemBounds.height) {
78
- position.y = bounds.height + itemBounds.height / 2;
79
- }
80
- }
81
- </script>
82
- </head>
83
- <body>
84
- <canvas id="canvas" resize hidpi="off" style="background:black"></canvas>
85
- </body>
86
- </html>
@@ -1,79 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Space</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
- // The amount of symbol we want to place;
10
- var count = 150;
11
-
12
- project.currentStyle = {
13
- fillColor: 'white'
14
- };
15
-
16
- // Place the instances of the symbol:
17
- for (var i = 0; i < count; i++) {
18
- // The center position is a random point in the view:
19
- var center = Point.random() * view.size;
20
- var scale = (i + 1) / count;
21
- var path = new Shape.Circle(center, 5 * scale);
22
- path.data.vector = new Point({
23
- angle: Math.random() * 360,
24
- length : scale * Math.random() / 5
25
- });
26
- }
27
-
28
- var vector = new Point({
29
- angle: 45,
30
- length: 0
31
- });
32
-
33
- var mouseVector = vector.clone();
34
-
35
- function onMouseMove(event) {
36
- mouseVector = view.center - event.point;
37
- }
38
-
39
- // The onFrame function is called up to 60 times a second:
40
- function onFrame(event) {
41
- vector = vector + (mouseVector - vector) / 30;
42
-
43
- // Run through the active layer's children list and change
44
- // the position of the placed symbols:
45
- for (var i = 0; i < count; i++) {
46
- var item = project.activeLayer.children[i];
47
- var size = item.bounds.size;
48
- var length = vector.length / 10 * size.width / 10;
49
- item.position += vector.normalize(length) + item.data.vector;
50
- keepInView(item);
51
- }
52
- }
53
-
54
- function keepInView(item) {
55
- var position = item.position;
56
- var itemBounds = item.bounds;
57
- var bounds = view.bounds;
58
- if (itemBounds.left > bounds.width) {
59
- position.x = -item.bounds.width;
60
- }
61
-
62
- if (position.x < -itemBounds.width) {
63
- position.x = bounds.width + itemBounds.width;
64
- }
65
-
66
- if (itemBounds.top > view.size.height) {
67
- position.y = -itemBounds.height;
68
- }
69
-
70
- if (position.y < -itemBounds.height) {
71
- position.y = bounds.height + itemBounds.height / 2;
72
- }
73
- }
74
- </script>
75
- </head>
76
- <body>
77
- <canvas id="canvas" resize hidpi="off" style="background:black"></canvas>
78
- </body>
79
- </html>