|
| 1 | +// |
| 2 | +// ExamplesView.swift |
| 3 | +// Notes |
| 4 | +// |
| 5 | +// Created by Developer on 24/02/25. |
| 6 | +// |
| 7 | + |
| 8 | +import SwiftUI |
| 9 | + |
| 10 | +struct ExamplesView: View { |
| 11 | + var body: some View { |
| 12 | + // Text("Nunca pares de aprender") |
| 13 | + // .font(.system(size: 50)) |
| 14 | + // .lineLimit(2) |
| 15 | + // .multilineTextAlignment(.trailing) |
| 16 | + // .bold() |
| 17 | + // .underline() |
| 18 | + |
| 19 | + // Circle() |
| 20 | + // .background(Color.green) |
| 21 | + // .padding() |
| 22 | + // .background(Color.red) |
| 23 | + // .frame(width: 200, height: 200) |
| 24 | + // |
| 25 | + // Rectangle() |
| 26 | + // .frame(width: 200, height: 200) |
| 27 | + // .foregroundStyle(Color.yellow) |
| 28 | + // .cornerRadius(20) |
| 29 | + // .opacity(0.5) |
| 30 | + // |
| 31 | + // Ellipse() |
| 32 | + // .stroke(lineWidth: 5) |
| 33 | + // .frame(width: 200, height: 400) |
| 34 | + // .foregroundColor(Color.red) |
| 35 | + // .rotationEffect(.degrees(30)) |
| 36 | + |
| 37 | + // Button(/*@START_MENU_TOKEN@*/"Button"/*@END_MENU_TOKEN@*/) { |
| 38 | + // /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Action@*/ /*@END_MENU_TOKEN@*/ |
| 39 | + // }.frame(width: 200, height: 50) |
| 40 | + // .background(Color.red) |
| 41 | + // .foregroundColor(.none) |
| 42 | + // Image("logo") |
| 43 | + // .resizable() |
| 44 | + // .aspectRatio(contentMode: .fit) |
| 45 | + // .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/, height: 100) |
| 46 | + //// .font(.largeTitle) |
| 47 | + //// .bold() |
| 48 | + // .foregroundStyle(Color.red) |
| 49 | + // .background(Color.gray) |
| 50 | + |
| 51 | + // Button(action: { |
| 52 | + // print("Button tapped!") |
| 53 | + // }) { |
| 54 | + // Image(systemName: "heart.fill") // System icon |
| 55 | + // .font(.system(size: 24)) // Adjust icon size |
| 56 | + // .foregroundColor(.red) // Change icon color |
| 57 | + // }.frame(width: 200, height: 50) |
| 58 | + // .background(Color.green) |
| 59 | + |
| 60 | + // Removes default button styling |
| 61 | + |
| 62 | + |
| 63 | + // VStack( alignment: .center, spacing: 20) { |
| 64 | + // Text("Nunca") |
| 65 | + // Text("pares") |
| 66 | + // |
| 67 | + // Text("de") |
| 68 | + // Text("aprender") |
| 69 | + // } |
| 70 | + |
| 71 | + |
| 72 | + // HStack( alignment: .bottom, spacing: 20) { |
| 73 | + // Text("Nunca") |
| 74 | + // Text("pares") |
| 75 | + // Text("de").font(.largeTitle) |
| 76 | + // Text("aprender") |
| 77 | + // } |
| 78 | + |
| 79 | + // ZStack( alignment: .center ) { |
| 80 | + // Color.green |
| 81 | + // Circle() |
| 82 | + // HStack(spacing: 0) { |
| 83 | + // Rectangle() |
| 84 | + // .foregroundStyle(Color.yellow) |
| 85 | + // .frame(width: 100, height: 100) |
| 86 | + // Rectangle() |
| 87 | + // .foregroundStyle(Color.red) |
| 88 | + // .frame(width: 100, height: 100) |
| 89 | + // } |
| 90 | + // VStack() { |
| 91 | + // Text("Hola") |
| 92 | + // Text("Mundo") |
| 93 | + // } |
| 94 | + // |
| 95 | + // } |
| 96 | + |
| 97 | + VStack(spacing: 20) { |
| 98 | + |
| 99 | + ZStack() { |
| 100 | + Rectangle() |
| 101 | + .frame(height: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/) |
| 102 | + .foregroundColor(.gray.opacity(0.2)) |
| 103 | + .cornerRadius(20) |
| 104 | + |
| 105 | + HStack(spacing: 20) { |
| 106 | + ZStack() { |
| 107 | + Rectangle() |
| 108 | + .frame(width: 130,height: 40) |
| 109 | + .foregroundColor(.blue.opacity(0.2)) |
| 110 | + .cornerRadius(10) |
| 111 | + Text("Hola Mundo").bold() |
| 112 | + } |
| 113 | + |
| 114 | + Text("Esto es una card pequeña, saludos") |
| 115 | + |
| 116 | + Image(systemName: "heart").foregroundColor(.red) |
| 117 | + } |
| 118 | + } |
| 119 | + |
| 120 | + ZStack() { |
| 121 | + Rectangle() |
| 122 | + .frame(height: 150) |
| 123 | + .foregroundColor(.gray.opacity(0.2)) |
| 124 | + .cornerRadius(20) |
| 125 | + |
| 126 | + VStack() { |
| 127 | + VStack() { |
| 128 | + HStack { |
| 129 | + Spacer() |
| 130 | + Image(systemName: "heart") |
| 131 | + .foregroundColor(.red) |
| 132 | + .padding(.trailing, 10) // |
| 133 | + } |
| 134 | + ZStack() { |
| 135 | + Rectangle() |
| 136 | + .frame(width: 130,height: 40) |
| 137 | + .foregroundColor(.blue.opacity(0.2)) |
| 138 | + .cornerRadius(10) |
| 139 | + Text("Hola Mundo").bold() |
| 140 | + } |
| 141 | + } |
| 142 | + |
| 143 | + |
| 144 | + Text("Esto es una card pequeña, saludos") |
| 145 | + |
| 146 | + } |
| 147 | + } |
| 148 | + |
| 149 | + // MARK: Card pequeña |
| 150 | + HStack { |
| 151 | + Text("Hello, World!") |
| 152 | + .font(.headline) |
| 153 | + .lineLimit(2) |
| 154 | + .frame(width: 120) |
| 155 | + .padding(8) |
| 156 | + .background(Color.cyan.opacity(0.2)) |
| 157 | + .cornerRadius(8) |
| 158 | + Text("This is an example of a preview.") |
| 159 | + .font(.subheadline) |
| 160 | + .lineLimit(2) |
| 161 | + .multilineTextAlignment(.leading) |
| 162 | + .frame(maxWidth: .infinity) |
| 163 | + Image(systemName: "heart") |
| 164 | + .foregroundStyle(Color.red) |
| 165 | + } |
| 166 | + .padding() |
| 167 | + .background(Color.gray.opacity(0.1)) |
| 168 | + .cornerRadius(16) |
| 169 | + |
| 170 | + // MARK: Card mediana |
| 171 | + VStack { |
| 172 | + HStack(alignment: .top) { |
| 173 | + Spacer() |
| 174 | + Image(systemName: "heart") |
| 175 | + .foregroundStyle(Color.red) |
| 176 | + } |
| 177 | + Text("Hello, World!") |
| 178 | + .font(.title2) |
| 179 | + .lineLimit(2) |
| 180 | + .padding(.vertical, 8) |
| 181 | + .padding(.horizontal, 30) |
| 182 | + .background(Color.cyan.opacity(0.2)) |
| 183 | + .cornerRadius(8) |
| 184 | + Text("This is an example of a preview.") |
| 185 | + .font(.body) |
| 186 | + .lineLimit(2) |
| 187 | + .multilineTextAlignment(.leading) |
| 188 | + .frame(maxWidth: .infinity) |
| 189 | + } |
| 190 | + .frame(height: 150) |
| 191 | + .padding() |
| 192 | + .background(Color.gray.opacity(0.1)) |
| 193 | + .cornerRadius(16) |
| 194 | + |
| 195 | + }.padding() |
| 196 | + } |
| 197 | +} |
| 198 | + |
| 199 | +#Preview { |
| 200 | + ExamplesView() |
| 201 | +} |
0 commit comments