Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Crossfade #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanLynnSmith
Copy link

Had some issues with the crossfade feature. I made these small adjustments to resolve.

@JonathanLynnSmith JonathanLynnSmith force-pushed the feature/fix_crossfade_transition branch 2 times, most recently from 0a19c72 to bd643c1 Compare March 30, 2023 05:43
Comment on lines +146 to +151
if(self.config.crossfade){
images = document.getElementsByClassName("crossfade-image")
if(images.length > 1 ){
images[0].style.opacity = 0
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should call this on self.wrapper, as there may be multiple MMM-Wallpaper modules on the page, and one shouldn't affect the others. Also, should keep the formatting consistent with the rest of the file:

Suggested change
if(self.config.crossfade){
images = document.getElementsByClassName("crossfade-image")
if(images.length > 1 ){
images[0].style.opacity = 0
}
}
if (self.config.crossfade) {
images = self.wrapper.getElementsByClassName("crossfade-image");
if (images.length > 1) {
images[0].style.opacity = 0;
}
}

@@ -19,6 +19,7 @@
}

.MMM-Wallpaper .crossfade-image {
position: absolute;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this code and while it does fix the issues with the crossfade, this doesn't seem to work when the fillRegion param is set to false. I want the slideshow to play in a specific region of the magic mirror display; not the whole background, and setting the position to absolute overrides the width/height values I've set up in the config and it fills the whole region with a cropped image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants