You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
 |  |  |  | 
12
12
--- | --- | --- | --- | ---
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
+
structContentView: View {
28
+
@Statevar 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
+
<imgsrc="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
+
<imgsrc="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
0 commit comments