-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrea
authored and
Andrea
committed
Aug 30, 2023
1 parent
4d185f4
commit 6c61890
Showing
3 changed files
with
73 additions
and
0 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
65 changes: 65 additions & 0 deletions
65
PartialSheet-Example/Shared/Examples/GradientSheetExample.swift
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,65 @@ | ||
// | ||
// BlurredSheetExample.swift | ||
// PartialSheetExample | ||
// | ||
// Created by Rasmus Styrk on 14/08/2020. | ||
// Copyright © 2020 Swift. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import PartialSheet | ||
|
||
struct GradientExample: View { | ||
@State var isSheetPresented = false | ||
let iPhoneStyle = PSIphoneStyle( | ||
background: .gradient(LinearGradient(colors: [.red, .yellow], startPoint: .bottom, endPoint: .top)), | ||
handleBarStyle: .solid(.secondary), | ||
cover: .enabled(Color.black.opacity(0.4)), | ||
cornerRadius: 10 | ||
) | ||
|
||
var body: some View { | ||
VStack { | ||
Spacer() | ||
PSButton( | ||
isPresenting: $isSheetPresented, | ||
label: { | ||
Text("Display the GrdientExample Sheet") | ||
}) | ||
.padding() | ||
Spacer() | ||
} | ||
.navigationBarTitle("Gradient Example") | ||
.partialSheet(isPresented: $isSheetPresented, | ||
type: .scrollView(height: 300, showsIndicators: false), | ||
iPhoneStyle: iPhoneStyle, | ||
content: GradeintSheetView.init) | ||
} | ||
} | ||
|
||
struct GradientExample_Previews: PreviewProvider { | ||
static var previews: some View { | ||
NavigationView { | ||
BlurredExample() | ||
} | ||
.navigationViewStyle(StackNavigationViewStyle()) | ||
.attachPartialSheetToRoot() | ||
|
||
} | ||
} | ||
|
||
struct GradeintSheetView: View { | ||
@State private var selectedStrength = 0 | ||
|
||
var body: some View { | ||
VStack(alignment: .center, spacing: 20) { | ||
Text("Settings Panel").font(.headline).foregroundColor(Color.primary) | ||
Group { | ||
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vestibulum porttitor ligula quis faucibus. Maecenas auctor tincidunt maximus. Donec lectus dui, fermentum sed orci gravida, porttitor porta dui. Fusce ut diam et diam venenatis molestie vel vel augue. Mauris at mauris porta, auctor lorem et, efficitur lacus.") | ||
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vestibulum porttitor ligula quis faucibus. Maecenas auctor tincidunt maximus. Donec lectus dui, fermentum sed orci gravida, porttitor porta dui. Fusce ut diam et diam venenatis molestie vel vel augue. Mauris at mauris porta, auctor lorem et, efficitur lacus.") | ||
} | ||
.font(.subheadline).foregroundColor(Color.primary) | ||
} | ||
.padding() | ||
} | ||
} |