Iād like to help, please.
Hereās my card config (I also tried replacing āstyle: vertical-slider-cover-cardā with āha-cardā as customary but same result:
type: custom:vertical-slider-cover-card
title: Front room shades
showSidebar: false
entities:
- entity: cover.front_bedroom_shade_left
name: []
- entity: cover.front_bedroom_shade_right
name: []
card-mod:
style: vertical-slider-cover-card {
background: url('/local/rooms/misc/frontroomwindow.png');
background-size: contain;
background-repeat: no-repeat; }
Here is the background image:
I want the image to fit inside the card (resize as the card changes size), meaning the whole image should be visible, however currently this is how it displays (different window sizes):
Two questions:
- Is it possible to make my card always square, so that the image (which is 802x802px) is always displayed in full
- If yes, how do I make the card always be square (1:1 aspect ratio) with the background filling all of it and resizing as the card resizes (but while maintaining the 1:1 ratio)
Thanks.
EDIT:
I changed the code to this:
type: custom:vertical-slider-cover-card
title: Front room shades
showSidebar: false
entities:
- entity: cover.front_bedroom_shade_left
name: []
- entity: cover.front_bedroom_shade_right
name: []
style: |
ha-card {
background-image: url('/local/rooms/misc/frontroomwindow.png');
background-size: cover;
background-position: top;
background-repeat: no-repeat;}
And now it displays much better, but itās cutting off at the bottom, any ideas?
Edit2: I solved the above by using the custom cardās key that changes the slider size, increased it a bit and it now shows the whole image. Hope this helps anyone looking to do the same.
type: custom:vertical-slider-cover-card
title: Front room shades
showSidebar: false
positionHeight: 400px
openColor: rgba(161, 255, 217, 1)
closedColor: rgba(89, 89, 89, 1)
switchWidth: 60px
switchHeight: 40px
switchColor: rgba(89, 89, 89, 1)
switchFontColor: rgba(255, 255, 255, 0.8)
entities:
- entity: cover.front_bedroom_shade_left
name: []
- entity: cover.front_bedroom_shade_right
name: []
style: |
ha-card {
background-image: url('/local/rooms/misc/frontroomwindow.png');
background-size: cover;
background-position: top;
background-repeat: no-repeat;}