Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- import SwiftUI
- import CoreData
- import Combine
- import PDFKit
- import SceneKit
- import WebKit
- struct Cotharticren: App {
- var body: some Scene {
- WindowGroup {
- ContentView()
- }
- }
- }
- struct Option: Hashable {
- let title: String
- let imageName: String
- }
- struct ContentView: View {
- @State var currentOption = 0
- let options: [Option] = [
- .init(title: "DART Meadow", imageName: "sun.max.fill"),
- .init(title: "Research", imageName: "flame"),
- .init(title: "Navigation", imageName: "moon.stars.fill"),
- .init(title: "Shelf", imageName: "archivebox"),
- .init(title: "Chest" ,imageName: "shippingbox"),
- .init(title: "Crate" ,imageName: "bonjour"),
- .init(title: "Manufactoring", imageName: "gear"),
- .init(title: "Warehouse", imageName: "archivebox.fill"),
- .init(title: "Journal", imageName: "note.text"),
- ]
- var body: some View {
- VStack(alignment: .leading) {
- HStack(alignment: .top) {
- ScrollView( .vertical) {
- NavigationView{
- /*
- List(1..<9)
- {
- Text("\($0)")
- }
- .listStyle(SidebarListStyle())
- }
- */
- ListView(options: options, currentSelection: $currentOption)
- //Text(systemName: myItem.selectedImageName) + Text(myItem.whateverText)
- switch (currentOption) {
- case 1:
- OrbitNodeView()
- case 2:
- ATM26NodeView()
- case 3:
- NozzleNodeView()
- case 4:
- EmptyView()
- VStack(alignment: .center) {
- Text("Chest")
- .font(.largeTitle)
- .bold()
- .colorInvert()
- }
- case 5:
- EmptyView()
- VStack(alignment: .center) {
- Text("Crate")
- .font(.largeTitle)
- .bold()
- .colorInvert()
- }
- case 6:
- EmptyView()
- VStack(alignment: .center) {
- Text("Manufactoring")
- .font(.largeTitle)
- .bold()
- .colorInvert()
- }
- case 7:
- EmptyView()
- VStack(alignment: .center) {
- Text("Warehouse")
- .font(.largeTitle)
- .bold()
- .colorInvert()
- }
- case 8:
- VStack(alignment: .center) {
- Text("Journal")
- .font(.largeTitle)
- .bold()
- .colorInvert()
- .padding(.top, 60)
- Image("articrenmeadowopacity")
- .shadow(radius: 3)
- WebView()
- }
- default:
- MainView()
- }
- }.background(Color.white)
- }
- }
- }
- Spacer()
- }
- }
- struct MainView: View {
- var body: some View{
- VStack(alignment: .leading) {
- HStack(alignment: .bottom) {
- Image("CotharticrenMainView")
- .shadow(radius: 3)
- }
- }
- .frame(width: 900, height: 800, alignment: .center)
- Spacer()
- }
- }
- struct ListView: View {
- let options: [Option]
- @Binding var currentSelection: Int
- var body: some View{
- VStack(alignment: .leading) {
- HStack(alignment: .top) {
- HStack(alignment: .top) {
- VStack(alignment: .trailing) {
- Circle()
- .stroke(Color.init(red: 0.9, green: 0.95, blue: 0.2, opacity: 1), lineWidth: 2)
- .alignmentGuide(HorizontalAlignment.myAlignment)
- { d in d[.leading] }
- .alignmentGuide(VerticalAlignment.myAlignment)
- { d in d[.bottom] }
- .frame(width: 50, height: 50)
- Circle()
- .stroke(Color.init(red: 0.25, green: 0.9, blue: 0.2, opacity: 1), lineWidth: 2)
- .alignmentGuide(HorizontalAlignment.myAlignment)
- { d in d[.leading] }
- .alignmentGuide(VerticalAlignment.myAlignment)
- { d in d[.bottom] }
- .frame(width: 25, height: 25)
- VStack(alignment: .leading) {
- Circle()
- .stroke(Color.init(red: 0.1, green: 0.1, blue: 1, opacity: 1), lineWidth: 2)
- .alignmentGuide(HorizontalAlignment.myAlignment)
- { d in d[.leading] }
- .alignmentGuide(VerticalAlignment.myAlignment)
- { d in d[.bottom] }
- .frame(width: 75, height: 75)
- }
- }
- }
- HStack(alignment: .top) {
- Image("DARTMeadowCSMwidthArtemis2by1")
- .shadow(radius: 3)
- .padding(.top, 10)
- }
- .padding(.top, 20)
- .padding(.trailing, 10)
- }.padding(.top, 20).padding(.leading, 10)
- HStack(alignment: .center) {
- VStack(alignment: .center) {
- Image("arrow300")
- HStack(alignment: .center) {
- Text("You've never plotted an Edge?")
- }
- }
- }.shadow(radius: 3)
- VStack(alignment: .leading) {
- let current = options[currentSelection]
- ForEach(options, id: \.self) {option in
- HStack {
- Image(systemName: option.imageName)
- //.resizable()
- //.aspectRatio(contentMode: .fit)
- .frame(width: 20)
- Text(option.title)
- .foregroundColor(current == option ? Color.blue : Color.white)
- }
- .padding(8)
- .onTapGesture {
- currentSelection += 1
- if currentSelection == 9 {
- currentSelection = 0
- }
- }
- }
- Spacer()
- }.frame(width: 300, height: 800, alignment: .leading)
- }
- Spacer()
- }
- }
- struct WebView: View {
- var body: some View{
- VStack(alignment: .leading) {
- HStack(alignment: .bottom) {
- }
- }
- .frame(width: 900, height: 800, alignment: .center)
- Spacer()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement