first commit
This commit is contained in:
BIN
resources/assets/vendor/hover3d/dist/images/deadpool-bg.png
vendored
Normal file
BIN
resources/assets/vendor/hover3d/dist/images/deadpool-bg.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
BIN
resources/assets/vendor/hover3d/dist/images/deadpool-title.png
vendored
Normal file
BIN
resources/assets/vendor/hover3d/dist/images/deadpool-title.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
resources/assets/vendor/hover3d/dist/images/deadpool.png
vendored
Normal file
BIN
resources/assets/vendor/hover3d/dist/images/deadpool.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 KiB |
BIN
resources/assets/vendor/hover3d/dist/images/hover3d.png
vendored
Normal file
BIN
resources/assets/vendor/hover3d/dist/images/hover3d.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
137
resources/assets/vendor/hover3d/dist/js/jquery.hover3d.js
vendored
Normal file
137
resources/assets/vendor/hover3d/dist/js/jquery.hover3d.js
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
jQuery Hover3d
|
||||
=================================================
|
||||
Version: 1.1.0
|
||||
Author: Rian Ariona
|
||||
Website: http://ariona.net
|
||||
Docs: http://ariona.github.io/hover3d
|
||||
Repo: http://github.com/ariona/hover3d
|
||||
Issues: http://github.com/ariona/hover3d/issues
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
$.fn.hover3d = function(options){
|
||||
|
||||
var settings = $.extend({
|
||||
selector : null,
|
||||
perspective : 1000,
|
||||
sensitivity : 20,
|
||||
invert : false,
|
||||
shine : false,
|
||||
hoverInClass : "hover-in",
|
||||
hoverOutClass : "hover-out",
|
||||
hoverClass : "hover-3d"
|
||||
}, options);
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var $this = $(this),
|
||||
$card = $this.find(settings.selector);
|
||||
currentX = 0;
|
||||
currentY = 0;
|
||||
|
||||
|
||||
if( settings.shine ){
|
||||
$card.append('<div class="shine"></div>');
|
||||
}
|
||||
var $shine = $(this).find(".shine");
|
||||
|
||||
// Set perspective and transformStyle value
|
||||
// for element and 3d object
|
||||
$this.css({
|
||||
perspective: settings.perspective+"px",
|
||||
transformStyle: "preserve-3d"
|
||||
});
|
||||
|
||||
$card.css({
|
||||
perspective: settings.perspective+"px",
|
||||
transformStyle: "preserve-3d",
|
||||
});
|
||||
|
||||
$shine.css({
|
||||
position : "absolute",
|
||||
top : 0,
|
||||
left : 0,
|
||||
bottom : 0,
|
||||
right : 0,
|
||||
transform : 'translateZ(1px)',
|
||||
"z-index" : 9
|
||||
});
|
||||
|
||||
// Mouse Enter function, this will add hover-in
|
||||
// Class so when mouse over it will add transition
|
||||
// based on hover-in class
|
||||
function enter(event){
|
||||
$card.addClass(settings.hoverInClass+" "+settings.hoverClass);
|
||||
currentX = currentY = 0;
|
||||
setTimeout(function(){
|
||||
$card.removeClass(settings.hoverInClass);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// Mouse movement Parallax effect
|
||||
function move(event){
|
||||
|
||||
var w = $card.innerWidth(),
|
||||
h = $card.innerHeight(),
|
||||
currentX = Math.round(event.pageX - $card.offset().left),
|
||||
currentY = Math.round(event.pageY - $card.offset().top),
|
||||
ax = settings.invert ? ( w / 2 - currentX)/settings.sensitivity : -( w / 2 - currentX)/settings.sensitivity,
|
||||
ay = settings.invert ? -( h / 2 - currentY)/settings.sensitivity : ( h / 2 - currentY)/settings.sensitivity,
|
||||
dx = currentX - w / 2,
|
||||
dy = currentY - h / 2,
|
||||
theta = Math.atan2(dy, dx),
|
||||
angle = theta * 180 / Math.PI - 90;
|
||||
|
||||
|
||||
if (angle < 0) {
|
||||
angle = angle + 360;
|
||||
}
|
||||
|
||||
|
||||
$card.css({
|
||||
perspective : settings.perspective+"px",
|
||||
transformStyle : "preserve-3d",
|
||||
transform : "rotateY("+ax+"deg) rotateX("+ay+"deg)"
|
||||
});
|
||||
|
||||
$shine.css('background', 'linear-gradient(' + angle + 'deg, rgba(255,255,255,' + event.offsetY / h * .5 + ') 0%,var(--light-rgba-0) 80%)');
|
||||
}
|
||||
|
||||
// Mouse leave function, will set the transform
|
||||
// property to 0, and add transition class
|
||||
// for exit animation
|
||||
function leave(){
|
||||
$card.addClass(settings.hoverOutClass+" "+settings.hoverClass);
|
||||
$card.css({
|
||||
perspective : settings.perspective+"px",
|
||||
transformStyle : "preserve-3d",
|
||||
transform : "rotateX(0) rotateY(0)"
|
||||
});
|
||||
setTimeout( function(){
|
||||
$card.removeClass(settings.hoverOutClass+" "+settings.hoverClass);
|
||||
currentX = currentY = 0;
|
||||
}, 1000 );
|
||||
}
|
||||
|
||||
// Mouseenter event binding
|
||||
$this.on( "mouseenter", function(){
|
||||
return enter();
|
||||
});
|
||||
|
||||
// Mousemove event binding
|
||||
$this.on( "mousemove", function(event){
|
||||
return move(event);
|
||||
});
|
||||
|
||||
// Mouseleave event binding
|
||||
$this.on( "mouseleave", function(){
|
||||
return leave();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}(jQuery));
|
1
resources/assets/vendor/hover3d/dist/js/jquery.hover3d.min.js
vendored
Normal file
1
resources/assets/vendor/hover3d/dist/js/jquery.hover3d.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(e){e.fn.hover3d=function(t){var r=e.extend({selector:null,perspective:1e3,sensitivity:20,invert:!1,shine:!1,hoverInClass:"hover-in",hoverOutClass:"hover-out",hoverClass:"hover-3d"},t);return this.each(function(){function t(e){i.addClass(r.hoverInClass+" "+r.hoverClass),currentX=currentY=0,setTimeout(function(){i.removeClass(r.hoverInClass)},1e3)}function s(e){var t=i.innerWidth(),s=i.innerHeight(),n=Math.round(e.pageX-i.offset().left),o=Math.round(e.pageY-i.offset().top),v=r.invert?(t/2-n)/r.sensitivity:-(t/2-n)/r.sensitivity,c=r.invert?-(s/2-o)/r.sensitivity:(s/2-o)/r.sensitivity,u=n-t/2,p=o-s/2,f=Math.atan2(p,u),h=180*f/Math.PI-90;0>h&&(h+=360),i.css({perspective:r.perspective+"px",transformStyle:"preserve-3d",transform:"rotateY("+v+"deg) rotateX("+c+"deg)"}),a.css("background","linear-gradient("+h+"deg, rgba(255,255,255,"+e.offsetY/s*.5+") 0%,var(--light-rgba-0) 80%)")}function n(){i.addClass(r.hoverOutClass+" "+r.hoverClass),i.css({perspective:r.perspective+"px",transformStyle:"preserve-3d",transform:"rotateX(0) rotateY(0)"}),setTimeout(function(){i.removeClass(r.hoverOutClass+" "+r.hoverClass),currentX=currentY=0},1e3)}var o=e(this),i=o.find(r.selector);currentX=0,currentY=0,r.shine&&i.append('<div class="shine"></div>');var a=e(this).find(".shine");o.css({perspective:r.perspective+"px",transformStyle:"preserve-3d"}),i.css({perspective:r.perspective+"px",transformStyle:"preserve-3d"}),a.css({position:"absolute",top:0,left:0,bottom:0,right:0,transform:"translateZ(1px)","z-index":9}),o.on("mouseenter",function(){return t()}),o.on("mousemove",function(e){return s(e)}),o.on("mouseleave",function(){return n()})})}}(jQuery);
|
5
resources/assets/vendor/hover3d/dist/js/vendor/jquery-1.12.1.min.js
vendored
Normal file
5
resources/assets/vendor/hover3d/dist/js/vendor/jquery-1.12.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user