-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBackgroundsAndOverlays.swift
74 lines (69 loc) · 2.48 KB
/
BackgroundsAndOverlays.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import SwiftUI
struct BackgroundsAndOverlays: View {
var body: some View {
// Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
// .frame(width: 100, height: 100)
// .background(
// Color.red
// LinearGradient()
// Circle()
// .fill(LinearGradient(gradient: Gradient(colors: [.red, .blue]), startPoint: .topLeading, endPoint: .bottomTrailing))
// )
// .frame(width: 120, height: 120)
// .background(
// Circle().fill(LinearGradient(gradient: Gradient(colors: [.blue, .red]), startPoint: .topLeading, endPoint: .bottomTrailing))
// )
// Circle()
// .fill(.pink)
// .frame(width: 100, height: 100)
// .overlay(
// Text("1")
// .font(.largeTitle)
// .foregroundColor(.white)
// )
// .background(
// Circle()
// .fill(.purple)
// .frame(width: 110, height: 110)
// )
// Rectangle()
// .frame(width: 100, height: 100)
// .overlay(
// Rectangle()
// .fill(.blue)
// .frame(width: 50, height:50),
// alignment: .topTrailing
// )
// .background(
// Rectangle()
// .fill(.red)
// .frame(width: 150, height: 150),
// alignment: .bottomTrailing
//
// )
Image(systemName: "heart.fill")
.font(.system(size: 50))
.foregroundStyle(.white)
.background(
Circle()
.fill(.red)
.frame(width: 100, height: 100)
.shadow(color: .red, radius: 10, x: 0, y: 10)
.overlay(
Circle()
.fill(.blue)
.frame(width: 35, height: 35)
.overlay(
Text("2")
.font(.headline)
.foregroundStyle(.white)
)
.shadow(color: .blue, radius: 5, x: 2, y: 2),
alignment: .bottomTrailing
)
)
}
}
#Preview {
BackgroundsAndOverlays()
}