Update weather

This commit is contained in:
Garth Vander Houwen 2024-08-23 19:12:07 -07:00
parent cecdd77a05
commit 948d40e825

View file

@ -95,12 +95,20 @@ struct WeatherConditionsCompactWidget: View {
let description: String
var body: some View {
VStack(alignment: .leading) {
Label { Text(description) } icon: { Image(systemName: symbolName).symbolRenderingMode(.multicolor) }
.font(.caption)
HStack(spacing: 5.0) {
Image(systemName: symbolName)
.foregroundColor(.accentColor)
.font(.callout)
Text(description)
.lineLimit(2)
.allowsTightening(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/)
.fixedSize(horizontal: false, vertical: true)
.font(.caption)
}
Text(temperature)
.font(temperature.length < 4 ? .system(size: 80) : .system(size: 60) )
.font(temperature.length < 4 ? .system(size: 76) : .system(size: 60) )
}
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150)
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140)
.padding()
.background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous))
}
@ -111,17 +119,23 @@ struct HumidityCompactWidget: View {
let dewPoint: String
var body: some View {
VStack(alignment: .leading) {
Label { Text("HUMIDITY") } icon: { Image(systemName: "humidity").symbolRenderingMode(.multicolor) }
.font(.caption)
HStack(spacing: 5.0) {
Image(systemName: "humidity")
.foregroundColor(.accentColor)
.font(.callout)
Text("HUMIDITY")
.font(.caption)
}
Text("\(humidity)%")
.font(.largeTitle)
.padding(.bottom)
.padding(.bottom, 5)
Text("The dew point is \(dewPoint) right now.")
.lineLimit(3)
.allowsTightening(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/)
.fixedSize(horizontal: false, vertical: true)
.font(.caption)
.font(.caption2)
}
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150)
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140)
.padding()
.background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous))
}
@ -133,15 +147,20 @@ struct PressureCompactWidget: View {
let low: Bool
var body: some View {
VStack(alignment: .leading) {
Label { Text("PRESSURE") } icon: { Image(systemName: "gauge").symbolRenderingMode(.multicolor) }
.font(.caption)
HStack(spacing: 5.0) {
Image(systemName: "gauge")
.foregroundColor(.accentColor)
.font(.callout)
Text("PRESSURE")
.font(.caption)
}
Text(pressure)
.font(pressure.length < 7 ? .system(size: 35) : .system(size: 30) )
Text(low ? "LOW" : "HIGH")
.padding(.bottom)
.padding(.bottom, 10)
Text(unit)
}
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150)
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140)
.padding()
.background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous))
}
@ -163,7 +182,7 @@ struct WindCompactWidget: View {
Text("Gusts \(gust)")
}
}
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150)
.frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140)
.padding()
.background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous))
}