Skip to content

Commit 1cdfe93

Browse files
committed
'programming reference' most pages done
1 parent 3a65c3a commit 1cdfe93

7 files changed

Lines changed: 266 additions & 115 deletions

File tree

practice.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
D44BA22F2B608CB000AA343B /* EndGameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44BA22E2B608CB000AA343B /* EndGameView.swift */; };
11+
D44BA2312B608D5100AA343B /* NotesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44BA2302B608D5100AA343B /* NotesView.swift */; };
12+
D44BA2332B609E1800AA343B /* FrontPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44BA2322B609E1800AA343B /* FrontPageView.swift */; };
1013
D47746572B5C861C00BE902A /* TeleopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47746562B5C861C00BE902A /* TeleopView.swift */; };
1114
D4B14F132B5C44A300CF2AE6 /* practiceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4B14F122B5C44A300CF2AE6 /* practiceApp.swift */; };
1215
D4B14F152B5C44A300CF2AE6 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4B14F142B5C44A300CF2AE6 /* ContentView.swift */; };
@@ -35,6 +38,9 @@
3538
/* End PBXContainerItemProxy section */
3639

3740
/* Begin PBXFileReference section */
41+
D44BA22E2B608CB000AA343B /* EndGameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndGameView.swift; sourceTree = "<group>"; };
42+
D44BA2302B608D5100AA343B /* NotesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotesView.swift; sourceTree = "<group>"; };
43+
D44BA2322B609E1800AA343B /* FrontPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontPageView.swift; sourceTree = "<group>"; };
3844
D47746562B5C861C00BE902A /* TeleopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeleopView.swift; sourceTree = "<group>"; };
3945
D4B14F0F2B5C44A300CF2AE6 /* practice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = practice.app; sourceTree = BUILT_PRODUCTS_DIR; };
4046
D4B14F122B5C44A300CF2AE6 /* practiceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = practiceApp.swift; sourceTree = "<group>"; };
@@ -97,8 +103,11 @@
97103
isa = PBXGroup;
98104
children = (
99105
D4B14F122B5C44A300CF2AE6 /* practiceApp.swift */,
106+
D44BA2322B609E1800AA343B /* FrontPageView.swift */,
100107
D4B14F142B5C44A300CF2AE6 /* ContentView.swift */,
101108
D47746562B5C861C00BE902A /* TeleopView.swift */,
109+
D44BA22E2B608CB000AA343B /* EndGameView.swift */,
110+
D44BA2302B608D5100AA343B /* NotesView.swift */,
102111
D4B14F162B5C44A700CF2AE6 /* Assets.xcassets */,
103112
D4B14F182B5C44A700CF2AE6 /* Preview Content */,
104113
);
@@ -260,9 +269,12 @@
260269
isa = PBXSourcesBuildPhase;
261270
buildActionMask = 2147483647;
262271
files = (
272+
D44BA22F2B608CB000AA343B /* EndGameView.swift in Sources */,
263273
D4B14F152B5C44A300CF2AE6 /* ContentView.swift in Sources */,
274+
D44BA2312B608D5100AA343B /* NotesView.swift in Sources */,
264275
D47746572B5C861C00BE902A /* TeleopView.swift in Sources */,
265276
D4B14F132B5C44A300CF2AE6 /* practiceApp.swift in Sources */,
277+
D44BA2332B609E1800AA343B /* FrontPageView.swift in Sources */,
266278
);
267279
runOnlyForDeploymentPostprocessing = 0;
268280
};

practice/ContentView.swift

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import SwiftUI
99

1010
let blueSpeaker = "blue speaker"
11-
let redSpeaker = "red speaker"
1211
let blueAmp = "blue amp"
12+
let redSpeaker = "red speaker"
1313
let redAmp = "red amp"
14+
let chain = "chain"
1415

