Download this file
| 1 | import SwiftUI |
| 2 | |
| 3 | // đŸ¤– The veil a webview surface wears while its page boots — an opaque, |
| 4 | // theme-matched pane with a quiet spinner, so a loading app reads as |
| 5 | // "loading" instead of a blank white rectangle. Hosts overlay it until the |
| 6 | // page posts {ready:true} (shell.js bootEmbed) or navigation settles. |
| 7 | public struct WebLoadingVeil: View { |
| 8 | public init() {} |
| 9 | |
| 10 | public var body: some View { |
| 11 | ZStack { |
| 12 | #if os(macOS) |
| 13 | Color(nsColor: .textBackgroundColor) |
| 14 | #else |
| 15 | Color(uiColor: .systemBackground) |
| 16 | #endif |
| 17 | VStack(spacing: 10) { |
| 18 | ProgressView() |
| 19 | Text("Loading…") |
| 20 | .font(.footnote) |
| 21 | .foregroundStyle(.secondary) |
| 22 | } |
| 23 | } |
| 24 | .accessibilityLabel("Loading") |
| 25 | } |
| 26 | } |
| 27 | |