-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
38 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// SecondaryButtonView.swift | ||
// docWind | ||
// | ||
// Created by Sarvad shetty on 8/6/20. | ||
// Copyright © 2020 Sarvad shetty. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct SecondaryButtonView: View { | ||
|
||
@Binding var tapped: Bool | ||
var icon = "pencil" | ||
var color = Color.blue | ||
var offsetX = 0 | ||
var offsetY = 0 | ||
var delay = 0.0 | ||
let action: () -> Void | ||
|
||
var body: some View { | ||
Button(action: action) { | ||
Image(systemName: icon) | ||
.foregroundColor(.white) | ||
.font(.body) | ||
} | ||
.padding() | ||
.background(color) | ||
.mask(Circle()) | ||
.offset(x: tapped ? CGFloat(offsetX) : 0, y: tapped ? CGFloat(offsetY) : 0) | ||
.scaleEffect(tapped ? 1 : 0.5) | ||
.animation(Animation.spring(response: 0.2, dampingFraction: 0.5, blendDuration: 0).delay(Double(delay))) | ||
} | ||
} |
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
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