Triples / assign3 / about.swift
about.swift
Raw
//
//  about.swift
//  assign3
//
//  Created by Jason Kim on 4/8/22.
//

import Foundation
import SwiftUI

struct aboutpage:View{
    @Environment(\.verticalSizeClass) var verticalSizeClass
    //@State var angle = 0.0
    @State var offset:CGFloat = -100.0
    //@State var radius:CGFloat = 10.0
    @State var start = false
    var body: some View {
        if verticalSizeClass == .regular {
            VStack {
                Text("CMSC 436")
                    .font(.title)
                    .frame(width:150,height:75, alignment: .center).offset(x:offset,y:0.0)
                    .rotationEffect(Angle(degrees:start ? 0 : 360))
                    .animation(.easeInOut(duration: 2).repeatForever())
                    .onAppear(){
                        start = true
                    }.padding()
                Text("Triples")
                    .font(.title)
                    .frame(width:100,height:50).foregroundColor(.red)
                    .rotationEffect(Angle(degrees:start ? -30 : 30))
                    .animation(.linear(duration: 0.2).repeatForever())
                    .onAppear(){
                        start = true
                    }.padding()
                Text("Jason Kim")
                    .font(.title)
                    .frame(width: 200, height: 50, alignment: .center)
                    .background(RoundedRectangle(cornerRadius: start ? -30 : 30).stroke())
                    .foregroundColor(.blue).frame(width:150,height:100)
                    .animation(.linear(duration:3).repeatForever())
                    .onAppear(){
                        start = true
                    }.padding()
            }.frame(alignment:.center)
        } else {
            VStack {
                HStack{
                    Text("CMSC 436")
                        .font(.title)
                        .frame(width:150,height:75, alignment: .center)
                        .rotationEffect(Angle(degrees:start ? 0 : 360))
                        .animation(.linear(duration: 5).repeatForever(autoreverses: false))
                        .onAppear(){
                            start = true
                        }.padding()
                    Text("Triples")
                        .font(.title)
                        .frame(width:100,height:50).foregroundColor(.red)
                        .rotationEffect(Angle(degrees:start ? -30 : 30))
                        .animation(.linear(duration: 0.2).repeatForever())
                        .onAppear(){
                            start = true
                        }.padding()
                }
                Text("Jason Kim")
                    .font(.title)
                    .frame(width: 200, height: 50, alignment: .center)
                    .background(RoundedRectangle(cornerRadius: start ? -30 : 30).stroke())
                    .foregroundColor(.blue).frame(width:150,height:100)
                    .animation(.linear(duration:3).repeatForever())
                    .onAppear(){
                        start = true
                    }.padding()
            }.frame(alignment:.center)
        }
    }

}