Hi all,
I have “tinkered together” a Moonphase-Widget, but I have problems with the text alignment
Yaml:
uid: z_test_moonphasees_v0.0
tags:
- Anfängerspielerei
- Mondphasen
- https://www.rapidtables.com/web/css/css-color.html#red -- CSS-Colors
- peter-pan
props:
parameters:
- description: Uni-Farbe z.B. green or blue or yellow (default - orangered)
label: Text-Farbe
name: textcolor1
required: false
type: TEXT
timestamp: Jul 16, 2022, 1:07:32 PM
component: f7-card
config:
style:
background-image: ="linear-gradient(rgba(0,191,255,0.3), rgba(70,130,180,0.4)), url(/static/picture/mond3_orbit.jpg)"
background-position: center center
background-repeat: no-repeat
background-size: cover
border-radius: var(--f7-card-expandable-border-radius)
font-size: medium
height: auto
margin: 5px
noShadow: true
padding: 0px
slots:
content:
- component: f7-card-header
config:
style:
color: silver
font-size: 18px
justify-content: flex-end
margin-top: -15px
min-height: 20px
padding: 10px
slots:
default:
- component: Label
config:
style:
left: 40px
margin-left: 20px
position: absolute
text: Mondphasen
- component: Label
config:
text: Datum
- component: Label
config:
style:
margin-left: 20px
margin-right: -5px
text: Uhrzeit
- component: f7-card-content
config:
style:
color: green
font-size: 18px
justify-content: flex-start
margin-top: 5px
padding: 0px
width: 100%
slots:
default:
- component: f7-row
config:
style:
color: '=(props.textcolor1) ? props.textcolor1 : "orangered"'
display: true
height: 55px
justify-content: flex-end
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-start
left: 0px
position: absolute
slots:
default:
- component: oh-icon
config:
height: 35px
icon: moon
- component: Label
config:
style:
margin-left: 15px
white-space: nowrap
text: Neumond
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-end
left: 0px
position: absolute
slots: {}
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.New_moon.state).add(-0,"hour").add(0,"minute").format("dd, DD.MM")
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.New_moon.state).add(-0,"hour").add(0,"minute").format("HH:mm ") + " Uhr "
- component: f7-row
config:
style:
color: '=(props.textcolor1) ? props.textcolor1 : "orangered"'
display: true
height: 55px
justify-content: flex-end
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-start
left: 0px
position: absolute
slots:
default:
- component: oh-icon
config:
height: 35px
icon: moon3_first
- component: Label
config:
style:
margin-left: 15px
white-space: nowrap
text: ="zunehmender Mond"
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-end
slots: {}
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.First_quarter.state).add(-0,"hour").add(0,"minute").format("dd, DD.MM")
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.First_quarter.state).add(-0,"hour").add(0,"minute").format("HH:mm ") + " Uhr "
- component: f7-row
config:
style:
color: '=(props.textcolor1) ? props.textcolor1 : "orangered"'
display: true
height: 55px
justify-content: flex-end
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-start
left: 0px
position: absolute
slots:
default:
- component: oh-icon
config:
height: 35px
icon: moon3_full
- component: Label
config:
style:
margin-left: 15px
white-space: nowrap
text: ="Vollmond"
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-end
slots: {}
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.Full_moon.state).add(-0,"hour").add(0,"minute").format("dd, DD.MM")
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.Full_moon.state).add(-0,"hour").add(0,"minute").format("HH:mm ") + " Uhr "
- component: f7-row
config:
style:
color: '=(props.textcolor1) ? props.textcolor1 : "orangered"'
display: true
height: 55px
justify-content: flex-end
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-start
left: 0px
position: absolute
slots:
default:
- component: oh-icon
config:
height: 35px
icon: moon3_third
- component: Label
config:
style:
margin-left: 15px
white-space: nowrap
text: ="abnehmender Mond"
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-end
slots: {}
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.Third_quarter.state).add(-0,"hour").add(0,"minute").format("dd, DD.MM")
- component: Label
config:
style:
margin-left: 10px
text: =dayjs(items.Third_quarter.state).add(-0,"hour").add(0,"minute").format("HH:mm ") + " Uhr "
- component: f7-row
config:
style:
color: '=(props.textcolor1) ? props.textcolor1 : "orangered"'
display: true
height: 55px
justify-content: flex-end
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-start
left: 0px
position: absolute
slots:
default:
- component: oh-icon
config:
height: 50px
icon: orbit
- component: Label
config:
style:
margin-left: 5px
white-space: nowrap
text: ="aktuelle Entfernung zum Mond"
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: flex-end
position: absolute
slots: {}
- component: Label
config:
style:
margin-left: 10px
text: =Number.parseInt(items.Kilometer_distance.state).toLocaleString() + ' km'
Thx in advance for every hint or a solution
Cheers,
Peter