coffeescript - Framer.js: how to get tap coordinates -
i'm writing framer.js function simulate 'splash' effect when tap button or layer, per google material design.
it looks this
tapsplash = (tapx,tapy) -> tapsplashlayer = new layer backgroundcolor: "#ffffff" opacity: 0.2 width: 500, height: 1500 borderradius: 1500 midx: tapx midy: tapy
after this, have code run animation.
my question is, how tapx , tapy coordinates? not enough use midpoint of layer has been clicked/tapped - want animation originate exact point user tapped on
check out own answer question. i've since forked , made changes taps on computer or taps on mobile device recognized separately. https://github.com/carignanboy1/material-design-interactions/tree/improved-touch
touchevent = events.touchevent(event) if utils.isphone() || utils.istablet() tx = touchevent.clientx - layer.x ty = touchevent.clienty - layer.y else tx = touchevent.offsetx ty = touchevent.offsety
Comments
Post a Comment