Skip to content

Commit 565d3de

Browse files
committed
Update readme
1 parent 8f1be89 commit 565d3de

File tree

5 files changed

+92
-2
lines changed

5 files changed

+92
-2
lines changed

Assets/Example.png

484 KB
Loading

Assets/Find.mp4

4.32 MB
Binary file not shown.

Assets/Result.png

23.3 KB
Loading

Example/PrismExample/PrismExample/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct ExampleSliderView: View {
4949
var body: some View {
5050
GridRow {
5151
Text(title)
52-
.gridColumnAlignment(.leading)
52+
.gridColumnAlignment(.leading)#imageLiteral(resourceName: "simulator_screenshot_B59F966E-3178-4089-A417-356509865257.png")
5353
.padding(.vertical, 6)
5454

5555
Slider(value: $value, in: range)

README.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,95 @@ A lightweight 3D renderer for SwiftUI.
88
- 100% SwiftUI. No SceneKit or other weird stuff.
99
- Supports sizing, extrusion, levitation, and more.
1010

11-
![](Assets/Logo.png) | ![](Assets/Transform.gif) | ![](Assets/Bounce.gif) | ![](Assets/Gradient.png) | ![](Assets/Image.png)
11+
![Logo cube](Assets/Logo.png) | ![Square that animates into a cube, with border](Assets/Transform.gif) | ![3 green cubes that bounce on click](Assets/Bounce.gif) | ![Thin, levitating blue prism](Assets/Gradient.png) | ![Prism with an image on each side](Assets/Image.png)
1212
--- | --- | --- | --- | ---
13+
14+
## Installation
15+
16+
Requires iOS 13+. Prism can be installed through the [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).
17+
18+
```
19+
https://github.com/aheze/Prism
20+
```
21+
22+
## Usage
23+
24+
Prism is designed to be easy to use. First, define a `PrismConfiguration` for customization. Then just add a `PrismCanvas`, which can contain as many `PrismView`s as you'd like.
25+
26+
```swift
27+
struct ContentView: View {
28+
@State var configuration = PrismConfiguration(
29+
tilt: 0.5, /// A value from 0 to 1, representing the perspective.
30+
size: CGSize(width: 200, height: 200), /// How big the prism is.
31+
extrusion: 100, /// The z height.
32+
levitation: 20, /// How far the prism is from the ground.
33+
shadowColor: Color.black, /// A dynamic shadow that's rendered underneath the prism.
34+
shadowOpacity: 0.25 /// The strength of the shadow.
35+
)
36+
37+
var body: some View {
38+
PrismCanvas(tilt: configuration.tilt) {
39+
PrismView(configuration: configuration) {
40+
Color.blue
41+
} left: {
42+
Color.red
43+
} right: {
44+
Color.green
45+
}
46+
}
47+
}
48+
}
49+
```
50+
51+
<img src="Assets/Result.png" width="300" alt="Result, a multicolored cube">
52+
53+
## Example
54+
55+
Includes various samples of the library. [Download](https://github.com/aheze/Prism/archive/refs/heads/main.zip) it here!
56+
57+
<img src="Assets/Example.png" width="300" alt="Screenshot of example app">
58+
59+
60+
## Community
61+
### Author
62+
Popovers is made by [aheze](https://github.com/aheze).
63+
64+
### Contributing
65+
All contributions are welcome. Just [fork](https://github.com/aheze/Prism/fork) the repo, then make a pull request.
66+
67+
### Need Help?
68+
Open an [issue](https://github.com/aheze/Prism/issues) or join the [Discord server](https://discord.com/invite/Pmq8fYcus2). You can also ping me on [Twitter](https://twitter.com/aheze0). Or read the source code — there's lots of comments.
69+
70+
### Apps Using Popovers
71+
72+
[Find](http://getfind.app/) is an app that lets you find text in real life. Popovers is currently used for the search bar settings and the camera message view — download to check it out!
73+
74+
75+
76+
If you have an app that uses Popovers, just make a PR or [message me](https://twitter.com/aheze0).
77+
78+
## License
79+
80+
```
81+
MIT License
82+
83+
Copyright (c) 2022 A. Zheng
84+
85+
Permission is hereby granted, free of charge, to any person obtaining a copy
86+
of this software and associated documentation files (the "Software"), to deal
87+
in the Software without restriction, including without limitation the rights
88+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89+
copies of the Software, and to permit persons to whom the Software is
90+
furnished to do so, subject to the following conditions:
91+
92+
The above copyright notice and this permission notice shall be included in all
93+
copies or substantial portions of the Software.
94+
95+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
97+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
98+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
101+
SOFTWARE.
102+
```

0 commit comments

Comments
 (0)