Chips are a little more complex (whether or not a conditional chip is used.) But in essence it would be done like this (nth-child(x)
being the number of the chip you are applying it to):
type: custom:mushroom-chips-card
alignment: center
chips:
- type: entity
entity: input_boolean.alarm_skip
icon: mdi:washing-machine
content_info: none
card_mod:
style:
mushroom-entity-chip:nth-child(1)$: |
ha-state-icon {
animation: shake 400ms ease-in-out infinite, drum 2s ease infinite;
transform-origin: 50% 110%;
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0); }
}
Or like this with a conditional chip:
type: custom:mushroom-chips-card
alignment: center
chips:
- type: conditional
conditions:
- condition: state
entity: input_boolean.alarm_skip
state: 'off'
chip:
type: entity
entity: person.dimitri_landerloos
icon: mdi:washing-machine
card_mod:
style:
mushroom-conditional-chip:nth-child(1):
mushroom-entity-chip$: |
ha-state-icon {
animation: shake 400ms ease-in-out infinite, drum 2s ease infinite;
transform-origin: 50% 110%;
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0); }
}