Advertisement
fablav

Deviatore ambra con animazioni acceso spento

Mar 4th, 2024
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.70 KB | Software | 0 0
  1. type: custom:mushroom-template-card
  2. entity: switch.caricacellulare
  3. icon: |
  4.  {% if is_state (config.entity, 'on') %}
  5.    mdi:toggle-switch
  6.   {% else %}
  7.    mdi:toggle-switch-off
  8.   {% endif %}
  9. icon_color: |
  10.  {% if is_state (config.entity, 'on') %}
  11.    amber
  12.   {% else %}
  13.    disabled
  14.   {% endif %}
  15. primary: |
  16.  {% if is_state (config.entity, 'on') %}
  17.    Deviatore acceso
  18.   {% else %}
  19.    Deviatore spento
  20.   {% endif %}
  21. tap_action:
  22.   action: toggle
  23. secondary: |
  24.  {% if is_state (config.entity, 'on') %}
  25.    destra
  26.   {% else %}
  27.    sinistra
  28.   {% endif %}
  29. card_mod:
  30.   style:
  31.     mushroom-state-info$: |
  32.      .primary {
  33.         padding-left: 10px;
  34.         font-family: cursive;
  35.         --card-primary-font-size: 22px;
  36.       }
  37.       .secondary {
  38.         padding-left: 10px;
  39.         font-family: cursive;
  40.         font-weight: 300;
  41.         --card-secondary-font-size: 18px;
  42.       }
  43.     .: |
  44.      ha-state-icon {
  45.         animation:  {{ 'pulse 2s ease-in-out infinite;' if not is_state('switch.caricacellulare', 'on') }};
  46.       }
  47.       ha-card {
  48.         background: {{ 'rgba(var(--rgb-amber), 0.3); --card-primary-color: white; --card-secondary-color:white; ' if is_state('switch.caricacellulare', 'on')}};
  49.         animation: {{ 'ping 2s ease-out infinite;' if is_state('switch.caricacellulare', 'on')}};
  50.         transform: scale(1);
  51.       }
  52.       @keyframes ping {
  53.         0% {
  54.           box-shadow: 0 0 5px 1px rgba(var(--rgb-amber), 1);
  55.         }
  56.         100% {
  57.           box-shadow: 0 0 5px 10px rgba(var(--rgb-amber), 0);
  58.         }
  59.       }
  60.       ha-card:active {
  61.         transform: translateY(1.5px);
  62.         transition: 0s;
  63.         box-shadow: 0 0.5px 2px 0 rgba(0, 0, 0, 0.16);
  64.       }
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement