diff --git a/smartClass.xcodeproj/project.pbxproj b/smartClass.xcodeproj/project.pbxproj index 16ead9d..a659135 100644 --- a/smartClass.xcodeproj/project.pbxproj +++ b/smartClass.xcodeproj/project.pbxproj @@ -15,6 +15,9 @@ A8700E052A1DDC2A00D60253 /* FontManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E042A1DDC2A00D60253 /* FontManager.swift */; }; A8700E082A1DDC6100D60253 /* CustomFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E072A1DDC6100D60253 /* CustomFont.swift */; }; A8700E0B2A1DDCAD00D60253 /* View.ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E0A2A1DDCAD00D60253 /* View.ext.swift */; }; + BE3B01C32A23CBEC008C1073 /* TimetableCardFull.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE3B01C22A23CBEC008C1073 /* TimetableCardFull.swift */; }; + BEA6EBD32A1FC3C000F28AE1 /* TimetableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEA6EBD22A1FC3C000F28AE1 /* TimetableView.swift */; }; + BEA6EBD52A1FC46400F28AE1 /* TimetableCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEA6EBD42A1FC46400F28AE1 /* TimetableCard.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -28,6 +31,9 @@ A8700E042A1DDC2A00D60253 /* FontManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontManager.swift; sourceTree = ""; }; A8700E072A1DDC6100D60253 /* CustomFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFont.swift; sourceTree = ""; }; A8700E0A2A1DDCAD00D60253 /* View.ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.ext.swift; sourceTree = ""; }; + BE3B01C22A23CBEC008C1073 /* TimetableCardFull.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimetableCardFull.swift; sourceTree = ""; }; + BEA6EBD22A1FC3C000F28AE1 /* TimetableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimetableView.swift; sourceTree = ""; }; + BEA6EBD42A1FC46400F28AE1 /* TimetableCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimetableCard.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,6 +66,7 @@ A8700DF12A1DDAD500D60253 /* smartClass */ = { isa = PBXGroup; children = ( + BEA6EBD12A1FC3AA00F28AE1 /* Timetable */, A8700E092A1DDC9D00D60253 /* Extension */, A8700E062A1DDC4900D60253 /* Modifiers */, A8700E032A1DDBFC00D60253 /* Info.plist */, @@ -105,6 +112,16 @@ path = Extension; sourceTree = ""; }; + BEA6EBD12A1FC3AA00F28AE1 /* Timetable */ = { + isa = PBXGroup; + children = ( + BEA6EBD22A1FC3C000F28AE1 /* TimetableView.swift */, + BEA6EBD42A1FC46400F28AE1 /* TimetableCard.swift */, + BE3B01C22A23CBEC008C1073 /* TimetableCardFull.swift */, + ); + path = Timetable; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -180,6 +197,9 @@ A8700E082A1DDC6100D60253 /* CustomFont.swift in Sources */, A8700E052A1DDC2A00D60253 /* FontManager.swift in Sources */, A8700DF32A1DDAD500D60253 /* smartClassApp.swift in Sources */, + BEA6EBD52A1FC46400F28AE1 /* TimetableCard.swift in Sources */, + BEA6EBD32A1FC3C000F28AE1 /* TimetableView.swift in Sources */, + BE3B01C32A23CBEC008C1073 /* TimetableCardFull.swift in Sources */, A8700E0B2A1DDCAD00D60253 /* View.ext.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json new file mode 100644 index 0000000..00f7d3b --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json new file mode 100644 index 0000000..d4464c6 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.914", + "green" : "0.424", + "red" : "0.231" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json new file mode 100644 index 0000000..0952145 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.690", + "green" : "0.690", + "red" : "0.690" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/Contents.json b/smartClass/Assets.xcassets/Timetable colors/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json new file mode 100644 index 0000000..5ab569d --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.408", + "green" : "0.408", + "red" : "0.408" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/Contents.json b/smartClass/Assets.xcassets/Timetable icons/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json new file mode 100644 index 0000000..2f82bba --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 14.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png new file mode 100644 index 0000000..931fcac Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json new file mode 100644 index 0000000..b80b68c --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 16.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png new file mode 100644 index 0000000..f25a9ef Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json new file mode 100644 index 0000000..240ed4f --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 15-2.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png new file mode 100644 index 0000000..bb19bc1 Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json new file mode 100644 index 0000000..bed3b81 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Group 107.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png new file mode 100644 index 0000000..2aec536 Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json new file mode 100644 index 0000000..04f5328 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Rectangle 113.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png new file mode 100644 index 0000000..a4a900f Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png differ diff --git a/smartClass/Timetable/TimetableCard.swift b/smartClass/Timetable/TimetableCard.swift new file mode 100644 index 0000000..7636c1d --- /dev/null +++ b/smartClass/Timetable/TimetableCard.swift @@ -0,0 +1,74 @@ +// +// TimetableCard.swift +// smartClass +// +// Created by artemiithefrog on 25.05.2023. +// + +import SwiftUI + +struct TimetableCard: View { + + private var lesson = "Основы программирования" + private var lessonTime = "17:00 - 18:30" + var buildingNumber = 9 + private var audienceNumber = 201 + + var body: some View { + VStack(alignment: .leading) { + HStack { + Text("\(lesson)") + .customFont(font: FontManager.Nunito.bold, size: 16) + .padding(.top, 19) + .padding(.leading, 25) + Spacer() + NavigationLink(destination: TimetableCardFull()) { + Image("arrowIconRight") + .resizable() + .frame(width: 17, height: 17) + .padding(.top, 20) + .padding(.trailing, 25) + }.navigationTitle(Text("")) + } + Text("\(lessonTime)") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color("BlueColor")) + .cornerRadius(12) + .padding(.leading, 25) + HStack { + Image("buildingIcon") + .resizable() + .frame(width: 16, height: 16) + .padding(.leading, 25) + Text("корпус: ") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(Color("TextGrayColor")) + Text("\(buildingNumber)") + .customFont(font: FontManager.Nunito.regular, size: 14) + .padding(.leading, -8) + Image("audienceIcon") + .resizable() + .frame(width: 16, height: 16) + .padding(.leading, 25) + Text("аудитория: ") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(Color("TextGrayColor")) + Text("\(audienceNumber)") + .customFont(font: FontManager.Nunito.regular, size: 14) + .padding(.leading, -8) + } + .padding(.bottom, 33) + } + .background(Color("BackgroundGrayColor")) + .cornerRadius(20) + .tint(Color.black) + } +} + +struct TimetableCard_Previews: PreviewProvider { + static var previews: some View { + TimetableCard() + } +} diff --git a/smartClass/Timetable/TimetableCardFull.swift b/smartClass/Timetable/TimetableCardFull.swift new file mode 100644 index 0000000..1ba178d --- /dev/null +++ b/smartClass/Timetable/TimetableCardFull.swift @@ -0,0 +1,124 @@ +// +// TimetableCardFull.swift +// smartClass +// +// Created by artemiithefrog on 28.05.2023. +// + +import SwiftUI + +struct TimetableCardFull: View { + + private var currentdate = "18 мая" + + var body: some View { + NavigationView { + VStack(alignment: .leading) { + HStack { + Image("redRectangleIcon") + .resizable() + .frame(width: 15, height: 15) + Text("Семинар") + .customFont(font: FontManager.Nunito.bold, size: 16) + .foregroundColor(Color("TextGrayColor")) + } + Text("Информатика") + .customFont(font: FontManager.Nunito.bold, size: 32) + .padding(.top, -20) + HStack { + Text("Дата") + .customFont(font: FontManager.Nunito.bold, size: 16) + Text("18 мая") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(.leading, 10) + .padding(.trailing, 10) + .padding(.top, 3) + .padding(.bottom, 2) + .background(Color("BlueColor")) + .cornerRadius(12) + Text("Время") + .customFont(font: FontManager.Nunito.bold, size: 16) + Text("17:00 - 18:30") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(.leading, 10) + .padding(.trailing, 10) + .padding(.top, 3) + .padding(.bottom, 2) + .background(Color("BlueColor")) + .cornerRadius(12) + } + Text("Преподователь") + .customFont(font: FontManager.Nunito.bold, size: 14) + .padding(.top, 29) + Text("Александр Викторович") + .customFont(font: FontManager.Nunito.regular, size: 16) + Text("Информатика в этом месяце") + .customFont(font: FontManager.Nunito.bold, size: 16) + .padding(.top, 34) + + Spacer() + + Button { + + } label: { + Text("Оставить сообщение") + .tint(Color.white) + .frame(width: 350, height: 50) + .background(Color("BlueColor")) + .cornerRadius(12) + } + } + } + .navigationBarBackButtonHidden(true) + .navigationBarItems(leading: BackButtonArrow()) + .toolbar { + ToolbarItem(placement: .principal) { + HStack { + Image("locationIcon") + .resizable() + .frame(width: 18, height: 18) + Text("Корпус \(TimetableCard().buildingNumber)") + .customFont(font: FontManager.Nunito.bold, size: 12) + } + } + } + } +} + +struct BackButtonArrow: View { + @Environment(\.presentationMode) var presentationMode + + var body: some View { + Button(action: { + self.presentationMode.wrappedValue.dismiss() + }) { + Image("arrowIconRight") + .resizable() + .frame(width: 17, height: 17) + .scaledToFit() + .scaleEffect(x: -1, y: 1) + } + } +} + +struct TimetableCardFull_Previews: PreviewProvider { + static var previews: some View { + TimetableCardFull() + } +} +//VStack { +// HStack { +// Image("redRectangleIcon") +// .resizable() +// .frame(width: 15, height: 15) +// Text("Семинар") +// .customFont(font: FontManager.Nunito.bold, size: 16) +// .foregroundColor(Color("TextGrayColor")) +// } +// .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) +// Text("Информатика") +// .customFont(font: FontManager.Nunito.bold, size: 32) +// .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) +//}.padding(.leading, 21) diff --git a/smartClass/Timetable/TimetableView.swift b/smartClass/Timetable/TimetableView.swift new file mode 100644 index 0000000..acfd93b --- /dev/null +++ b/smartClass/Timetable/TimetableView.swift @@ -0,0 +1,62 @@ +// +// TimetableView.swift +// smartClass +// +// Created by artemiithefrog on 25.05.2023. +// + +import SwiftUI + +struct TimetableView: View { + + private var audience = "Физ. Тех. Группа 101" + private var currentdate = "18 мая" + private var lessonsCount = 3 + + var body: some View { + NavigationView { + ScrollView(showsIndicators: false) { + + VStack(alignment: .leading) { + Text("\(audience)") + .customFont(font: FontManager.Nunito.bold, size: 19) + .foregroundColor(Color("ClassLightGrayColor")) + .padding(.leading, 20) + Text("Расписание") + .customFont(font: FontManager.Nunito.bold, size: 32) + .padding(.leading, 20) + + VStack(alignment: .center) { + Text("Календарь") + ZStack { + RoundedRectangle(cornerRadius: 20) + .fill() + .frame(width: 350, height: 300) + .opacity(0.1) + Text("Тут будет календарь") + } + } + .padding(.leading, 22) + + Text("\(currentdate)") + .customFont(font: FontManager.Nunito.bold, size: 18) + .padding(.leading, 20) + Text("Сегодня у тебя \(lessonsCount) занятия") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(Color("ClassLightGrayColor")) + .padding(.leading, 20) + + TimetableCard() + .padding(EdgeInsets(top: 0, leading: 21, bottom: 23, trailing: 21)) + + } + } + } + } +} + +struct TimetableView_Previews: PreviewProvider { + static var previews: some View { + TimetableView() + } +} diff --git a/smartClass/smartClassApp.swift b/smartClass/smartClassApp.swift index 86e1f79..f5e4b79 100644 --- a/smartClass/smartClassApp.swift +++ b/smartClass/smartClassApp.swift @@ -11,7 +11,7 @@ import SwiftUI struct smartClassApp: App { var body: some Scene { WindowGroup { - ContentView() + TimetableView() } } }