This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CardFront : View { | |
let width : CGFloat | |
let height : CGFloat | |
@Binding var degree : Double | |
var body: some View { | |
ZStack { | |
RoundedRectangle(cornerRadius: 20) | |
.fill(.white) | |
.frame(width: width, height: height) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct likesPile : View { | |
@State var likes :[LikeView] = [] | |
let timer = Timer.publish(every: 0.3, on: .main, in: .common).autoconnect() | |
var body: some View { | |
ZStack { | |
ForEach(likes) { like in | |
like.image | |
.resizable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
var body: some View { | |
ZStack { | |
Color(Colors.mainColor).ignoresSafeArea() | |
CustomToggle(width: 150, height: 60, toggleWidthOffset: 20, cornerRadius: 30, padding: 0) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
var body: some View { | |
ZStack { | |
Color(Colors.mainColor).ignoresSafeArea() | |
CustomToggle(width: 200, height: 80, toggleWidthOffset: 20, cornerRadius: 10, padding: 10) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Colors { | |
public static let mainColor = "mainColor" | |
public static let lightShadow = "lightShadow" | |
public static let darkShadow = "darkShadow" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
var body: some View { | |
ZStack { | |
Color(Colors.mainColor) | |
CustomToggle(width: 170, height: 60, toggleWidthOffset: 20, cornerRadius: 30, padding: 10) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CustomToggle : View { | |
let width : CGFloat | |
let height : CGFloat | |
let toggleWidthOffset : CGFloat | |
let cornerRadius : CGFloat | |
let padding : CGFloat | |
@State var isToggled = false | |
@State var switchWidth : CGFloat = 0.0 | |