Gh61/lovelace-hue-like-light-card

Can we create an animation on the icon?

Closed this issue · 3 comments

Good morning,
Thank you for your work.
Just a quick question.
Can we create an animation on the icon?
Style:
{% if is_state('light', 'on') %}
--icon-animation: spin 2s linear infinite;

I do not know how.
Thank you very much

Gh61 commented

Hi, thank you and thank you for suggestion.

In the next release there will be fix for amazing Card Mod.
I will also add some css classes indicating whether the light is on or off for you.

You can than write your own css for animating the icon, when the light is on (based on css class).

Gh61 commented

In the new version 1.4.0 (currently in development).
You will be able to rotate the icon with the folowing code (when using the card_mod):

type: custom:hue-like-light-card
entity: light.study
style: |
  @keyframes spin {
    from {
        rotate:0deg;
    }
    to {
        rotate:360deg;
    }
  }
  ha-card.state-on ha-icon {
    animation: spin 2s linear infinite;
  }
Gh61 commented

Resolved in the current Release.