barnabycolby / MMM-Carousel

Displays a single magic mirror module at a time, rotating through the list of configured modules in a carousel-like fashion.
98 stars 33 forks source link

Fade out animation (speed control)... #9

Closed Snille closed 7 years ago

Snille commented 7 years ago

Hi, I'm currently using your module to switch trough modules on a specific position (upper_third). I'm noticing that the "fade in" works, but when "hiding" the module, it does not "fade out", it just pops away. Is there a way to set the speed of the "hiding" as well? :) I'm thinking it would be nice with an configuration option where you could set the "speed" of the in/out animation. :)

barnabycolby commented 7 years ago

The fading is not actually handled by MMM-Carousel. MMM-Carousel simply calls hide() and show() on the modules. I can't remember if the fading is handled by the modules or by magic mirror itself. It sounds like one of your modules does do fading and one doesn't.

Snille commented 7 years ago

Actually the "fade" is set via a number. On the "show" (line 83): this[i].show(1500); <- 1500 msec. But on the hide it's 0 (line 85): this[i].hide(0); The problem is that if you only add a number there, the "next" module fade in before the "previous" module has faded out (so the modules "jump around" :). I think there may be a better way. Now days you can "ask" the mm if the module is hidden or not. :) I'm just not a good enough programmer (yet) to make a PR for this... :)