Advertisement
fablav

Giorni a Natale

Nov 22nd, 2024
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.67 KB | Software | 0 0
  1. type: custom:stack-in-card
  2. cards:
  3.   - type: custom:mushroom-template-card
  4.     icon: mdi:pine-tree
  5.     icon_color: green
  6.     primary: |
  7.      {% set midnight = today_at() %}
  8.       {% set event = states('input_datetime.natale') | as_datetime | as_local %}
  9.       {% set delta = event - midnight %}
  10.       {% if delta.days == 0 %}
  11.         Oggi
  12.       {% elif delta.days == 1 %}
  13.         Domani
  14.       {% elif delta.days == 2 %}
  15.         Dopodomani
  16.       {% else %}
  17.         {{ delta.days }} giorni
  18.       {% endif %}
  19.     secondary: |
  20.      {% set midnight = today_at() %}
  21.       {% set event = states('input_datetime.natale') | as_datetime | as_local %}
  22.       {% set delta = event - midnight %}
  23.       {% if 0 <= delta.days <= 2 %}
  24.         é Natale
  25.       {% else %}
  26.         a Natale
  27.       {% endif %}
  28.     card_mod:
  29.       style: |
  30.        ha-card {
  31.           background: none !important;
  32.         }
  33.   - type: custom:mushroom-template-card
  34.     icon: mdi:star-four-points
  35.     icon_color: yellow
  36.     primary: Star
  37.     card_mod:
  38.       style:
  39.         mushroom-shape-icon$: |
  40.          .shape {
  41.             --shape-color: none;
  42.           }
  43.         .: |
  44.          ha-card {
  45.             background: none !important;
  46.             width: 66px;
  47.             top: -66px;
  48.           }
  49.           ha-state-icon {
  50.             animation: star 8s ease infinite alternate;
  51.           }
  52.           @keyframes star {
  53.             0%, 100% { transform: translateY(-10px) rotate(0deg) scale(0.4); }
  54.             50% { transform: translateY(-10px) rotate(360deg) scale(0.6); }
  55.           }
  56.   - type: custom:mushroom-template-card
  57.     icon: mdi:gift
  58.     icon_color: red
  59.     card_mod:
  60.       style:
  61.         mushroom-shape-icon$: |
  62.          .shape {
  63.             --shape-color: none;
  64.             --icon-size: 25px;
  65.             top: 22px;
  66.             left: 8px;
  67.           }
  68.         .: |
  69.          ha-card {
  70.             background: none !important;
  71.             width: 66px;
  72.             top: -132px;
  73.           }
  74.           ha-state-icon {
  75.             animation: surprise 4s ease infinite;
  76.           }
  77.           @keyframes surprise {
  78.             0%, 20%, 100% { transform: translateY(0); }
  79.             2.5% { transform: translateY(-2px) rotate(-27deg); }
  80.             5% { transform: translateY(-2px) rotate(21deg); }
  81.             7.5% { transform: translateY(-2px) rotate(-15deg); }
  82.             10% { transform: translateY(-2px) rotate(9deg); }
  83.             12.5% { transform: translateY(0); }
  84.             15% { transform: translateY(-1.2px) }
  85.           }
  86. card_mod:
  87.   style: |
  88.    ha-card {
  89.       height: 60px;
  90.       background: none !important;
  91.       border: 2px solid rgba(255, 69, 69, 1);
  92.     }
  93.  
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement