Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - type: custom:button-card
- name: Window
- entity: binary_sensor.window_office
- triggers_update:
- [
- 'binary_sensor.window_office',
- 'sensor.window_office_power',
- ]
- style:
- top: 60%
- left: 44%
- width: 10%
- tap_action:
- action: toggle
- custom_fields:
- icon_switch_entrance: >
- [[[ const state = entity.state === 'on' ? 'animate show' : 'hide'; const rev_state = entity.state === 'on' ? 'hide': 'animate show';
- return `<svg viewBox="0 0 24 24"><style>@keyframes animate{0%{transform: scale(0.85);}20%{transform: scale(1.1);}40%{transform: scale(0.95);}60%{transform: scale(1.03);}80%{transform: scale(0.97);}100%{transform: scale(1);}}.animate{animation: animate 0.8s; transform-origin: center;} .show {display: inherit;} .hide {display: none;}</style>
- <path class="${rev_state}" fill="#9da0a2" d="M21 20V2H3V20H1V23H23V20M19 4V11H13V4M5 4H11V11H5M5 20V13H11V20M13 20V13H19V20Z" />
- <path class="${state}" fill="var(--button-card-light-color-no-temperature)" d="M21 20V2H3V20H1V23H23V20M19 4V11H17V4M5 4H7V11H5M5 20V13H7V20M9 20V4H15V20M17 20V13H19V20Z"/></svg>`; ]]]
- styles:
- custom_fields:
- icon_switch_entrance:
- [
- top: 11%,
- left: 4.6%,
- width: 3.05vw,
- position: absolute,
- ]
- template: ['base']
Advertisement
Add Comment
Please, Sign In to add comment