@@ -87,11 +87,77 @@ class LayoutDesignerViewModel {
87
87
self ? . update ( options: & options, closure: $0)
88
88
}
89
89
90
+ optionViewModels = [
91
+ . init( title: " Scale factor " , kind: . singleSlider( current: options. scaleFactor) { n in
92
+ update { $0. scaleFactor = n }
93
+ } ) ,
94
+ . init( title: " Min scale " , kind: . singleSlider( current: options. minScale) { n in
95
+ update { $0. minScale = n }
96
+ } ) ,
97
+ . init( title: " Max scale " , kind: . singleSlider( current: options. maxScale) { n in
98
+ update { $0. maxScale = n }
99
+ } ) ,
100
+ . init( title: " Spacing factor " , kind: . singleSlider( current: options. spacingFactor) { n in
101
+ update { $0. spacingFactor = n }
102
+ } ) ,
103
+ . init( title: " Max spacing " , kind: . singleSlider( current: options. maxSpacing) { n in
104
+ update { $0. maxSpacing = n }
105
+ } ) ,
106
+ . init( title: " Alpha factor " , kind: . singleSlider( current: options. alphaFactor) { n in
107
+ update { $0. alphaFactor = n }
108
+ } ) ,
109
+ . init( title: " Bottom stack alpha speed factor " , kind: . singleSlider( current: options. bottomStackAlphaSpeedFactor) { n in
110
+ update { $0. bottomStackAlphaSpeedFactor = n }
111
+ } ) ,
112
+ . init( title: " Top stack alpha speed factor " , kind: . singleSlider( current: options. topStackAlphaSpeedFactor) { n in
113
+ update { $0. topStackAlphaSpeedFactor = n }
114
+ } ) ,
115
+ . init( title: " Perspective ratio " , kind: . singleSlider( current: options. perspectiveRatio) { n in
116
+ update { $0. perspectiveRatio = n }
117
+ } ) ,
118
+ . init( title: " Shadow enabled " , kind: . toggleSwitch( current: options. shadowEnabled) { n in
119
+ update { $0. shadowEnabled = n }
120
+ } ) ,
121
+ . init( title: " Shadow opacity " , kind: . singleSlider( current: CGFloat ( options. shadowOpacity) ) { n in
122
+ update { $0. shadowOpacity = Float ( n) }
123
+ } ) ,
124
+ . init( title: " Shadow offset " , kind: . doubleSlider( current: options. shadowOffset. pair) { n in
125
+ update { $0. shadowOffset = . by( pair: n) }
126
+ } ) ,
127
+ . init( title: " Shadow radius " , kind: . singleSlider( current: options. shadowRadius) { n in
128
+ update { $0. shadowRadius = n }
129
+ } ) ,
130
+ . init( title: " Rotate angel " , kind: . singleSlider( current: options. stackRotateAngel) { n in
131
+ update { $0. stackRotateAngel = n }
132
+ } ) ,
133
+ . init( title: " Pop angle " , kind: . singleSlider( current: options. popAngle) { n in
134
+ update { $0. popAngle = n }
135
+ } ) ,
136
+ . init( title: " Pop offset ratio " , kind: . doubleSlider( current: options. popOffsetRatio. pair) { n in
137
+ update { $0. popOffsetRatio = . by( pair: n) }
138
+ } ) ,
139
+ . init( title: " Stack position " , kind: . doubleSlider( current: options. stackPosition. pair) { n in
140
+ update { $0. stackPosition = . by( pair: n) }
141
+ } ) ,
142
+ . init( title: " Reverse " , kind: . toggleSwitch( current: options. reverse) { n in
143
+ update { $0. reverse = n }
144
+ } ) ,
145
+ . init( title: " Blur effect enabled " , kind: . toggleSwitch( current: options. blurEffectEnabled) { n in
146
+ update { $0. blurEffectEnabled = n }
147
+ } ) ,
148
+ . init( title: " Max blur radius " , kind: . singleSlider( current: options. maxBlurEffectRadius) { n in
149
+ update { $0. maxBlurEffectRadius = n }
150
+ } ) ,
151
+ . init( title: " Blur effect style " , kind: . segmented( options: UIBlurEffect . Style. all. map ( \. name) , current: options. blurEffectStyle. name) { n in
152
+ update { $0. blurEffectStyle = . by( name: n) ! }
153
+ } )
154
+ ]
90
155
} else if var options = selectedLayout. snapshotOptions {
91
156
updateCodePreview ( options: options)
92
157
let update : ( ( inout SnapshotTransformViewOptions ) -> Void ) -> Void = { [ weak self] in
93
158
self ? . update ( options: & options, closure: $0)
94
159
}
95
160
}
96
161
}
162
+
97
163
}
0 commit comments