cargomedia / cm

UNMAINTAINED - CM web application framework
MIT License
12 stars 18 forks source link

add touch feedback to buttons #947

Closed stophecom closed 10 years ago

stophecom commented 10 years ago

I'm trying to add a kind of bubble effect (css animation) to the icon inside buttons. This works pretty well as it is triggered on :active. Now, I need to "delay" the js execution for as long as the animation runs. Options I see:

@njam probably the Angular approach is the best way. (also mind future SVG animated icons) wdyt?

njam commented 10 years ago

It sounds to me like Angular detects the animation duration from the CSS properties ("determined by introspecting the CSS and determining transition duration"). I'm wondering though - should we really delay the execution of the actual action, to make it look faster? Shouldn't the intended action happen in parallel. If we keep the animation short, we can minimize the risk of the action finishing before the animation.

stophecom commented 10 years ago

agree. problem is that, in a lot of situations, the component reloads on click -> the animation gets cut off.

njam commented 10 years ago

How long are the animations you have in mind? AJAX requests take here in the US to our servers ~30-150ms.

stophecom commented 10 years ago

200-400ms :disappointed:

njam commented 10 years ago

Hmmm, it feels to me a bit user-un-friendly to delay actions for that long, to display an animation.

njam commented 10 years ago

The main goal should be to let the user know something is happening, in case the request takes longer than usual right? How about making the button background darker on click (like on Android, iPhone or google.com) and making sure that this effect will be shown at least for X milliseconds (with javascript). So if someone taps very quickly on a button, it would still be in :active visual state for 100ms?

njam commented 10 years ago

btw what google.com is using for all textual links is just making it red on click :) screen shot 2014-01-16 at 01 29 44

stophecom commented 10 years ago

about the :active I have the impression it sometimes doesn't get triggered if you touch. (that's what you mean I guess?) - maybe the whole issue with the animation is a bit overkill. I will focus on the spinner, and re-evaluate if there is an actual benefit of doing this in general. (Or if it'd rather make sense to do this on an individual basis)

stophecom commented 10 years ago

With the spinner in place I think we can close this?

njam commented 10 years ago

Will not be in all places, but it's okay for me.