lawrencehead

animated-mushroom-chip

Jul 6th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. - type: custom:mushroom-chips-card
  2. chips:
  3. - type: template
  4. entity: sensor.garage_power_power
  5. icon_color: |
  6. {% if states(entity) | int(0) < 500 %}
  7. green
  8. {% elif states(entity) | int(0) < 1000 %}
  9. orange
  10. {% else %}
  11. red
  12. {% endif %}
  13. icon: mdi:lightning-bolt
  14. content: '{{ states(entity) | int(0) ~ ''W'' }}'
  15. tap_action:
  16. action: navigate
  17. navigation_path: ./power
  18. card_mod:
  19. style:
  20. mushroom-template-chip:nth-child(1)$: |
  21. ha-state-icon {
  22. {% set power = states('sensor.garage_power_power') | int(0) %}
  23. {% if power >= 500 and power < 1000 %}
  24. animation: shake 600ms ease-in-out infinite;
  25. transform-origin: 50% 110%;
  26. {% elif power >= 1000 %}
  27. animation: shake 300ms ease-in-out infinite;
  28. transform-origin: 50% 110%;
  29. {% endif %}
  30. }
  31. @keyframes shake {
  32. 0%, 100% { transform: translate(0, 0) rotate(0); }
  33. 20% { transform: translate(1.4px, -1.4px) rotate(-8deg); }
  34. 40% { transform: translate(-1.4px, 1.4px) rotate(8deg); }
  35. 60% { transform: translate(1.4px, 1.4px) rotate(-8deg); }
  36. 80% { transform: translate(-1.4px, -1.4px) rotate(8deg); }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment