|
|
@ -185,7 +185,7 @@ |
|
|
|
<div class="container"> |
|
|
|
<div class="container"> |
|
|
|
<div style="padding: 80px 150px 0; height: 160px;"> |
|
|
|
<div style="padding: 80px 150px 0; height: 160px;"> |
|
|
|
<a class="logo" href="https://github.com/RubaXa/Sortable"><img src="st/logo.png"/></a> |
|
|
|
<a class="logo" href="https://github.com/RubaXa/Sortable"><img src="st/logo.png"/></a> |
|
|
|
<h1 class="layer" data-force="40" data-force-y="2.5">The JavaScript library for modern browsers and touch devices. No jQuery.</h1> |
|
|
|
<h1 data-force="40" data-force-y="2.5">The JavaScript library for modern browsers and touch devices. No jQuery.</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -378,6 +378,7 @@ sort.destroy(); |
|
|
|
y = evt.clientY; |
|
|
|
y = evt.clientY; |
|
|
|
}, false); |
|
|
|
}, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('mousemove', function (evt){ |
|
|
|
document.addEventListener('mousemove', function (evt){ |
|
|
|
x = evt.clientX; |
|
|
|
x = evt.clientX; |
|
|
|
y = evt.clientY; |
|
|
|
y = evt.clientY; |
|
|
@ -385,22 +386,24 @@ sort.destroy(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function _loop(){ |
|
|
|
(function _loop(){ |
|
|
|
var winWidth = window.innerWidth; |
|
|
|
if( x && y ){ |
|
|
|
var winHeight = window.innerHeight; |
|
|
|
var winWidth = window.innerWidth; |
|
|
|
var halfWidth = winWidth / 2; |
|
|
|
var winHeight = window.innerHeight; |
|
|
|
var halfHeight = winHeight / 2; |
|
|
|
var halfWidth = winWidth / 2; |
|
|
|
|
|
|
|
var halfHeight = winHeight / 2; |
|
|
|
var rx = x - winWidth/2; |
|
|
|
|
|
|
|
var ry = winHeight/2 - y; |
|
|
|
var rx = x - winWidth/2; |
|
|
|
|
|
|
|
var ry = winHeight/2 - y; |
|
|
|
items.forEach(function (el){ |
|
|
|
|
|
|
|
var dx = el.w/el.fX * (rx / -halfWidth); |
|
|
|
items.forEach(function (el){ |
|
|
|
var dy = el.h/el.fY * (ry / halfHeight); |
|
|
|
var dx = el.w/el.fX * (rx / -halfWidth); |
|
|
|
el.style['transform'] = |
|
|
|
var dy = el.h/el.fY * (ry / halfHeight); |
|
|
|
el.style['-webkit-transform'] = 'translate('+dx+'px,'+dy+'px)'; |
|
|
|
el.style['transform'] = |
|
|
|
}); |
|
|
|
el.style['-webkit-transform'] = 'translate('+dx+'px,'+dy+'px)'; |
|
|
|
|
|
|
|
}); |
|
|
|
requestAnimationFrame(_loop); |
|
|
|
|
|
|
|
|
|
|
|
requestAnimationFrame(_loop); |
|
|
|
|
|
|
|
} |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|