Skip to content

Commit

Permalink
Fix first interaction skew big distortion and update to 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
micku7zu committed Jul 28, 2021
1 parent d9b26fa commit 4a64426
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion dist/vanilla-tilt.babel.js
Expand Up @@ -11,7 +11,7 @@ var classCallCheck = function (instance, Constructor) {
* Created by Sergiu Șandor (micku7zu) on 1/27/2017.
* Original idea: https://github.com/gijsroge/tilt.js
* MIT License.
* Version 1.7.0
* Version 1.7.1
*/

var VanillaTilt = function () {
Expand Down Expand Up @@ -64,6 +64,7 @@ var VanillaTilt = function () {
}

this.addEventListeners();
this.reset();
this.updateInitialPosition();
}

Expand Down
2 changes: 1 addition & 1 deletion dist/vanilla-tilt.babel.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vanilla-tilt.js
Expand Up @@ -5,7 +5,7 @@ var VanillaTilt = (function () {
* Created by Sergiu Șandor (micku7zu) on 1/27/2017.
* Original idea: https://github.com/gijsroge/tilt.js
* MIT License.
* Version 1.7.0
* Version 1.7.1
*/

class VanillaTilt {
Expand Down
2 changes: 1 addition & 1 deletion dist/vanilla-tilt.min.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions lib/README.md
@@ -1,7 +1,6 @@
# vanilla-tilt.js

[![npm version](https://badge.fury.io/js/vanilla-tilt.svg)](https://badge.fury.io/js/vanilla-tilt)
[![ghit.me](https://ghit.me/badge.svg?repo=micku7zu/vanilla-tilt.js)](https://ghit.me/repo/micku7zu/vanilla-tilt.js)

A smooth 3D tilt javascript library forked from [Tilt.js (jQuery version)](https://github.com/gijsroge/tilt.js).

Expand All @@ -11,6 +10,8 @@ A smooth 3D tilt javascript library forked from [Tilt.js (jQuery version)](https

```html
<body>

<!-- your markup element -->
<div class="your-element" data-tilt></div>

<!-- at the end of the body -->
Expand All @@ -23,7 +24,7 @@ If you want to use this library in IE, you need to include a CustomEvent polyfil
```js
{
reverse: false, // reverse the tilt direction
max: 35, // max tilt rotation (degrees)
max: 15, // max tilt rotation (degrees)
startX: 0, // the starting tilt on the X axis, in degrees.
startY: 0, // the starting tilt on the Y axis, in degrees.
perspective: 1000, // Transform perspective, the lower the more extreme the tilt gets.
Expand Down Expand Up @@ -77,10 +78,10 @@ VanillaTilt.init(elements);
### Install
You can copy and include any of the following file:

* [dist/vanilla-tilt.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.js) ~ 6kb
* [dist/vanilla-tilt.min.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.min.js) ~ 3.5kb
* [dist/vanilla-tilt.babel.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.babel.js) ~ 8.5kb
* [dist/vanilla-tilt.babel.min.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.babel.min.js) ~ 4.3kb
* [dist/vanilla-tilt.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.js) ~ 15kb
* [dist/vanilla-tilt.min.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.min.js) ~ 8.5kb
* [dist/vanilla-tilt.babel.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.babel.js) ~ 16.5kb
* [dist/vanilla-tilt.babel.min.js](https://raw.githubusercontent.com/micku7zu/vanilla-tilt.js/master/dist/vanilla-tilt.babel.min.js) ~ 9.5kb

#### NPM

Expand All @@ -96,6 +97,9 @@ Import it using
import VanillaTilt from 'vanilla-tilt';
```

### Known issues
- [Getting weird rendering issues on Safari](https://github.com/micku7zu/vanilla-tilt.js/issues/22)

### Credits

Original library: [Tilt.js](http://gijsroge.github.io/tilt.js/)
Expand Down
3 changes: 2 additions & 1 deletion lib/vanilla-tilt.es2015.js
Expand Up @@ -2,7 +2,7 @@
* Created by Sergiu Șandor (micku7zu) on 1/27/2017.
* Original idea: https://github.com/gijsroge/tilt.js
* MIT License.
* Version 1.7.0
* Version 1.7.1
*/

class VanillaTilt {
Expand Down Expand Up @@ -52,6 +52,7 @@ class VanillaTilt {
}

this.addEventListeners();
this.reset();
this.updateInitialPosition();
}

Expand Down
3 changes: 2 additions & 1 deletion lib/vanilla-tilt.js
Expand Up @@ -10,7 +10,7 @@ var classCallCheck = function (instance, Constructor) {
* Created by Sergiu Șandor (micku7zu) on 1/27/2017.
* Original idea: https://github.com/gijsroge/tilt.js
* MIT License.
* Version 1.7.0
* Version 1.7.1
*/

var VanillaTilt = function () {
Expand Down Expand Up @@ -63,6 +63,7 @@ var VanillaTilt = function () {
}

this.addEventListeners();
this.reset();
this.updateInitialPosition();
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vanilla-tilt",
"version": "1.7.0",
"version": "1.7.1",
"description": "A smooth 3D tilt javascript library forked from Tilt.js",
"main": "lib/vanilla-tilt.js",
"module_es2015": "lib/vanilla-tilt.es2015.js",
Expand Down
3 changes: 2 additions & 1 deletion src/vanilla-tilt.js
Expand Up @@ -2,7 +2,7 @@
* Created by Sergiu Șandor (micku7zu) on 1/27/2017.
* Original idea: https://github.com/gijsroge/tilt.js
* MIT License.
* Version 1.7.0
* Version 1.7.1
*/

export default class VanillaTilt {
Expand Down Expand Up @@ -52,6 +52,7 @@ export default class VanillaTilt {
}

this.addEventListeners();
this.reset();
this.updateInitialPosition();
}

Expand Down
2 changes: 0 additions & 2 deletions test/index.html
Expand Up @@ -129,8 +129,6 @@
data-tilt-scale="1.1"
data-tilt-perspective="500"
data-tilt-max="15"
data-tilt-startX="15"
data-tilt-startY="10"
data-tilt-scale="1.1"
>
<span>vanilla-tilt.js</span>
Expand Down

0 comments on commit 4a64426

Please sign in to comment.