home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

picture-elements card size #156

Closed hekm77 closed 6 years ago

hekm77 commented 6 years ago

Image size 720x1000px

On my desktop i see:

111

On iPhone 5S i see cropped card. I can not scroll down.

222
    cards:
      - type: picture-elements
        image: /local/bg/bg.png
        elements:
          # tile_1
          - type: state-label
            entity: sensor
            style:
              top: 168px
              left: 0%
              transform: none
              box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
              background: rgb(44, 90, 140)
              width: 720px
              height: 135px
              opacity: 0.5
          # tile_2
          - type: state-label
            entity: sensor
            style:
              top: 330px
              left: 0%
              transform: none
              box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
              background: rgb(44, 90, 140)
              width: 720px
              height: 135px
              opacity: 0.5
          # tile_3
          - type: state-label
            entity: sensor
            style:
              top: 492px
              left: 0%
              transform: none
              box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
              background: rgb(44, 90, 140)
              width: 720px
              height: 135px
              opacity: 0.5
jeradM commented 6 years ago

The image will fit the width of the screen and maintain aspect ratio for the height. The 5S only has 460-528 usable pixels in portrait mode depending on safari header/footer size so setting top: 492px when also taking into account the 64px title/tabs is pushing the 3rd state-label off the bottom of the screen. You should probably be using % measurements if you want it to be responsive