fredrik_persson_

Echo Show v2

Jul 4th, 2024
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 5.80 KB | None | 0 0
  1. type: custom:button-card
  2. entity: input_boolean.dummy_light1
  3. tap_action:
  4.   action: toggle
  5. show_name: false
  6. styles:
  7.   grid:
  8.     - grid-template-areas: '"weather alarm" "clock clock" "date date"'
  9.     - grid-template-rows: min-content 1fr min-content
  10.     - grid-template-columns: 1fr 1fr
  11.     - row-gap: .25rem
  12.   card:
  13.     - height: 100%
  14.     - padding: 1.5rem
  15.     - background: center / cover no-repeat url(/local/images/album-art.jpg)
  16.     - overflow: hidden
  17.   custom_fields:
  18.     filter1:
  19.       - position: absolute
  20.       - height: 150%
  21.       - width: 150%
  22.       - backdrop-filter: brightness(50%)
  23.       - overflow: hidden
  24.       - z-index: 1
  25.     filter2:
  26.       - position: absolute
  27.       - height: 150%
  28.       - width: 150%
  29.       - overflow: hidden
  30.       - z-index: 3
  31.     weather:
  32.       - justify-self: start
  33.       - z-index: 2
  34.     alarm:
  35.       - justify-self: end
  36.       - z-index: 2
  37.     clock:
  38.       - color: white
  39.       - justify-self: center
  40.       - align-self: center
  41.       - z-index: 2
  42.     date:
  43.       - justify-self: center
  44.       - align-self: center
  45.       - z-index: 2
  46.     assistant:
  47.       - position: absolute
  48.       - justify-self: center
  49.       - z-index: 4
  50. state:
  51.   - value: 'on'
  52.     styles:
  53.       custom_fields:
  54.         filter2:
  55.           - animation: brightness_down .5s ease-in-out forwards
  56.         assistant:
  57.           - animation: slide_up .5s ease-in-out forwards
  58.   - value: 'off'
  59.     styles:
  60.       custom_fields:
  61.         filter2:
  62.           - animation: brightness_up .5s ease-in-out forwards
  63.         assistant:
  64.           - animation: opacity .5s ease-in-out forwards
  65. extra_styles: |
  66.  @keyframes slide_up {
  67.     0% {
  68.       bottom: 5%;
  69.       opacity: 0;
  70.     }
  71.     100% {
  72.       bottom: 50%;
  73.     }
  74.   }
  75.   @keyframes opacity {
  76.     0% {
  77.       opacity: 1;
  78.     }
  79.     100% {
  80.       opacity: 0;
  81.     }
  82.   }
  83.   @keyframes brightness_down {
  84.     0% {
  85.       backdrop-filter: brightness(100%);
  86.     }
  87.     100% {
  88.       backdrop-filter: brightness(50%);
  89.     }
  90.   }
  91.  
  92.   @keyframes brightness_up {
  93.     0% {
  94.       backdrop-filter: brightness(50%);
  95.     }
  96.     100% {
  97.       backdrop-filter: brightness(100%);
  98.     }
  99.   }
  100. custom_fields:
  101.   filter1: .
  102.   weather:
  103.     card:
  104.       type: custom:button-card
  105.       show_name: true
  106.       show_icon: true
  107.       icon: fas:sun
  108.       name: |
  109.        [[[
  110.           return states["weather.home"].attributes.temperature + ' °C'
  111.         ]]]
  112.       styles:
  113.         grid:
  114.           - grid-template-areas: '"i n"'
  115.           - grid-template-columns: 1fr min-content
  116.           - column-gap: .5rem
  117.         card:
  118.           - height: 100%
  119.           - padding: 0
  120.           - background: none
  121.         name:
  122.           - color: white
  123.           - justify-self: center
  124.           - align-self: center
  125.           - font-size: 1.75rem
  126.           - font-weight: 600
  127.         img_cell:
  128.           - justify-self: start
  129.           - align-self: center
  130.           - width: 1.25rem
  131.           - height: 1.25rem
  132.         icon:
  133.           - width: 100%
  134.           - color: white
  135.   alarm:
  136.     card:
  137.       type: custom:button-card
  138.       show_name: true
  139.       show_icon: true
  140.       icon: fas:clock
  141.       name: 6:00 AM
  142.       styles:
  143.         grid:
  144.           - grid-template-areas: '"i n"'
  145.           - grid-template-columns: 1fr min-content
  146.           - column-gap: .5rem
  147.         card:
  148.           - height: 100%
  149.           - padding: 0
  150.           - background: none
  151.         name:
  152.           - color: white
  153.           - justify-self: center
  154.           - align-self: center
  155.           - font-size: 1.75rem
  156.           - font-weight: 600
  157.         img_cell:
  158.           - justify-self: start
  159.           - align-self: center
  160.           - width: 1.25rem
  161.           - height: 1.25rem
  162.         icon:
  163.           - width: 100%
  164.           - color: white
  165.   clock:
  166.     card:
  167.       type: custom:button-card
  168.       show_name: true
  169.       name: '[[[ return states["sensor.time"].state ]]]'
  170.       styles:
  171.         card:
  172.           - height: 100%
  173.           - padding: .25rem 0
  174.           - background: none
  175.         name:
  176.           - color: white
  177.           - justify-self: center
  178.           - align-self: center
  179.           - font-size: 7.75rem
  180.           - font-weight: 600
  181.   date:
  182.     card:
  183.       type: custom:button-card
  184.       show_name: true
  185.       name: |
  186.        [[[
  187.           const options = { weekday: "long", month: "short", day: "numeric", };
  188.           return new Date().toLocaleDateString([], options)
  189.         ]]]  
  190.       styles:
  191.         card:
  192.           - padding: 0
  193.           - background: none
  194.         name:
  195.           - color: white
  196.           - justify-self: center
  197.           - align-self: center
  198.           - font-size: 1.75rem
  199.           - font-weight: 600
  200.   filter2: .
  201.   assistant:
  202.     card:
  203.       type: custom:button-card
  204.       entity: input_boolean.dummy_light1
  205.       name: What can I do for you?
  206.       show_icon: false
  207.       tap_action:
  208.         action: none
  209.       styles:
  210.         card:
  211.           - height: .25rem
  212.           - width: 4rem
  213.           - border-radius: 500px
  214.           - padding: 0
  215.           - background: white
  216.           - transform: translate(0%, 50%)
  217.         name:
  218.           - opacity: 0
  219.       state:
  220.         - value: 'on'
  221.           styles:
  222.             card:
  223.               - animation: expand .5s ease-in-out forwards
  224.               - animation-delay: .75s
  225.             name:
  226.               - animation: opacity .75s ease-in-out forwards
  227.               - animation-delay: 1s
  228.       extra_styles: |
  229.        @keyframes expand {
  230.           0%{
  231.             height: .25rem;
  232.             width: 4rem;
  233.  
  234.           }
  235.           100% {
  236.             height: 3.25rem;
  237.             width: 16rem;
  238.           }
  239.         }
  240.         @keyframes opacity {
  241.           0%{
  242.             opacity: 0;
  243.           }
  244.           100% {
  245.             opacity: 1;
  246.           }
  247.         }
  248.  
Advertisement
Add Comment
Please, Sign In to add comment