-
Notifications
You must be signed in to change notification settings - Fork 0
/
NavigationView.swift
43 lines (38 loc) · 1.58 KB
/
NavigationView.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
31
32
33
34
35
36
37
38
39
40
41
42
43
import SwiftUI
struct NavigationView: View {
@State var pageIntro = true
@State var pageCipher = false
@State var pageDiffie = false
@State var pageQuantum = false
@State var pageFinish = false
@State var publicKeyColor: Color = .white
@State var secretKeyColor: Color = .white
var body: some View {
ZStack {
if pageIntro {
IntroView(pageIntro: $pageIntro, pageCipher: $pageCipher).transition(.pushForStart)
}
if pageCipher {
CipherView(pageCipher: $pageCipher, pageDiffie: $pageDiffie).transition(.pushFromRight)
}
if pageDiffie {
DiffieHellmanView(pageDiffie: $pageDiffie, pageQuantum: $pageQuantum, publicKeyColor: $publicKeyColor, secretKeyColor: $secretKeyColor).transition(.pushFromRight)
}
if pageQuantum {
QuantumView(pageQuantum: $pageQuantum, pageFinish: $pageFinish, publicKeyColor: $publicKeyColor, secretKeyColor: $secretKeyColor).transition(.pushFromRight)
}
if pageFinish {
FinishView(pageFinish: $pageFinish, pageIntro: $pageIntro).transition(.pushForEnding)
}
}.animation(.default, value: pageIntro)
.animation(.default, value: pageCipher)
.animation(.default, value: pageDiffie)
.animation(.default, value: pageQuantum)
.animation(.default, value: pageFinish)
}
}
struct NavigationView_Previews: PreviewProvider {
static var previews: some View {
NavigationView()
}
}