-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tab.swift
30 lines (28 loc) · 959 Bytes
/
Tab.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import SwiftUI
import WebKit
struct Tab: View {
@State private var text = ""
@State private var progress = CGFloat(1)
@State private var url: URL?
var body: some View {
ZStack {
VStack {
Image(systemName: "eyeglasses")
.font(Font.largeTitle.bold())
Text("Title")
.font(.headline)
}.foregroundColor(.init(.quaternaryLabel))
VStack {
Progress(progress: progress)
.stroke(progress < 1 ? Color.pink : .clear,
style: .init(lineWidth: 4, lineCap: .round))
.frame(height: 4)
.cornerRadius(3)
.padding(.horizontal, 20)
Web(text: $text, url: $url, progress: $progress)
.opacity(text.isEmpty ? 0 : 1)
}
Tools(text: $text, url: $url)
}
}
}