Image blink animation when entity state changes

Thank you, I got answer under card-mod thread.
For anyone wondering how to make image blink based on state, here is code that worked for me, I adjusted code provided by Mariusthvdb under card-mod thread

card_mod:
    style: |
      ha-card {
        box-shadow: none;
        animation:
          {% if states('sensor.bio_days') == '0' -%} 
            blink 1.5s linear infinite;
          {% else -%} none
          {% endif %}
      }
      @keyframes blink {
        from {opacity: 100;}
        to {opacity: 0;}
        from {opacity: 0;}
        to {opacity: 100;}
      }
1 Like