Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuao/yudisplacementtransition
A GPU accelerated transition library makes use of displacement maps to create distortion effects.
https://github.com/yuao/yudisplacementtransition
displacement-map distortion distortion-effects gpu ios metal opengl transition
Last synced: 23 days ago
JSON representation
A GPU accelerated transition library makes use of displacement maps to create distortion effects.
- Host: GitHub
- URL: https://github.com/yuao/yudisplacementtransition
- Owner: YuAo
- License: mit
- Created: 2019-01-06T13:23:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-27T03:44:10.000Z (over 5 years ago)
- Last Synced: 2024-05-01T21:19:11.505Z (6 months ago)
- Topics: displacement-map, distortion, distortion-effects, gpu, ios, metal, opengl, transition
- Language: Swift
- Homepage:
- Size: 3.33 MB
- Stars: 135
- Watchers: 5
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YUDisplacementTransition
[![Version](https://img.shields.io/cocoapods/v/YUDisplacementTransition.svg?style=flat)](https://cocoapods.org/pods/YUDisplacementTransition)
[![License](https://img.shields.io/cocoapods/l/YUDisplacementTransition.svg?style=flat)](https://cocoapods.org/pods/YUDisplacementTransition)
[![Platform](https://img.shields.io/cocoapods/p/YUDisplacementTransition.svg?style=flat)](https://cocoapods.org/pods/YUDisplacementTransition)A GPU accelerated transition library which makes use of displacement maps to create distortion effects.
Inspired by [hover-effect](https://github.com/robin-dela/hover-effect).
Built with [MetalPetal](https://github.com/MetalPetal/MetalPetal).
## Example
To run the example project, clone the repo, and run `pod install` from the `Example` directory first.
## Usage
### Displacement Map
A displacement map is a image file used to create distortion effects for the transition.
### YUDisplacementTransition.Options
`displacementIntensity` Intensity of the distortion effect.
`duration` Transition duration.
`timingFunction` Timing function for the transition. Defaults: `CubicEaseOut`. More timing functions can be found at [AHEasing](https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c).
`angle` The angle applied to the distortion effect, in radian.
### YUViewControllerDisplacementTransition
Conforms to `UIViewControllerAnimatedTransitioning` protocol, can be used in view controller transitions.
### YUCGImageDisplacementTransition
Can be used to transition between two `CGImage`s.
### YUDisplacementTransition
Can be used to transition between two `MTIImage`s.
## Installation
YUDisplacementTransition is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'YUDisplacementTransition'
```## Credits
Robin Dela for the javascript library [hover-effect](https://github.com/robin-dela/hover-effect).
Photos from [Unsplash](https://unsplash.com/).
[Live demo](https://tympanus.net/Development/DistortionHoverEffect/) by Codrops.
## License
YUDisplacementTransition is available under the MIT license. See the LICENSE file for more info.