samuel-philipp.de/index-v2.html

84 lines
2.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Samuel Philipp</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="img/samuel.png">
<link rel="stylesheet" href="css/app.css" type="text/css" media="screen"/>
<script type="text/javascript" src="js/vendor/jquery-2.2.4.min.js"></script>
<!--<script type="text/javascript" src="js/vendor/jquery.easing.min.js"></script>-->
<!--<script type="text/javascript" src="js/vendor/jquery.flip.min.js"></script>-->
<!--<script type="text/javascript" src="js/app.js"></script>-->
<style type="text/css">
body {
padding: 0;
margin: 0;
}
.image {
background-repeat: no-repeat;
background-position: center center;
/*background-attachment: fixed;*/
background-size: cover;
position: fixed;
top: -25px;
left: -25px;
width: calc(100% + 50px);
height: calc(100% + 50px);
z-index: 0;
}
#top-image {
background-image: url('img/sp-codes.png');
}
#topper-image {
background-image: url('img/samuel-philipp_v2-overlay.png');
}
</style>
<script type="application/javascript">
$(document).ready(function () {
document.addEventListener('touchmove', function (event) {
event.preventDefault();
var e = event.touches[0];
move(e);
});
document.addEventListener('mousemove', function (event) {
event.preventDefault();
move(event);
});
});
function move(event) {
var mouseX, mouseY;
var ww = $(window).width();
var wh = $(window).height();
var traX, traY, traX2, traY2;
mouseX = event.pageX;
mouseY = event.pageY;
traX = (((50 * mouseX) / ww)) - 50;
traY = (((50 * mouseY) / wh)) - 50;
traX2 = (50 + traX) * -1;
traY2 = (50 + traY) * -1;
console.log(traX);
$('#topper-image').css({
"left": traX + "px",
"top": traY + "px"
});
$('#top-image').css({
"left": traX2 + "px",
"top": traY2 + "px"
});
}
</script>
</head>
<body>
<div id="top-image" class="image"></div>
<div id="topper-image" class="image"></div>
</body>
</html>