-
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.
add green play button to shortcut grid item
- Loading branch information
Lee Jun Kit
committed
Jun 19, 2021
1 parent
14cd2c7
commit b574409
Showing
4 changed files
with
54 additions
and
4 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,38 @@ | ||
// | ||
// GreenPlayButton.swift | ||
// Spottie | ||
// | ||
// Created by Lee Jun Kit on 19/6/21. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct GreenPlayButton: View { | ||
var onPress: () -> Void | ||
|
||
@State private var isHovering = false | ||
|
||
var body: some View { | ||
Button(action: onPress) { | ||
Image(systemName: "play.circle.fill") | ||
.resizable() | ||
.clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) | ||
.frame(width: 32, height: 32) | ||
.foregroundColor(.green) | ||
} | ||
.buttonStyle(BorderlessButtonStyle()) | ||
.onHover { hovering in | ||
isHovering = hovering | ||
} | ||
.scaleEffect(isHovering ? 1.1 : 1.0) | ||
.animation(.linear(duration: 0.05)) | ||
} | ||
} | ||
|
||
struct GreenPlayButton_Previews: PreviewProvider { | ||
static var previews: some View { | ||
GreenPlayButton { | ||
|
||
} | ||
} | ||
} |
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