mirror of
https://github.com/yattee/yattee.git
synced 2026-10-24 13:42:54 +00:00
Fade corner layout panels while the video grows over them on toggle
This commit is contained in:
@@ -383,6 +383,11 @@ struct CornerPlayerLayout<PlayerContent: View>: View {
|
||||
.background(panelBackgroundColor.ignoresSafeArea(edges: .bottom))
|
||||
.frame(width: totalColumnWidth)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topTrailing)
|
||||
// Toggle only: fade with the video growing over it (and
|
||||
// back in as it shrinks). Drag hides keep the panel solid
|
||||
// — the finger drives the edge, the panel is uncovered
|
||||
.opacity(isPanelVisible ? 1 : 0)
|
||||
.animation(isPanelDragActive ? nil : .easeInOut(duration: panelToggleDuration), value: panelToggleGeneration)
|
||||
.allowsHitTesting(showsSideColumn)
|
||||
.accessibilityHidden(!showsSideColumn)
|
||||
}
|
||||
@@ -415,6 +420,8 @@ struct CornerPlayerLayout<PlayerContent: View>: View {
|
||||
.animation(isPanelDragActive ? nil : .spring(response: 0.3, dampingFraction: 0.8), value: isBelowPanelExpanded)
|
||||
.animation(isPanelDragActive ? nil : .spring(response: 0.3, dampingFraction: 0.8), value: belowPanelExpandOffset)
|
||||
.animation(isPanelDragActive ? nil : .spring(response: 0.3, dampingFraction: 1.0), value: playerState?.displayAspectRatio)
|
||||
// Toggle only: fade with the video (see the column)
|
||||
.opacity(isPanelVisible ? 1 : 0)
|
||||
.animation(isPanelDragActive ? nil : .easeInOut(duration: panelToggleDuration), value: panelToggleGeneration)
|
||||
.animation(isPanelDragActive ? nil : .spring(response: 0.3, dampingFraction: 1.0), value: sideColumnDragOffset)
|
||||
.zIndex(isBelowPanelRaised ? 2 : 0)
|
||||
|
||||
Reference in New Issue
Block a user