Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aheze committed Sep 27, 2022
1 parent b936d0d commit c066838
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 8 deletions.
Binary file added Assets/Bounce.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Customization.mp4
Binary file not shown.
Binary file added Assets/Gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Transform.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions Example/PrismExample/PrismExample/Templates/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ struct DetailView<Content: View, Controls: View>: View {
@ViewBuilder var content: (PrismConfiguration) -> Content
@ViewBuilder var controls: Controls

@State var configuration = PrismConfiguration()
@Environment(\.verticalSizeClass) var verticalSizeClass
@State var configuration = PrismConfiguration()
@State var keepCentered = false



var body: some View {
let layout = verticalSizeClass == .regular
Expand All @@ -25,6 +28,7 @@ struct DetailView<Content: View, Controls: View>: View {
PrismCanvas(tilt: configuration.tilt) {
content(configuration)
}
.offset(y: keepCentered ? configuration.levitation : 0)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(UIColor.systemBackground.color)
.cornerRadius(16)
Expand All @@ -45,13 +49,21 @@ struct DetailView<Content: View, Controls: View>: View {
sliders

GridRow {
Button("Randomize") {
randomize()
}
.buttonStyle(.borderedProminent)
Text("Center")

Color.clear
.gridCellUnsizedAxes(.horizontal)
HStack {
Toggle("", isOn: $keepCentered)
.labelsHidden()
.frame(maxWidth: .infinity, alignment: .leading)

Button("Randomize") {
randomize()
}
.buttonStyle(.borderedProminent)
}
//
// Color.clear
// .gridCellUnsizedAxes(.horizontal)
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Prism

A description of this package.
A lightweight 3D renderer for SwiftUI.

- Works with any SwiftUI `View`.
- Fully interactive and animatable.
- Powered by perspective transforms.
- 100% SwiftUI. No SceneKit or other weird stuff.
- Supports sizing, extrusion, levitation, and more.





![](Assets/Transform.gif) | ![](Assets/Bounce.gif)
--- | ---
![](Assets/Gradient.png) | ![](Assets/Image.png)

0 comments on commit c066838

Please sign in to comment.