From d3f448e28825576bd96ed5fa51f1aa588eca8294 Mon Sep 17 00:00:00 2001 From: Vladimir Dubovik Date: Wed, 13 Nov 2024 17:41:03 +0300 Subject: [PATCH] Initial Commit --- .../contents.xcworkspacedata | 7 ++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++ .../xcschemes/xcschememanagement.plist | 14 ++++ .../AccentColor.colorset/Contents.json | 11 ++++ .../AppIcon.appiconset/Contents.json | 13 ++++ Schedule ICTIS/Assets.xcassets/Contents.json | 6 ++ .../blueColor.colorset/Contents.json | 38 +++++++++++ Schedule ICTIS/ContentView.swift | 32 +++++++++ Schedule ICTIS/CustomTabBarView.swift | 54 +++++++++++++++ Schedule ICTIS/Model.swift | 23 +++++++ .../Preview Assets.xcassets/Contents.json | 6 ++ Schedule ICTIS/ScheduleView.swift | 23 +++++++ Schedule ICTIS/Schedule_ICTISApp.swift | 17 +++++ Schedule ICTIS/SearchBarView.swift | 66 +++++++++++++++++++ Schedule ICTIS/TabModel.swift | 14 ++++ 15 files changed, 332 insertions(+) create mode 100644 Schedule ICTIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Schedule ICTIS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Schedule ICTIS.xcodeproj/xcuserdata/g412.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Schedule ICTIS/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Schedule ICTIS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Schedule ICTIS/Assets.xcassets/Contents.json create mode 100644 Schedule ICTIS/Assets.xcassets/blueColor.colorset/Contents.json create mode 100644 Schedule ICTIS/ContentView.swift create mode 100644 Schedule ICTIS/CustomTabBarView.swift create mode 100644 Schedule ICTIS/Model.swift create mode 100644 Schedule ICTIS/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Schedule ICTIS/ScheduleView.swift create mode 100644 Schedule ICTIS/Schedule_ICTISApp.swift create mode 100644 Schedule ICTIS/SearchBarView.swift create mode 100644 Schedule ICTIS/TabModel.swift diff --git a/Schedule ICTIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Schedule ICTIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Schedule ICTIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Schedule ICTIS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Schedule ICTIS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Schedule ICTIS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Schedule ICTIS.xcodeproj/xcuserdata/g412.xcuserdatad/xcschemes/xcschememanagement.plist b/Schedule ICTIS.xcodeproj/xcuserdata/g412.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8461fbd --- /dev/null +++ b/Schedule ICTIS.xcodeproj/xcuserdata/g412.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Schedule ICTIS.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Schedule ICTIS/Assets.xcassets/AccentColor.colorset/Contents.json b/Schedule ICTIS/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Schedule ICTIS/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Schedule ICTIS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/Schedule ICTIS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Assets.xcassets/Contents.json b/Schedule ICTIS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Schedule ICTIS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Assets.xcassets/blueColor.colorset/Contents.json b/Schedule ICTIS/Assets.xcassets/blueColor.colorset/Contents.json new file mode 100644 index 0000000..5b28f5e --- /dev/null +++ b/Schedule ICTIS/Assets.xcassets/blueColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA4", + "green" : "0x60", + "red" : "0x28" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA4", + "green" : "0x60", + "red" : "0x28" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/ContentView.swift b/Schedule ICTIS/ContentView.swift new file mode 100644 index 0000000..b8f1dbb --- /dev/null +++ b/Schedule ICTIS/ContentView.swift @@ -0,0 +1,32 @@ +// +// ContentView.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +struct ContentView: View { + @State private var isActiveTabBar: TabModel = .schedule + @State private var isTabBarHidden: Bool = false + var body: some View { + VStack { + TabView(selection: $isActiveTabBar) { + ScheduleView() + .tag(TabModel.schedule) + Text("Tasks") + .tag(TabModel.tasks) + Text("Settings") + .tag(TabModel.settings) + } + CustomTabBarView(isActiveTabBar: $isActiveTabBar) + .padding(.bottom, 10) + } + .background(.secondary.opacity(0.15)) + } +} + +#Preview { + ContentView() +} diff --git a/Schedule ICTIS/CustomTabBarView.swift b/Schedule ICTIS/CustomTabBarView.swift new file mode 100644 index 0000000..1c09548 --- /dev/null +++ b/Schedule ICTIS/CustomTabBarView.swift @@ -0,0 +1,54 @@ +// +// CustomTabBarView.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +struct CustomTabBarView: View { + var isActiveForeground: Color = .white + var isActiveBackground: Color = Color("blueColor") + @Binding var isActiveTabBar: TabModel +// @NameSpace private var animation + var body: some View { + HStack(spacing: 0) { + ForEach(TabModel.allCases, id: \.rawValue) { tab in + Button { + isActiveTabBar = tab + } label: { + HStack(spacing: 5) { + Image(systemName: tab.rawValue) + .font(.title) + .frame(width: 80, height: 35) + } + .foregroundStyle(isActiveTabBar == tab ? isActiveForeground : Color("blueColor")) + .padding(.vertical, 7) + .padding(.leading, 15) + .padding(.trailing, 15) + .background { + if isActiveTabBar == tab { + Capsule() + .fill(isActiveBackground) +// .matchedGeometryEffect(id: "ACTIVETAB", in: animation) + } + } + } + .buttonStyle(.plain) + } + } + .padding(.horizontal, 5) + .animation(.smooth(duration: 0.3, extraBounce: 0), value: isActiveTabBar) +// .background( +// background +// .shadow(.drop(color: .black.opacity(0.08), radius: 5, x: 5, y: 5)) +// .shadow(.drop(color: .black.opacity(0.08), radius: 5, x: 5, y: -5)), +// in: .capsule +// ) + } +} + +#Preview { + ContentView() +} diff --git a/Schedule ICTIS/Model.swift b/Schedule ICTIS/Model.swift new file mode 100644 index 0000000..a785ea7 --- /dev/null +++ b/Schedule ICTIS/Model.swift @@ -0,0 +1,23 @@ +// +// ViewModel.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import Foundation + +// MARK: - Welcome +struct Schedule: Codable { + let table: Table + let weeks: [Int] +} + +// MARK: - Table +struct Table: Codable { + let type, name: String + let week: Int + let group: String + let table: [[String]] + let link: String +} diff --git a/Schedule ICTIS/Preview Content/Preview Assets.xcassets/Contents.json b/Schedule ICTIS/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/ScheduleView.swift b/Schedule ICTIS/ScheduleView.swift new file mode 100644 index 0000000..59f78b4 --- /dev/null +++ b/Schedule ICTIS/ScheduleView.swift @@ -0,0 +1,23 @@ +// +// ScheduleView.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +struct ScheduleView: View { + @State private var searchText: String = "" + var body: some View { + VStack { + SearchBarView(text: $searchText) + Spacer() + } + .background(.secondary.opacity(0.15)) + } +} + +#Preview { + ScheduleView() +} diff --git a/Schedule ICTIS/Schedule_ICTISApp.swift b/Schedule ICTIS/Schedule_ICTISApp.swift new file mode 100644 index 0000000..483148f --- /dev/null +++ b/Schedule ICTIS/Schedule_ICTISApp.swift @@ -0,0 +1,17 @@ +// +// Schedule_ICTISApp.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +@main +struct Schedule_ICTISApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Schedule ICTIS/SearchBarView.swift b/Schedule ICTIS/SearchBarView.swift new file mode 100644 index 0000000..5a78c8b --- /dev/null +++ b/Schedule ICTIS/SearchBarView.swift @@ -0,0 +1,66 @@ +// +// SearchBarView.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +struct SearchBarView: View { + @Binding var text: String + @State private var isEditing = false + + var body: some View { + HStack { + TextField("Ввести номер группы", text: $text) + .padding(7) + .padding(.horizontal, 25) + .background(.white) + .cornerRadius(8) + .overlay( + HStack { + Image(systemName: "magnifyingglass") + .foregroundColor(.gray) + .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) + .padding(.leading, 8) + + if isEditing { + Button(action: { + self.text = "" + self.isEditing = false + UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) + }) { + Image(systemName: "multiply.circle.fill") + .foregroundColor(.gray) + .padding(.trailing, 8) + } + } + } + ) + .onTapGesture { + self.isEditing = true + } + Button { + + } label: { + ZStack { + Rectangle() + .frame(width: 35, height: 35) + .foregroundStyle(Color("blueColor")) + .cornerRadius(10) + Image(systemName: "plus") + .resizable() + .foregroundStyle(.white) + .scaledToFit() + .frame(width: 16) + } + } + } + .padding(.horizontal) + } +} + +#Preview { + ScheduleView() +} diff --git a/Schedule ICTIS/TabModel.swift b/Schedule ICTIS/TabModel.swift new file mode 100644 index 0000000..463e59e --- /dev/null +++ b/Schedule ICTIS/TabModel.swift @@ -0,0 +1,14 @@ +// +// Tab.swift +// Schedule ICTIS +// +// Created by G412 on 13.11.2024. +// + +import SwiftUI + +enum TabModel: String, CaseIterable { + case schedule = "house" + case tasks = "books.vertical" + case settings = "gear" +}