1516
let backgroundGradient = LinearGradient(colors: [Color.blue, Color.white], startPoint: .top, endPoint: .bottom)
1617
struct ContentView: View {
@@ -19,68 +20,73 @@ struct ContentView: View {
1920
@State private var mobile = false;
2021
@State private var left = false;
2122
@State private var middle = false;
22-
@State private var move = false;
23+
@State private var move = true;
24+
@State private var jank = true;
2325
var body: some View {
24-
if !move {
25-
GeometryReader {geometry in
26-
ZStack {//could make an array
26+
if !jank{
27+
FrontPageView()
28+
}
29+
else{
30+
if !move{
31+
TeleopView()
32+
} else{
33+
GeometryReader {geometry in
34+
ZStack {//could make an array
2735
backgroundGradient
28-
VStack {
29-
Text("AUTONOMOUS").font(.title).fontWeight(.bold).font(.system(.largeTitle))
30-
HStack {
31-
VStack() {
32-
Text("SPEAKER").font(.title).fontWeight(.bold).font(.system(.largeTitle))
33-
Image(blueSpeaker).resizable().frame(width:318, height: 318).padding(.bottom, 10)
34-
Stepper {
35-
Text("\(value)")
36-
} onIncrement: {
37-
value += 1
38-
39-
} onDecrement: {
40-
if (value > 0) {
41-
value -= 1
42-
}
43-
}.frame(width:150)
36+
Image(systemName: "arrow.left").font(.title).offset(y: -60).fontWeight(.bold).frame(maxWidth:.infinity, maxHeight:.infinity, alignment:.topLeading).padding(.horizontal, 50).padding(.vertical, 100).onTapGesture {
37+
jank = false
38+
}
39+
VStack {
40+
Text("AUTONOMOUS").font(.title).fontWeight(.bold).font(.system(.largeTitle))
41+
HStack {
42+
VStack() {
43+
Text("SPEAKER").font(.title).fontWeight(.bold).font(.system(.largeTitle))
44+
Image(blueSpeaker).resizable().frame(width:318, height: 318).padding(.bottom, 10)
45+
Stepper {
46+
Text("\(value)")
47+
} onIncrement: {
48+
value += 1
49+
50+
} onDecrement: {
51+
if (value > 0) {
52+
value -= 1
53+
}
54+
}.frame(width:150)
55+
}
56+
.padding(10)
57+
VStack(spacing: 10) {
58+
Text("AMP").font(.title).fontWeight(.bold).font(.system(.largeTitle))
59+
Image(blueAmp).resizable().frame(width:318, height: 318).padding(.bottom, 10)
60+
Stepper {
61+
Text("\(amp)")
62+
} onIncrement: {
63+
amp += 1
64+
65+
} onDecrement: {
66+
if (amp > 0) {
67+
amp -= 1
68+
}
69+
}.frame(width:150)
70+
}
71+
.padding(10)
4472
}
45-
.padding(10)
46-
VStack(spacing: 10) {
47-
Text("AMP").font(.title).fontWeight(.bold).font(.system(.largeTitle))
48-
Image(blueAmp).resizable().frame(width:318, height: 318).padding(.bottom, 10)
49-
Stepper {
50-
Text("\(amp)")
51-
} onIncrement: {
52-
amp += 1
53-
54-
} onDecrement: {
55-
if (amp > 0) {
56-
amp -= 1
57-
}
58-
}.frame(width:150)
73+
HStack {
74+
75+
VStack {
76+
Toggle("Mobility: ", isOn: $mobile).frame(width:150)
77+
Toggle("Left Zone: ", isOn: $left).frame(width:150)
78+
Toggle("Middle Ring: ", isOn: $middle).frame(width:150)
79+
}
80+
5981
}
60-
.padding(10)
61-
}
62-
HStack {
63-
64-
VStack {
65-
Toggle("Mobility: ", isOn: $mobile).frame(width:150)
66-
Toggle("Left Zone: ", isOn: $left).frame(width:150)
67-
Toggle("Middle Ring: ", isOn: $middle).frame(width:150)
68-
}.offset(x:-1 * geometry.size.width/3)
6982

83+
Text("TO TELEOP").font(.title).fontWeight(.bold).onTapGesture {
84+
move = false;
85+
}
7086
}
71-
72-
Text("TO TELEOP").font(.title).fontWeight(.bold).onTapGesture {
73-
move = true;
74-
}
75-
76-
77-
7887
}
7988
}
80-
8189
}
82-
} else {
83-
TeleopView()
8490
}
8591
}
8692
}

practice/EndGameView.swift

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//
2+
// EndGameView.swift
3+
// practice
4+
//
5+
// Created by Celine Lou on 1/23/24.
6+
//
7+
8+
import SwiftUI
9+
10+
struct EndGameView: View {
11+
@State private var jank = true
12+
@State private var progref = true;
13+
@State private var selection = "Parked";
14+
@State private var trap = false;
15+
@State private var harmony = false;
16+
let positions = ["Parked", "Onstage", "None"];
17+
18+
var body: some View {
19+
//update loop reference
20+
if !jank {
21+
TeleopView()
22+
} else {
23+
if !progref {
24+
NotesView()
25+
} else {
26+
//code goes here
27+
GeometryReader {geometry in
28+
ZStack {//could make an array
29+
backgroundGradient
30+
VStack {
31+
ZStack {
32+
Text("END GAME").font(.title).fontWeight(.bold).font(.system(.largeTitle))
33+
Image(systemName: "arrow.left").font(.title).fontWeight(.bold).frame(maxWidth:.infinity, maxHeight:.infinity, alignment:.topLeading).padding(.horizontal, 50).padding(.vertical, 100).onTapGesture {
34+
jank = false
35+
}
36+
.font(.title).fontWeight(.bold).font(.system(.largeTitle)).offset(y: -20)
37+
}
38+
39+
HStack {
40+
VStack {
41+
Text("STAGE").font(.title2).fontWeight(.bold).font(.system(.largeTitle)).offset(x: -200, y: 50)
42+
Image(chain).resizable().frame(width:600, height: 500).padding(.bottom, 10)
43+
44+
}
45+
.padding(10)
46+
}.offset(y:-130)
47+
48+
HStack{
49+
VStack(spacing:20) {
50+
VStack{
51+
Picker("Select position", selection: $selection){
52+
ForEach(positions, id: \.self){
53+
Text($0)
54+
}
55+
}
56+
.pickerStyle(.menu)
57+
58+
Text("Selected position: \(selection)")
59+
60+
Toggle("Note in Trap?: ", isOn: $trap).frame(width:150).offset(y: 50)
61+
Toggle("Harmony?: ", isOn: $harmony).frame(width:150).offset(y: 50)
62+
}
63+
}
64+
}.offset(y: -300)
65+
66+
HStack {
67+
Text("TO NOTES").font(.title).fontWeight(.bold).onTapGesture {
68+
progref = false;
69+
}
70+
}.offset(y:-240)
71+
72+
}.offset(y:-50)
73+
}
74+
75+
}
76+
}
77+
}
78+
79+
}
80+
}
81+
82+
#Preview {
83+
EndGameView()
84+
}

practice/FrontPageView.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// FrontPageView.swift
3+
// practice
4+
//
5+
// Created by Celine Lou on 1/23/24.
6+
//
7+
8+
import SwiftUI
9+
10+
struct FrontPageView: View {
11+
@State private var moved = false;
12+
13+
var body: some View {
14+
if !moved{
15+
Text("Team Select").foregroundColor(.teal).bold().font(.largeTitle).offset(y: -200)
16+
HStack{
17+
Text("TO AUTON").font(.title).fontWeight(.bold).onTapGesture {
18+
moved = true;
19+
}
20+
}.offset(y: 300)
21+
}
22+
else{
23+
ContentView()
24+
}
25+
}
26+
}
27+
28+
#Preview {
29+
FrontPageView()
30+
}

practice/NotesView.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// NotesView.swift
3+
// practice
4+
//
5+
// Created by Celine Lou on 1/23/24.
6+
//
7+
8+
import SwiftUI
9+
10+
struct NotesView: View {
11+
var body: some View {
12+
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
13+
}
14+
}
15+
16+
#Preview {
17+
NotesView()
18+
}

0 commit comments

Comments
 (0)