Skip to content

Commit

Permalink
feat: Create BottomMask Modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercen-Lee committed Apr 2, 2024
1 parent a64ae42 commit f77a6e4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Source/DDS/Component/ScrollView/Extension/ScrollView+ViewExt.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import SwiftUI

@available(macOS 12, iOS 15, *)
public extension View {

@ViewBuilder
func bottomMask() -> some View {
self
.mask(alignment: .bottom) {
VStack(spacing: 0) {
Color.black
LinearGradient(
colors: [.black, .clear],
startPoint: .top,
endPoint: .bottom
)
.frame(height: 150)
}
.ignoresSafeArea(edges: .top)
}
}
}

0 comments on commit f77a6e4

Please sign in to comment.