From 3230f0d572febd03f224245f816066799c896143 Mon Sep 17 00:00:00 2001 From: Jonathan Smith Date: Wed, 29 Mar 2023 18:24:58 -0400 Subject: [PATCH] Fix Crossfade --- MMM-Wallpaper.css | 1 + MMM-Wallpaper.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/MMM-Wallpaper.css b/MMM-Wallpaper.css index f88e2a7..f228ddb 100644 --- a/MMM-Wallpaper.css +++ b/MMM-Wallpaper.css @@ -19,6 +19,7 @@ } .MMM-Wallpaper .crossfade-image { + position: absolute; transition: opacity 1s ease-in-out; } diff --git a/MMM-Wallpaper.js b/MMM-Wallpaper.js index 39c7d48..d6375e6 100644 --- a/MMM-Wallpaper.js +++ b/MMM-Wallpaper.js @@ -143,6 +143,13 @@ Module.register("MMM-Wallpaper", { element.style.opacity = 1; self.title.style.display = "none"; + if(self.config.crossfade){ + images = document.getElementsByClassName("crossfade-image") + if(images.length > 1 ){ + images[0].style.opacity = 0 + } + } + setTimeout(() => { var caption = imageData.caption; if (self.config.caption && caption) {