Hi @rhysb, could you please guide me on how to apply an icon animation and remove the ha-card-border? I have attempted to do so, but when I apply the āāha-card-border-width: 0;ā property, it also removes the icon animation. Thank you in advance.
type: custom:stack-in-card
mode: horizontal
cards:
- type: custom:mushroom-template-card
primary: Master
secondary: |-
{% if is_state('binary_sensor.nest_protect_master', 'off') %}
Clear
{% else %}
Detected - {{ as_timestamp(states.binary_sensor.nest_protect_master.last_changed) | timestamp_custom('%-I:%M %p') }}
{% endif %}
icon: mdi:smoke-detector
icon_color: >-
{{ 'blue' if is_state('binary_sensor.nest_protect_master', 'on') else
'disabled' }}
entity: binary_sensor.nest_protect_master
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
card_mod:
style:
mushroom-shape-icon$: |
.shape {
{% if is_state('binary_sensor.nest_protect_master', 'on') %}
--shape-animation: ping 2s infinite;
{% endif %}
}
@keyframes ping {
0% {
box-shadow: 0 0 5px 1px rgba(var(--rgb-blue), 0.7);
}
100% {
box-shadow: 0 0 5px 15px transparent;
}
}
- type: custom:mushroom-chips-card
chips:
- type: entity
entity: binary_sensor.master
icon_color: red
icon: mdi:fire
content_info: none
tap_action:
action: toggle
card_mod:
style: |
ha-card {
--chip-background: {{ 'rgba(var(--rgb-red),0.2)' if is_state(config.entity, 'on') else 'rgba(var(--rgb-primary-text-color), 0.05)' }};
--icon-color: rgb(var({{ '--rgb-red' if is_state(config.entity, 'on') else '--rgb-white' }}));
--chip-border-width: 0;
}
.content {
{% if is_state(config.entity, 'on') %}
animation: fire 1.5s infinite;
transform-origin: 50% 85%;
{% endif %}
}
@keyframes fire {
0% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
5% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
10% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
15% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
20% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
25% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
30% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
35% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
40% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
45% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
50% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
55% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
60% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
65% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
70% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
75% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
80% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
85% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
90% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
95% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-red)); opacity: {{range(7, 10) | random / 10}}; }
100% { transform: rotate({{range(-20, 20) | random / 10}}deg) scaleY({{range(9, 12) | random / 10}}); color: rgb(var(--rgb-deep-orange)); opacity: {{range(7, 10) | random / 10}}; }
}
- type: entity
entity: binary_sensor.master_2
icon_color: orange
icon: mdi:gas-cylinder
content_info: none
tap_action:
action: toggle
card_mod:
style: |
ha-card {
--chip-background: {{ 'rgba(var(--rgb-orange),0.2)' if is_state(config.entity, 'on') else 'rgba(var(--rgb-primary-text-color), 0.05)' }};
--icon-color: rgb(var({{ '--rgb-orange' if is_state(config.entity, 'on') else '--rgb-white' }}));
--chip-border-width: 0;
}
.content {
{% if is_state(config.entity, 'on') %}
animation: shake 400ms ease-in-out infinite;
transform-origin: 50% 90%;
clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%, 0 75%, 33% 62%);
{% endif %}
transform-origin: 50% 90%;
}
@keyframes shake {
0%, 100% { transform: rotate(3deg); }
50% { transform: rotate(-3deg); }
}
- type: entity
entity: binary_sensor.master_3
icon_color: green
icon: mdi:motion-sensor
content_info: none
tap_action:
action: toggle
card_mod:
style: |
ha-card {
--chip-background: {{ 'rgba(var(--rgb-green),0.2)' if is_state(config.entity, 'on') else 'rgba(var(--rgb-primary-text-color), 0.05)' }};
--icon-color: rgb(var({{ '--rgb-green' if is_state(config.entity, 'on') else '--rgb-white' }}));
--chip-border-width: 0;
}
.content {
{% if is_state(config.entity, 'on') %}
animation: beat 1.3s ease-out infinite both;
transform-origin: 50% 60%;
{% endif %}
}
@keyframes beat {
0% { transform: scale(1); }
10% { transform: scale(1.1); }
17% { transform: scale(1.05); }
33% { transform: scale(1.25); }
60% { transform: scale(1); }
}
card_mod:
style: |
ha-card {
--chip-box-shadow: none;
top: 16px;
width: -webkit-fill-available;
right: 12px;
position: absolute;
}
.chip-container {
right: 0px;
position: absolute;
}