I have a group of two.js shapes. When a user hovers over a shape, I want that one shape to spin.
http://merhoo.github.io/secrets.html
Issue with css animations: if I apply a :hover animation to the svg shapes, it affects the position of the shape somehow, moving it to the top left corner.
So I'm trying to bind a mouseover event to each child for them to spin.
var shapes = makeFlowers();
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
...
var shape = pickFlower();
shape.translation.set(hi * two.width, vi * two.height);
two.add(shape);
}
}
two.update();
for (var f in flowers) {
var flower = flowers[f];
$(flower._renderer.elem)
.click(function(e) {
flower.fill = "blue";
})
}
So how do you apply hover/mouseover animations to shapes in two.js?