-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShapeView.swift
119 lines (107 loc) · 3.1 KB
/
ShapeView.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//
// ShapeView.swift
// FolderColor
//
// Created by 黄宝成 on 2022/5/9.
//
import Foundation
import SwiftUI
import Cocoa
struct ShapeView: View {
private var heightWidthScale: Double = 0.84
private var heightWidthTopScale: Double = 0.286
private var width: Double = 130.0
var body: some View {
let height: Double = width * heightWidthScale
let heightContent: Double = height * heightWidthScale
let heightBackgroundFill: Double = heightContent + (height * 0.075)
let widthTop: Double = width * heightWidthTopScale
return VStack(alignment: .center, spacing: 0) {
ZStack {
// ZStack {
//
// Ellipse() //椭圆形
// .fill(Color.gray)
// .frame(width: 20, height: 10)
// .position(x: 96, y: 80)
//
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 20, height: 20)
// .position(x: 96, y: 83)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 20, height: 20)
// .position(x: 97, y: 84)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 20, height: 20)
// .position(x: 98, y: 85)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 20, height: 20)
// .position(x: 99, y: 86)
//
// }
// .position(x: 0, y: 0)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 34)
// .position(x: 22, y: 26)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 35)
// .position(x: 23, y: 26)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 36)
// .position(x: 24, y: 26)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 37)
// .position(x: 25, y: 26)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 38)
// .position(x: 24, y: 26)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.gray)
// .frame(width: 30, height: 39)
// .position(x: 23, y: 26)
//
// RoundedRectangle(cornerRadius: 10, style: .continuous)
// .fill(Color.gray)
// .frame(width: widthTop, height: 40)
// .position(x: widthTop / 2, y: 26)
//
// RoundedRectangle(cornerRadius: 10, style: .continuous)
// .fill(Color.gray)
// .frame(width: width, height: heightBackgroundFill)
//
// RoundedRectangle(cornerRadius: 10)
// .fill(Color.blue)
// .frame(width: width, height: heightContent)
// .shadow(radius: 10)
// .padding(
// EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 0)
// )
} // ZStack end
} // VStack end
.frame(width: width, height: height + 20)
}
}
struct ShapeView_Previews: PreviewProvider {
static var previews: some View {
ShapeView()
}
}