mirror of
https://github.com/micku7zu/vanilla-tilt.js
synced 2024-06-22 07:16:27 +02:00
Update readme
This commit is contained in:
parent
1e20d05f5e
commit
449e86912f
38
README.md
38
README.md
|
@ -1,32 +1,31 @@
|
|||
# vanilla-tilt.js
|
||||
Rewritten from [Tilt.js](https://github.com/gijsroge/tilt.js).
|
||||
**All copyright goes to [https://github.com/gijsroge/tilt.js](https://github.com/gijsroge/tilt.js)**
|
||||
A smooth 3D tilt javascript library forked from [Tilt.js (jQuery version)](https://github.com/gijsroge/tilt.js).
|
||||
|
||||
A tiny requestAnimationFrame powered 60+fps lightweight parallax tilt effect without any dependencies.
|
||||
![Tilt.js demo gif](http://gijsroge.github.io/tilt.js/tilt.js.gif)
|
||||
|
||||
####Take a look at the **[landing page](https://micku7zu.github.io/vanilla-tilt.js/index.html)** for demo's.
|
||||
[View landing page (demos)](https://micku7zu.github.io/vanilla-tilt.js/landing/index.html)
|
||||
|
||||
### Usage
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<body>
|
||||
<div data-tilt></div> <!-- Tilt element -->
|
||||
<script src="vanilla-tilt.js"></script> <!-- Load vanilla-tilt.js library -->
|
||||
<div class="your-element" data-tilt></div>
|
||||
|
||||
<!-- at the end of the body -->
|
||||
<script type="text/javascript" src="vanilla-tilt.js"></script>
|
||||
</body>
|
||||
```
|
||||
|
||||
### Options
|
||||
```js
|
||||
max: 35, //maxTilt
|
||||
perspective: 1000, // Transform perspective, the lower the more extreme the tilt gets.
|
||||
easing: "cubic-bezier(.03,.98,.52,.99)", // Easing on enter/exit.
|
||||
scale: 1, // 2 = 200%, 1.5 = 150%, etc..
|
||||
speed: 300, // Speed of the enter/exit transition.
|
||||
transition: true, // Set a transition on enter/exit.
|
||||
axis: null, // What axis should be disabled. Can be X or Y.
|
||||
reset: true // If the tilt effect has to be reset on exit.
|
||||
{
|
||||
max: 35, // max tilt rotation (degrees)
|
||||
perspective: 1000, // Transform perspective, the lower the more extreme the tilt gets.
|
||||
scale: 1, // 2 = 200%, 1.5 = 150%, etc..
|
||||
speed: 300, // Speed of the enter/exit transition
|
||||
transition: true, // Set a transition on enter/exit.
|
||||
axis: null, // What axis should be disabled. Can be X or Y.
|
||||
reset: true // If the tilt effect has to be reset on exit.
|
||||
easing: "cubic-bezier(.03,.98,.52,.99)", // Easing on enter/exit.
|
||||
}
|
||||
```
|
||||
|
||||
### Events
|
||||
|
@ -62,3 +61,8 @@ TO DO (automatically build those):
|
|||
* dest/vanilla-tilt.babel.min.js ~ 4.3kb
|
||||
|
||||
in your webiste.
|
||||
|
||||
|
||||
### License
|
||||
|
||||
MIT License
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Created by micku7zu on 1/27/2017.
|
||||
* Original idea: http://gijsroge.github.io/tilt.js/
|
||||
* Created by Șandor Sergiu (micku7zu) on 1/27/2017.
|
||||
* Original idea: https://github.com/gijsroge/tilt.js
|
||||
* MIT License.
|
||||
* Version 1.0.1
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue