Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct DETEView: View {
- @Environment(\.dismiss) var dismiss
- var body: some View {
- GeometryReader { bounds in
- ScrollView([.horizontal, .vertical], showsIndicators: true) {
- HStack(alignment: .center) {
- Button(action: {
- dismiss()
- }, label: {
- Image("Crystalline")
- .resizable()
- .aspectRatio(contentMode: .fit)
- } )//.frame(
- //maxWidth: .infinity,
- // maxHeight: 40, alignment: .top)
- Button(action: {
- dismiss()
- }, label: {
- Text("DART Edge Table of Elements")
- .font(.largeTitle)
- .bold()
- .foregroundColor(.white)
- //.colorInvert()
- .padding(.top, 20)
- .shadow(radius: 3)
- })
- }.frame(width: 600, height: 60, alignment: .topLeading)
- VStack(alignment: .center){
- HStack(alignment: .center){
- VStack(alignment: .center){
- ZStack(alignment: .topLeading) {
- VStack(alignment: .leading){
- HStack(alignment: .center){
- VStack(alignment: .center){
- ZStack{
- HStack(alignment: .center) {
- ZStack {
- HStack{
- HStack{
- Image("C2LogoHum")
- .resizable()
- .aspectRatio(contentMode: .fit)
- }.frame(width: 120, height: 120, alignment: .topLeading)
- HStack{
- Image("rdfull")
- .resizable()
- .aspectRatio(contentMode: .fit)
- }.frame(width: 300, height: 120, alignment: .topLeading)
- }
- }.padding(.leading, 200).padding(.bottom, 20)
- }
- }
- }
- }
- }
- HStack(alignment: .top){
- VStack(alignment: .center){
- GridStack(rows: 7, columns: 18) { row, column in
- ZStack{
- if let element = tableOfElements[ElementCoordinate(row: row + 1, column: column + 1)] {
- //Image("detecell3")
- //RoundedRectangle(cornerRadius: 5)
- //.fill(Color.brown)
- //Image("DETECell")//.opacity(0.4)
- RoundedRectangle(cornerRadius: 4.0)
- .aspectRatio(1, contentMode: ContentMode.fit)
- .foregroundColor(.blue)
- .shadow(radius: 3)
- VStack(alignment: .leading){
- Text(element.atomicNumber)
- .font(.system(size: 8))
- }.frame(width: 30, height: 20, alignment: .topLeading).padding(.bottom, 20)
- HStack(alignment: .center){
- VStack(alignment: .center){
- Text(element.namesymbol)
- .font(.system(size: 12))
- .bold()
- .shadow(radius: 3)
- Text(element.name)
- .font(.system(size: 6))
- }
- }
- }
- }
- .frame(width: 45, height: 55)
- }//.frame(width: 900, height: 380, alignment: .top).padding(.top, 10).padding(5)
- }
- }
- }
- //*****************************************************************************************************************
- // I need both these sections below to display popover buttons unique to each individual grid of the table I’m not really //sure how to populate buttons since I’m already populating a grid of the table.
- //*****************************************************************************************************************
- HStack(alignment: .top){
- VStack(alignment: .center){
- GridStack2(rows2: 2, columns2: 15) { row2, column2 in
- ZStack{
- if let element2 = tableOfElementsbottom[ElementCoordinate2(row2: row2 + 1, column2: column2 + 1)] {
- //Image("DETECell")
- //RoundedRectangle(cornerRadius: 5)
- //.fill(Color.brown)
- //Image("DETECell")//.opacity(0.4)
- RoundedRectangle(cornerRadius: 4.0)
- .aspectRatio(1, contentMode: ContentMode.fit)
- .foregroundColor(.blue)
- .shadow(radius: 3)
- VStack(alignment: .leading){
- Text(element2.atomicNumber2)
- .font(.system(size: 8))
- }.frame(width: 30, height: 20, alignment: .topLeading).padding(.bottom, 20)
- HStack(alignment: .top){
- VStack(alignment: .center){
- Text(element2.namesymbol2)
- .font(.system(size: 12))
- .bold()
- .shadow(radius: 3)
- Text(element2.name2)
- .font(.system(size: 6))
- }
- }
- }
- }
- .frame(width: 45, height: 55)
- }.frame(
- maxWidth: .infinity,
- maxHeight: .infinity, alignment: .center
- ).padding(.top, 60).padding(5)
- }
- }
- }
- }
- }
- }.background(LinearGradient(gradient: Gradient(colors: [.brown, .black]), startPoint: .topTrailing, endPoint: .bottomLeading))
- .frame(width: bounds.size.width, height: bounds.size.height)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement