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 34 forks source link

Disabling the 'fade' animation for transitions #16

Closed KaitoKid closed 6 years ago

KaitoKid commented 7 years ago

Is it possible to disable the animation for transitions?

TheBogueRat commented 6 years ago

There are no parameters to pass from your config.js. Try changing this[i].show(1500) to 0 in the MMM-Carousel.js file in the modules subfolder as below:

            for (i = 0; i < this.length; i += 1) {
                // There is currently no easy way to discover whether a module is ALREADY shown/hidden
                // In testing, calling show/hide twice seems to cause no issues
                if (((this.slides === undefined) && (i === this.currentIndex)) || ((this.slides !== undefined) && (this.slides[this.currentIndex].indexOf(this[i].name) !== -1))) {
                    this[i].show(0);  //Change this line....
                } else {
                    this[i].hide(0);
                }
            }

The fade transition is not very good on the Raspberry Pi with a UHD monitor so I was playing around with this number to see if it would improve with a longer transition time, no luck. I'm hoping the fade is much better on the small LCD i've ordered.

UPDATE: Turns out the poor fade animation issue was a problem with Electron version. MM reverted it's version and now the animation looks much better on Raspi 3 B. There's a discussion of this issue here. Not sure why the OP wanted to disable transitions but if it was for poor performance, it might be worth checking out that post.