Skip to content

Commit

Permalink
feat: add animation to favourite button + build bump
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidinfinity committed Nov 10, 2024
1 parent 6bfd63f commit 92a33d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3070;
CURRENT_PROJECT_VERSION = 3082;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down Expand Up @@ -820,7 +820,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3070;
CURRENT_PROJECT_VERSION = 3082;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down
7 changes: 5 additions & 2 deletions Mythic/Views/Unified/Models/GameCardVM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import Shimmer
@State private var launchError: Error?

@State private var hoveringOverDestructiveButton = false
@State private var hoveringOverFavouriteButton = false
@State private var animateFavouriteIcon = false

var body: some View {
Expand Down Expand Up @@ -183,14 +184,16 @@ import Shimmer
game.isFavourited.toggle()
withAnimation { animateFavouriteIcon = game.isFavourited }
} label: {
Image(systemName: animateFavouriteIcon ? "star.fill" : "star")
Image(systemName: "star")
.symbolVariant(animateFavouriteIcon ? (hoveringOverFavouriteButton ? .slash.fill : .fill) : .none)
.contentTransition(.symbolEffect(.replace))
.padding(5)
}
.clipShape(.circle)
.onHover { hoveringOverFavouriteButton = $0 }
.help("Favourite \"\(game.title)\"")
.task { animateFavouriteIcon = game.isFavourited }
.shadow(color: .secondary, radius: animateFavouriteIcon ? 20 : 0)
.symbolEffect(.bounce, value: animateFavouriteIcon)
}

var deleteButton: some View {
Expand Down

0 comments on commit 92a33d0

Please sign in to comment.