Update readme

This commit is contained in:
micku7zu 2017-01-29 14:10:55 +02:00
parent 1e20d05f5e
commit 449e86912f
2 changed files with 23 additions and 19 deletions

View file

@ -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

View file

@ -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
*/