mirror of
https://github.com/X1a0He/Adobe-Downloader.git
synced 2025-11-25 11:18:53 +08:00
feat: Product card fade-in animation
This commit is contained in:
@@ -48,8 +48,8 @@
|
|||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "724"
|
startingLineNumber = "724"
|
||||||
endingLineNumber = "724"
|
endingLineNumber = "724"
|
||||||
landmarkName = "alertAction()"
|
landmarkName = "errorDescription"
|
||||||
landmarkType = "7">
|
landmarkType = "24">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let window = NSApp.windows.first {
|
if let window = NSApp.windows.first {
|
||||||
window.minSize = NSSize(width: 792, height: 600)
|
window.minSize = NSSize(width: 800, height: 765)
|
||||||
}
|
}
|
||||||
|
|
||||||
eventMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
|
eventMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ struct ProductGridView: View {
|
|||||||
) {
|
) {
|
||||||
ForEach(products, id: \.id) { uniqueProduct in
|
ForEach(products, id: \.id) { uniqueProduct in
|
||||||
AppCardView(uniqueProduct: uniqueProduct)
|
AppCardView(uniqueProduct: uniqueProduct)
|
||||||
|
.id(uniqueProduct.id)
|
||||||
|
.modifier(AppearAnimationModifier())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
@@ -97,4 +99,24 @@ struct ProductGridView: View {
|
|||||||
}
|
}
|
||||||
.background(Color(.clear))
|
.background(Color(.clear))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AppearAnimationModifier: ViewModifier {
|
||||||
|
@State private var opacity: Double = 0
|
||||||
|
@State private var offset: CGFloat = 20
|
||||||
|
@State private var scale: CGFloat = 0.95
|
||||||
|
|
||||||
|
func body(content: Content) -> some View {
|
||||||
|
content
|
||||||
|
.opacity(opacity)
|
||||||
|
.offset(y: offset)
|
||||||
|
.scaleEffect(scale)
|
||||||
|
.onAppear {
|
||||||
|
withAnimation(.easeInOut(duration: 0.5)) {
|
||||||
|
opacity = 1
|
||||||
|
offset = 0
|
||||||
|
scale = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ struct BeautifulSearchField: View {
|
|||||||
.padding(8)
|
.padding(8)
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 8)
|
RoundedRectangle(cornerRadius: 8)
|
||||||
.fill(Color(NSColor.controlBackgroundColor).opacity(0.8))
|
.fill(Color(NSColor.controlBackgroundColor).opacity(0.3))
|
||||||
.overlay(
|
.overlay(
|
||||||
RoundedRectangle(cornerRadius: 8)
|
RoundedRectangle(cornerRadius: 8)
|
||||||
.stroke(Color.secondary.opacity(0.1), lineWidth: 1)
|
.stroke(Color.secondary.opacity(0.1), lineWidth: 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user