Hi all,
I have made a widget to switch on and off a specific light.
In the developer tool, the whole widget can be ‘pressed’ as a button. However, on a pageview, only the space outside the icon can be pressed as a button. The icon itself is not part of the button anymore or the icon is ‘in front of’ the button…
YAML
uid: mirrorball-card
tags: []
props:
parameters:
- description: rgba or HEX
label: Background Color
name: bgcolor
required: false
type: TEXT
- context: item
description: Mirrorball on or off
label: Item
name: item_mirrorBall
required: false
type: TEXT
parameterGroups: []
timestamp: Dec 28, 2023, 8:37:17 PM
component: f7-card
config:
style:
noShadow: false
class:
- padding: 0px
border-radius: var(--f7-card-expandable-border-radius)
box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.1)
background-color: "=props.bgcolor ? props.bgcolor : ''"
height: 120px
width: 100px
margin-left: 5px
margin-right: 5px
slots:
content:
- component: f7-block
config:
stylesheet: >
.iconify--bi {
animation: mymove 4s linear 0s infinite;
} @keyframes mymove {
0% {color: red;}
12.5% {color: green;}
37.5% {color: blue;}
62.5% {color: yellow;}
87.5% {color: purple;}
100% {color: red;}
}
slots:
default:
- component: oh-icon
config:
icon: iconify:bi:globe
width: 60
style:
margin: auto
margin-left: 5px
filter: "='opacity(' + (items[props.item_mirrorBall].state == 'OFF' ? '40' : '100') + '%)'"
color: "=(items[props.item_mirrorBall].state) == 'OFF' ? 'white !important' : ''"
- component: oh-button
config:
action: toggle
actionItem: =props.item_mirrorBall
actionCommand: ON
actionCommandAlt: OFF
style:
position: absolute
left: 0px
top: 0px
height: 120px
width: 100%
Can someone please give me some advice? Thanks!