Advertisement
dennewbie

myPassionSwift

Mar 30th, 2022
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 2.46 KB | None | 0 0
  1. //
  2. //  ContentView.swift
  3. //  myPassions
  4. //
  5. //  Created by Denny Caruso on 30/03/22.
  6. //
  7.  
  8. import SwiftUI
  9.  
  10.  
  11. struct ContentView_Previews: PreviewProvider {
  12.     static var previews: some View {
  13.         ContentView()
  14.             .previewInterfaceOrientation(.portrait)
  15.     }
  16. }
  17.  
  18. struct ContentView: View {
  19.     var body: some View {
  20.         VStack(alignment: .center) {
  21.             cloudView()
  22.             basicInfoView()
  23.             passionView()
  24.         }
  25.     }
  26. }
  27.  
  28. struct cloudView: View {
  29.     @State private var colorChange=false
  30.     @State private var sizeChange=false
  31.    
  32.     var body: some View {
  33.         VStack(spacing: 100.0) {
  34.             Image("myImage")
  35.                 .resizable()
  36.                 .scaledToFit()
  37.                 .font(.system(size: 200))
  38.                 .foregroundColor(colorChange ? .black: .cyan)
  39.                 .scaleEffect(sizeChange ? 2 : 1)
  40.                 .animation(.default)
  41.                 .onTapGesture {
  42.                     self.colorChange.toggle()
  43.                 }
  44.            
  45.                 .onLongPressGesture{
  46.                     self.sizeChange.toggle()
  47.                 }
  48.         }
  49.         .padding(.all, 100)
  50.     }
  51. }
  52.  
  53. struct basicInfoView: View {
  54.     @State private var colorChange=false
  55.     @State private var sizeChange=false
  56.    
  57.     var body: some View {
  58.         VStack(spacing: 100.0) {
  59.             Text("\n\nName: Denny\nSurname: Caruso\n\n\n")
  60.                 .fontWeight(.bold)
  61.                 .lineSpacing(3)
  62.                 .multilineTextAlignment(.leading)
  63.                 .ignoresSafeArea()
  64.                 .padding(.trailing, 250)
  65.                 .foregroundColor(.black)
  66.                 .font(.system(size: 15))
  67.                 .font(.system(.largeTitle, design: .rounded))
  68.                 .frame(width: nil)
  69.         }
  70.     }
  71. }
  72.  
  73. struct passionView: View {
  74.     @State private var colorChange=false
  75.     @State private var sizeChange=false
  76.    
  77.     var body: some View {
  78.         VStack(spacing: 100.0) {
  79.             Text("Passion List:\n1. Ping Pong\n2. Coding\n3. Soccer\n\n\n")
  80.                 .fontWeight(.bold)
  81.                 .lineSpacing(3)
  82.                 .multilineTextAlignment(.leading)
  83.                 .ignoresSafeArea()
  84.                 .padding(.trailing, 280)
  85.                 .foregroundColor(.black)
  86.                 .font(.system(size: 15))
  87.                 .font(.system(.largeTitle, design: .rounded))
  88.                 .frame(width: nil)
  89.         }
  90.     }
  91. }
  92.  
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement