famo.us - How to implement google paper button effects -


Google's paper / content design is a very clean look that I think is going to see a lot of uses . A group of polymers is - ???? Paper-elements ???? Ready to go and the web community is already playing different ways to implement it. I'm particularly looking at the button click effect for this question.

There is a wave of activation color that is broadcast by your click. Here is a polymer example: Here is a CSS jquery example:

My question is how to go about implementing it?

Take a look at the polymer example You can masuad it in a second color instead of the color opacity waveform as a background color poly radiation. It holds when it reaches the IAC limit and then it fade quickly on the mouseup.

Because I could easily see the code behind the second example because I applied it in the same way as it was, but with the exception of using touch instead of clicking on the click, because I wanted to That's what I did to get the effect, but not touching it.

I tried scaling, changed the position of ambiguity, but the effect of getting a placement and exiting the point of touch was outside of me or for the least amount of time I have invested so far Have done

Any ideas about implementing it?

I also wanted this effect, but I have not seen any implementation. I decided to go with a CSS Radial Gradient in the background image of the button. I am focusing the wave on the touch / mouse point (slope). In order to hook into the render cycle, I have increased the Surface module.

There are two transitionsables, one for the diameter of a gradient and for a gradient ambiguity, both of these have been reset after the conversation. When the user clicks on a button, the surface stores the X and Y offset and then converts the shield diameter to its maximum value. When the user releases the button, it converts the shadow opacity to 0.

The render cycle is continuously setting the background-image radial gradient with the circle on the X and Y offset, and is receiving ambiguity and shield diameter from two transitions.

I can not tell you that I have applied the wave button effect using best practices, but I like the result.

  Var Surface = is required ('famous / core / surface'); Var Timer = Required ('Famous / Utilities / Timer'); Var requires Transitionable = ('famous / transit / transition'); // To increase the surface of the button, tap in .render (). Possibly the Touch Event Function Buttons () {Surface.apply (this, logic) should be included; This.gradientOpacity = New Transitionable (0.1); This.gradientSize = new transition (0); This.offsetx = 0; This.offsetY = 0; this. (On 'Musudaun', function (data) {this.offsetX = (data.offsetX || data.layerX) + 'px'; this.offsetY = (data.offsetY || data.layerY) + 'px'; This Kgrediantopasitikset (0.1); Thiskgrediantsijakset (0); Thiskgrediantsijakset (100, {duration: 300, Curve 'Aczot'});} Kbad (This)); This.on ( 'mouseup', function () {this.gradientOpacity.set (0, {duration: 300, curve: 'easeOut'})}}; This.on ( 'mouseleave', function () {this.gradientOpacity .set (0, {duration: 300, curve: 'easeOut'})}};} Btnsurfes. Protopit = object. Create (Srfeskprototaip); Btnsurfeskprototaipkkanstrctor = Btnsurfes; Btnsurfeskprototaipkrendr = function ( ) {var gradientOpacity = this.gradientOpacity.get (); Var gradientSize = this.gradientSize.get (); Var fade Size = gradient Size * 0.75; This.setProperties ({backgroundImage: 'radial-gradient (' + 'this. OffsetX + Circle on "this.offsetY +", RGBA (0,0,0 "+ GradientOpacity + '), RGBA (0,0, 0, + Gradient Opasiti +') '+ Gradient Size +' px, RGBA (255,255,255 '+ Gradient Opisiti +') '+ Gradient Size +' px) '}); // Return what surface is expected to return.id;};   

You can check out.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -