aboutsummaryrefslogtreecommitdiffstats
path: root/playgrounds/transforms/transforms.js
diff options
context:
space:
mode:
Diffstat (limited to 'playgrounds/transforms/transforms.js')
-rw-r--r--playgrounds/transforms/transforms.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/playgrounds/transforms/transforms.js b/playgrounds/transforms/transforms.js
index b27e1c3..1918cd7 100644
--- a/playgrounds/transforms/transforms.js
+++ b/playgrounds/transforms/transforms.js
@@ -1,9 +1,23 @@
-let mover = SVG.select("#new")[0]
-mover.transform({
- position: [800, 500],
- origin: [200, 400],
- skew: [20, 0],
- rotate: 30,
-})
+let canvas = SVG('#canvas')
+
+// Make the green rectange
+canvas.rect(200, 400).move(200, 400)
+ .attr('opacity', 0.3)
+ .addClass('green')
+
+// Make the pink rectangle
+let a = canvas.rect(200, 400).move(200, 400)
+ .attr('opacity', 0.3)
+ .addClass('pink')
+ .transform({ px: 100, py: 500, origin: 'top-left' })
+
+debugger
+ a.animate()
+ .rotate({ rotate: 500, origin: 'top-right' })
+
+// Put an ellipse where we expect the object to be
+canvas.ellipse(30, 30).center(100, 500)
+ .attr('opacity', 0.3)
+ .addClass('dark-pink')