Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Speaker artist card #12

Open
acesyde opened this issue Mar 16, 2023 · 0 comments
Open

Speaker artist card #12

acesyde opened this issue Mar 16, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@acesyde
Copy link
Contributor

acesyde commented Mar 16, 2023

Preview

Image

Description

Similar to the ‘Television source’ card, but more functional. Due to the use of song covers as thumbnails and a blurred background, we need to use two custom button-cards here. One as a container and the other for the content.

Todo

  • translations
  • editor
  • card
  • documentation

Button card code

type: custom:button-card
entity: media_player.sonos
show_entity_picture: true
show_name: false
tap_action:
  action: more-info
styles:
  grid:
    - grid-template-areas: '"info"'
    - grid-template-columns: 1fr
    - grid-template-rows: min-content
  card:
    - background: none
    - padding: 0
    - position: relative
    - '--mdc-ripple-press-opacity': 0
  img_cell:
    - position: absolute
  icon:
    - width: 150%
    - opacity: var(--color-tint)
    - '-webkit-filter': blur(20px)
    - '-moz-filter': blur(20px)
    - '-o-filter': blur(20px)
    - '-ms-filter': blur(20px)
    - filter: blur(20px)
custom_fields:
  info:
    card:
      type: custom:button-card
      entity: media_player.sonos
      show_entity_picture: true
      name: |
        [[[
          if (states['media_player.sonos'].attributes.media_title)
            return states['media_player.sonos'].attributes.media_title;
          else
            return "Nothing is playing";
        ]]]
      label: |
        [[[
          if (states['media_player.sonos'].attributes.media_artist)
            return states['media_player.sonos'].attributes.media_artist;
          else
            return "";
        ]]]
      show_label: true
      show_icon: true
      styles:
        grid:
          - grid-template-areas: '"i gutter n" "i gutter l"'
          - grid-template-columns: min-content 24px 1fr
          - grid-template-rows: min-content
        card:
          - font-family: hk nova medium
          - background: none
          - border-radius: 0
          - background: none
          - padding: 24px
          - '--mdc-ripple-press-opacity': 0
        img_cell:
          - height: 80px
          - width: 80px
          - border-radius: 16px
        icon:
          - height: 100%
          - width: 100%
        name:
          - font-size: 16px
          - color: var(--contrast20)
          - width: 100%
          - text-align: left
          - align-self: end
        label:
          - font-size: 12px
          - color: var(--contrast20)
          - opacity: 0.5
          - width: 100%
          - text-align: left
          - align-self: start
        custom_fields:
          image:
            - '--mdc-ripple-press-opacity': 0.5
@acesyde acesyde converted this from a draft issue Mar 16, 2023
@acesyde acesyde added the enhancement New feature or request label Mar 16, 2023
@acesyde acesyde moved this to 📋 Backlog in Lovelace Rounded Mar 16, 2023
@acesyde acesyde added the help wanted Extra attention is needed label Mar 16, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant