I’m trying to a widget that shows the value of Number item and toggles a Switch item. I accomplished mostly what I want, the only problem is that the value of the Number Item is behind the toggle. I’d like to move it to the bottom right corner of the card.
Code:
uid: Toggle_number
tags: []
props:
parameters:
- description: Small title on top of the card
label: Title
name: title
required: false
type: TEXT
- description: in rgba() or HEX or empty
label: Background Color
name: bgcolor
required: false
type: TEXT
- context: item
label: Number Item
name: number_item
required: false
type: TEXT
- context: item
label: Switch item
name: switch_item
required: true
type: TEXT
parameterGroups: []
timestamp: Jan 9, 2022, 4:45:55 AM
component: f7-card
config:
title: =props.title
background-color: "=props.bgcolor ? props.bgcolor : ''"
slots:
content:
- component: f7-row
config:
style:
height: calc(2 * var(--f7-toggle-width))
class: justify-content-center
slots:
default:
- component: oh-toggle
config:
item: =props.switch_item
class: large-vertical-toggle
- component: oh-trend
config:
trendItem: =props.number_item
style:
filter: opacity(30%)
height: calc(2 * var(--f7-toggle-width))
width: 100%
z-index: 1
position: absolute
- component: Label
config:
style:
position: absolute
align: right
text: "=items[props.number_item].displayState ? items[props.number_item].displayState : items[props.number_item].state"
What can I do to solve this? Thanks.