mirror of
https://github.com/micku7zu/vanilla-tilt.js
synced 2024-06-10 09:42:11 +02:00
Update to 1.7.2
This commit is contained in:
parent
20f9edad9e
commit
ebcf46cec4
12
dist/vanilla-tilt.babel.js
vendored
12
dist/vanilla-tilt.babel.js
vendored
|
@ -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.1
|
||||
* Version 1.7.2
|
||||
*/
|
||||
|
||||
var VanillaTilt = function () {
|
||||
|
@ -370,19 +370,21 @@ var VanillaTilt = function () {
|
|||
"left": "50%",
|
||||
"pointer-events": "none",
|
||||
"background-image": "linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",
|
||||
"width": this.element.offsetWidth * 2 + "px",
|
||||
"height": this.element.offsetWidth * 2 + "px",
|
||||
"transform": "rotate(180deg) translate(-50%, -50%)",
|
||||
"transform-origin": "0% 0%",
|
||||
"opacity": "0"
|
||||
});
|
||||
|
||||
this.updateGlareSize();
|
||||
};
|
||||
|
||||
VanillaTilt.prototype.updateGlareSize = function updateGlareSize() {
|
||||
if (this.glare) {
|
||||
var glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
|
||||
Object.assign(this.glareElement.style, {
|
||||
"width": "" + this.element.offsetWidth * 2,
|
||||
"height": "" + this.element.offsetWidth * 2
|
||||
"width": glareSize + "px",
|
||||
"height": glareSize + "px"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
2
dist/vanilla-tilt.babel.min.js
vendored
2
dist/vanilla-tilt.babel.min.js
vendored
File diff suppressed because one or more lines are too long
13
dist/vanilla-tilt.js
vendored
13
dist/vanilla-tilt.js
vendored
|
@ -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.1
|
||||
* Version 1.7.2
|
||||
*/
|
||||
|
||||
class VanillaTilt {
|
||||
|
@ -55,6 +55,7 @@ class VanillaTilt {
|
|||
}
|
||||
|
||||
this.addEventListeners();
|
||||
this.reset();
|
||||
this.updateInitialPosition();
|
||||
}
|
||||
|
||||
|
@ -358,19 +359,21 @@ class VanillaTilt {
|
|||
"left": "50%",
|
||||
"pointer-events": "none",
|
||||
"background-image": `linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)`,
|
||||
"width": `${this.element.offsetWidth * 2}px`,
|
||||
"height": `${this.element.offsetWidth * 2}px`,
|
||||
"transform": "rotate(180deg) translate(-50%, -50%)",
|
||||
"transform-origin": "0% 0%",
|
||||
"opacity": "0",
|
||||
});
|
||||
|
||||
this.updateGlareSize();
|
||||
}
|
||||
|
||||
updateGlareSize() {
|
||||
if (this.glare) {
|
||||
const glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
|
||||
Object.assign(this.glareElement.style, {
|
||||
"width": `${this.element.offsetWidth * 2}`,
|
||||
"height": `${this.element.offsetWidth * 2}`,
|
||||
"width": `${glareSize}px`,
|
||||
"height": `${glareSize}px`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
2
dist/vanilla-tilt.min.js
vendored
2
dist/vanilla-tilt.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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.1
|
||||
* Version 1.7.2
|
||||
*/
|
||||
|
||||
class VanillaTilt {
|
||||
|
@ -356,19 +356,21 @@ class VanillaTilt {
|
|||
"left": "50%",
|
||||
"pointer-events": "none",
|
||||
"background-image": `linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)`,
|
||||
"width": `${this.element.offsetWidth * 2}px`,
|
||||
"height": `${this.element.offsetWidth * 2}px`,
|
||||
"transform": "rotate(180deg) translate(-50%, -50%)",
|
||||
"transform-origin": "0% 0%",
|
||||
"opacity": "0",
|
||||
});
|
||||
|
||||
this.updateGlareSize();
|
||||
}
|
||||
|
||||
updateGlareSize() {
|
||||
if (this.glare) {
|
||||
const glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
|
||||
Object.assign(this.glareElement.style, {
|
||||
"width": `${this.element.offsetWidth * 2}`,
|
||||
"height": `${this.element.offsetWidth * 2}`,
|
||||
"width": `${glareSize}px`,
|
||||
"height": `${glareSize}px`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.1
|
||||
* Version 1.7.2
|
||||
*/
|
||||
|
||||
var VanillaTilt = function () {
|
||||
|
@ -369,19 +369,21 @@ var VanillaTilt = function () {
|
|||
"left": "50%",
|
||||
"pointer-events": "none",
|
||||
"background-image": "linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",
|
||||
"width": this.element.offsetWidth * 2 + "px",
|
||||
"height": this.element.offsetWidth * 2 + "px",
|
||||
"transform": "rotate(180deg) translate(-50%, -50%)",
|
||||
"transform-origin": "0% 0%",
|
||||
"opacity": "0"
|
||||
});
|
||||
|
||||
this.updateGlareSize();
|
||||
};
|
||||
|
||||
VanillaTilt.prototype.updateGlareSize = function updateGlareSize() {
|
||||
if (this.glare) {
|
||||
var glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
|
||||
Object.assign(this.glareElement.style, {
|
||||
"width": "" + this.element.offsetWidth * 2,
|
||||
"height": "" + this.element.offsetWidth * 2
|
||||
"width": glareSize + "px",
|
||||
"height": glareSize + "px"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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.1
|
||||
* Version 1.7.2
|
||||
*/
|
||||
|
||||
export default class VanillaTilt {
|
||||
|
@ -350,27 +350,27 @@ export default class VanillaTilt {
|
|||
"pointer-events": "none"
|
||||
});
|
||||
|
||||
const glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
Object.assign(this.glareElement.style, {
|
||||
"position": "absolute",
|
||||
"top": "50%",
|
||||
"left": "50%",
|
||||
"pointer-events": "none",
|
||||
"background-image": `linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)`,
|
||||
"width": `${glareSize}px`,
|
||||
"height": `${glareSize}px`,
|
||||
"transform": "rotate(180deg) translate(-50%, -50%)",
|
||||
"transform-origin": "0% 0%",
|
||||
"opacity": "0",
|
||||
});
|
||||
|
||||
this.updateGlareSize();
|
||||
}
|
||||
|
||||
updateGlareSize() {
|
||||
if (this.glare) {
|
||||
const glareSize = (this.element.offsetWidth > this.element.offsetHeight ? this.element.offsetWidth : this.element.offsetHeight) * 2;
|
||||
|
||||
Object.assign(this.glareElement.style, {
|
||||
"width": `${glareSize}`,
|
||||
"height": `${glareSize}`,
|
||||
"width": `${glareSize}px`,
|
||||
"height": `${glareSize}px`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue