|
|
@@ -1,113 +0,0 @@
|
|
|
-import SwiftUI
|
|
|
-
|
|
|
-struct BackgroundDecorations: View {
|
|
|
- // Proportions derived from the original 859×720 content-area layout.
|
|
|
- private enum Layout {
|
|
|
- static let topRightWaveSize = CGSize(width: 0.489, height: 0.444)
|
|
|
- static let topRightWaveCenter = CGPoint(x: 0.896, y: 0.222)
|
|
|
-
|
|
|
- static let bottomLeftWaveSize = CGSize(width: 0.442, height: 0.389)
|
|
|
- static let bottomLeftWaveCenter = CGPoint(x: 0.081, y: 0.861)
|
|
|
-
|
|
|
- static let bottomLeftDotsCenter = CGPoint(x: 0.034, y: 0.889)
|
|
|
- static let topRightDotsCenter = CGPoint(x: 1.012, y: 0.194)
|
|
|
- }
|
|
|
-
|
|
|
- var body: some View {
|
|
|
- GeometryReader { geometry in
|
|
|
- let width = geometry.size.width
|
|
|
- let height = geometry.size.height
|
|
|
-
|
|
|
- ZStack {
|
|
|
- AppTheme.background
|
|
|
-
|
|
|
- OrganicWave()
|
|
|
- .fill(AppTheme.blobColor)
|
|
|
- .frame(
|
|
|
- width: width * Layout.topRightWaveSize.width,
|
|
|
- height: height * Layout.topRightWaveSize.height
|
|
|
- )
|
|
|
- .position(
|
|
|
- x: width * Layout.topRightWaveCenter.x,
|
|
|
- y: height * Layout.topRightWaveCenter.y
|
|
|
- )
|
|
|
-
|
|
|
- OrganicWave()
|
|
|
- .fill(AppTheme.blobColor.opacity(0.85))
|
|
|
- .frame(
|
|
|
- width: width * Layout.bottomLeftWaveSize.width,
|
|
|
- height: height * Layout.bottomLeftWaveSize.height
|
|
|
- )
|
|
|
- .scaleEffect(x: -1, y: 1)
|
|
|
- .position(
|
|
|
- x: width * Layout.bottomLeftWaveCenter.x,
|
|
|
- y: height * Layout.bottomLeftWaveCenter.y
|
|
|
- )
|
|
|
-
|
|
|
- DotGrid()
|
|
|
- .position(
|
|
|
- x: width * Layout.bottomLeftDotsCenter.x,
|
|
|
- y: height * Layout.bottomLeftDotsCenter.y
|
|
|
- )
|
|
|
- .opacity(0.55)
|
|
|
-
|
|
|
- DotGrid()
|
|
|
- .position(
|
|
|
- x: width * Layout.topRightDotsCenter.x,
|
|
|
- y: height * Layout.topRightDotsCenter.y
|
|
|
- )
|
|
|
- .opacity(0.45)
|
|
|
- }
|
|
|
- }
|
|
|
- .frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
|
- .ignoresSafeArea()
|
|
|
- .clipped()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-private struct OrganicWave: Shape {
|
|
|
- func path(in rect: CGRect) -> Path {
|
|
|
- var path = Path()
|
|
|
- let w = rect.width
|
|
|
- let h = rect.height
|
|
|
-
|
|
|
- path.move(to: CGPoint(x: w * 0.1, y: h * 0.85))
|
|
|
- path.addCurve(
|
|
|
- to: CGPoint(x: w * 0.9, y: h * 0.15),
|
|
|
- control1: CGPoint(x: w * 0.05, y: h * 0.35),
|
|
|
- control2: CGPoint(x: w * 0.55, y: h * 0.0)
|
|
|
- )
|
|
|
- path.addCurve(
|
|
|
- to: CGPoint(x: w * 0.65, y: h * 0.95),
|
|
|
- control1: CGPoint(x: w * 1.1, y: h * 0.45),
|
|
|
- control2: CGPoint(x: w * 0.85, y: h * 1.05)
|
|
|
- )
|
|
|
- path.addCurve(
|
|
|
- to: CGPoint(x: w * 0.1, y: h * 0.85),
|
|
|
- control1: CGPoint(x: w * 0.35, y: h * 0.75),
|
|
|
- control2: CGPoint(x: w * 0.0, y: h * 1.0)
|
|
|
- )
|
|
|
- path.closeSubpath()
|
|
|
- return path
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-private struct DotGrid: View {
|
|
|
- private let columns = 5
|
|
|
- private let rows = 5
|
|
|
- private let spacing: CGFloat = 10
|
|
|
-
|
|
|
- var body: some View {
|
|
|
- VStack(spacing: spacing) {
|
|
|
- ForEach(0..<rows, id: \.self) { _ in
|
|
|
- HStack(spacing: spacing) {
|
|
|
- ForEach(0..<columns, id: \.self) { _ in
|
|
|
- Circle()
|
|
|
- .fill(AppTheme.dotColor)
|
|
|
- .frame(width: 4, height: 4)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|