added base homescreen-widget setup, working on Android, iOS in progress
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Marianum-M peeking out of the bottom-right corner. Sized to the longer
|
||||
/// widget edge so it scales with resize; offset nudges a sliver behind the
|
||||
/// edge.
|
||||
struct MarianumWatermark: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
let markSize = min(400, max(160, max(geo.size.width, geo.size.height) * 0.8))
|
||||
let offsetX = markSize * 0.18
|
||||
let offsetY = markSize * 0.18
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
Color.clear
|
||||
Image("marianum_m")
|
||||
.resizable()
|
||||
.renderingMode(.template)
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.foregroundStyle(.primary)
|
||||
.frame(width: markSize, height: markSize)
|
||||
.opacity(colorScheme == .dark ? 0.025 : 0.014)
|
||||
.offset(x: offsetX, y: offsetY)
|
||||
}
|
||||
}
|
||||
.clipped()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user