ember-animation / ember-animated

Core animation primitives for Ember.
https://ember-animation.github.io/ember-animated/
MIT License
244 stars 90 forks source link

Ability to globally change default duration #85

Open samselikoff opened 5 years ago

samselikoff commented 5 years ago

The default of 3000 is quite long, is it possible in userland to set a default?

ef4 commented 5 years ago

You're right. I'm in favor of reducing the default to something more reasonable (as a breaking change).

And I also think it would be fine to expose an option to set it globally once per app.

mupkoo commented 5 years ago

I was looking for this as well. I think that right now, you can just re-export animated-each in your app and change some default values in there.

Although this is probably not part of this discussion, but I feel like some good defaults can help a lot - duration, easing, etc. For example, you get really nice looking results just using the defaults of react-spring.

knownasilya commented 5 years ago

How do I customize duration for one off transitions? I tried:

constructor() {
    super(...arguments);
    this.transition = function *(options) {
      yield fade({ duration: 1000, ...options});
    };
  }

But no luck.

ef4 commented 5 years ago

@knownasilya I would expect your example work, assuming you're putting that in a component and then passing transition=this.transition into an animator component.

knownasilya commented 5 years ago

I thought so too. I updated to latest and still nothing. Basically the fade doesn't happen.