mini-media-player icon indicating copy to clipboard operation
mini-media-player copied to clipboard

[Enhancement] material background style

Open GH2user opened this issue 4 years ago • 5 comments

When having multiple players eg Sonos it would be handy to have one more display mode which only renders the background according the 'material' style but without the artwork displayed.

That way the main player could show the material style including artwork and the satellites only the material background/foreground.

Mostly copy/paste of current styles with just a slight omission and adding an artwork style.

GH2user avatar Dec 24 '20 14:12 GH2user

I'm getting some luck with card-mod to hide the cover artwork. I'm not finished but ill write it up and send you the link once I'm happy with it. It would be better if child cards could inherit the first background colour though.

chriscolden avatar May 09 '21 22:05 chriscolden

I think i've nailed this for my use case. I have a chromecast group media player with the volume control hidden. I then use stack-in-card to show the individual players under it. Using card-mod i'm able to hide the cover gradient and remove the background image and stretch the remaining background colour full width. artwork type is set to material on all of them. This leaves me with the following card.

image

card-mod:
  style: |
    ha-card .cover-gradient {
      display: none;
    }
    ha-card .cover {
      background-image: none !important;
      width: 100% !important;
    }

Bit hacky but seems to work.

chriscolden avatar May 10 '21 17:05 chriscolden

Hi folks, sorry to bump an old topic but I wanted to share an extra rule I added to Chris' styles (thank you!) to remove the long transition time that was bugging me:

ha-card *, ha-card :before, ha-card :after, ha-card ha-icon * {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

I'm going to try to put together a PR to add a new artwork style but in the meantime, hope this helps save someone some time!

krisnoble avatar Feb 11 '22 11:02 krisnoble

Thanks Kris. That was bugging me too, but hadn't found time to address. I'll give this a go.

chriscolden avatar Feb 11 '22 11:02 chriscolden

It wouldn't stop bugging me so PR is in (#603), have also added a gist with my edited version if you want to give that a try. It still has some transitions but they seem to be in line with the default ones in HA, and much less obtrusive than the previous 4 second one.

krisnoble avatar Feb 11 '22 14:02 krisnoble