Read the statement by Michael Teeuw here.
[MMM-Rainbow] Animated text color transition
-
Love the concept, actually. Would love to see it limited to the user’s choice of modules, however.
-
MMM-NOAA3 has been doing this for some time now, as an option
-
@mykle1 doing what? I was referring to the original rainbow color. Would be cool to apply it to modules of choice.
-
@bkeyport said in [MMM-Rainbow] Animated text color transition:
doing what? I was referring to the original rainbow color.
Lets see. The topic states “[MMM-Rainbow] Animated text color transition” so I guess I was talking about that. Only noticed you because you mentioned me directly. I think @seann has done a fantastic job here. Joined the forum 8 days ago and already he’s contributing and offering his
help to others. He and I are going get along just fine. :-) -
So, you’re saying the NOAA weather app does rainbow colors for other modules?
… Okay.
-
@bkeyport Also, this is easily done. I’ll work on this for you when I have some more free time. The only issue with doing it to the clock is; the current clock uses “updateDom” to set the time each second, which from what I have seen basically re creates the elements. Meaning the transitions start from when the element is created so it’s not in time with the other transitions. So it would be easier to create your own clock module which just replaces the innerHTML of each element instead of re creating them. I have been making my own clock which will display down to minutes instead of seconds as i’m sure this would cause less strain on my terrible Pi 3 a+.
-
Actually, I’d be more interested in the mechanics in getting it to work down to the module level more than anything, would be nice to use it for say “Grabbing Attention” in a particular module…
-
@seann I took a different approach to this, mainly because I only wanted to have it for only one module. I have changed my custom.css and one line in the clock.js, so it grabs a different style.
My code makes a gradient background which I clip to the text. Then to make it move across the text i use webkit-animation. I’m not totally satisfied with the result of the animation yet but i will keep tweaking that.the animation moves way too fast now and when I make the animation duration longer it doesn’t feature all the colors of the gradient.
the only line i needed to change in the clock.js filetimeWrapper.className = "time clock-time-only-color large light";
Custom.css (lines i added)
.clock-time-only-color { background-image: linear-gradient(to right, #ff0000,#ff4000,#ff8000,#ffbf00,#ffff00,#bfff00,#80ff00,#40ff00,#00ff00,#00ff40,#00ff80,#00ffbf,#00ffff,#00bfff,#0080ff,#0040ff,#0000ff,#4000ff,#8000ff,#bf00ff,#ff00ff,#ff00bf,#ff0080,#ff0040,#ff0000); -webkit-background-clip: text; -webkit-animation: animate 3s linear infinite; background-size: 500%; color: transparent; } @-webkit-keyframes animate{ 0% {background-position: 0% 500%;} 50% {background-position: 100% 0%;} 100% {background-position: 0% 100%;} }
Do you have any idea on how I can make the animation duration way longer like 10 min and still show all the colors in the gradient?
Thank you for the initial idea and for inspiring me!
-
@ganget I’m not really that good with css animations but from what I can see,
-webkit-animation: animate 3s linear infinite;
should have something to do with it right? maybe if you make that 10 minutes instead.
-
@seann yeah i tried increasing the number to like 20 sec up to 6000. But the problem i get then is that it shows me only the first 2 colors in the gradient. Dunno but will try and work on it tomorrow