Moutain

 


<!DOCTYPE html>
<html>
<head>
<title>Moutain</title>
</head>
<body>
<section class="zoom">
<img src="mountain1.png" alt="" title="" id="layer1">
<img src="mountain2.png" alt="" title="" id="layer2">
<img src="text.png" alt="" title="" id="text">
</section>
<section class="content">
<h2>Lorem text is the dummy text for this</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna liqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna liqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
<script type="text/javascript">
var layer1 = document.getElementById('layer1')
scroll = window.pageYOffset;
document.addEventListener('scroll' , function (e) {
var offset = window.pageYOffset;
scroll = offset;
layer1.style.width = (100 + scroll / 5) + '%';
});
var layer2 = document.getElementById('layer2')
scroll = window.pageYOffset;
document.addEventListener('scroll' , function (e) {
var offset = window.pageYOffset;
scroll = offset;
layer2.style.width = (100 + scroll / 5) + '%';
layer2.style.left = scroll/50 + '%';
});
var text = document.getElementById('text')
scroll = window.pageYOffset;
document.addEventListener('scroll' , function (e) {
var offset = window.pageYOffset;
scroll = offset;
layer2.style.width = (100 + scroll / 5) + '%';
text.style.top = - scroll/20 + '%';
});
</script>
</body>
</html>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
}
.zoom{ width: 100%; height: 1000px; position: relative; overflow: hidden; background:url(bg.jpg); background-size: cover;}
.zoom:before{
content: '';
position: absolute;
bottom: 0px;
width: 100%;
height: 200px;
z-index: 1000;
background: linear-gradient(transparent, #fff;)
}
.zoom #layer1{
position: absolute;
right: 0px;
width: 100%;
z-index: 10;
}
.zoom #layer2{
position: absolute;
right: 0;
width: 100%;
z-index: 9;
}
.zoom #text{
position: absolute;
right: 0;
width: 100%;
transform: translateY(50%);
}
.content{
padding: 100px;
box-sizing: border-box;
font-family: arial;
}
.content h2{
margin: 0px;
padding: 0px;
font-size: 4em;
}
.content p{
font-size: 1.2em;
}
</style>







Comments

Popular posts from this blog

Right click disable

Input Placeholder