Parallax with svg
by Lucaskazama
HTML
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
<header>
<div class="parallax">
<h1>Bem-vindo</h1>
</div>
</header>
<section class="solutions">
<div class="content">
<div class="title">
<h2>Soluções</h2>
</div>
<div class="owl-carousel">
<div class="card"> TotalProj </div>
<div class="card"> PlusCalc </div>
<div class="card"> ServiceEasy </div>
<div class="card"> SmartOnion </div>
<div class="card"> SubZer0 </div>
<div class="card"> UltimateX </div>
<div class="card"> Never4lone </div>
</div>
<div class="title">
<h2>Problem?</h2>
</div>
</div>
</section>
<section class="timeline">
<div class="content">
<div class="title">
<h2>Olá amigos</h2>
</div>
</div>
</section>
CSS
@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css');
*,
*::before,
*::after,
:root {
padding: 0;
margin: 0;
font-family: 'Montserrat', sans-serif;
box-sizing: border-box;
}
html {
overflow: hidden;
height: 100%;
}
body {
overflow-x: hidden;
overflow-y: scroll;
height: 100%;
perspective: 1px;
transform-style: preserve-3d;
font-size: 62.5%;
}
h1 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 80px;
font-weight: 700;
color: #ffffff;
}
.content {
display: flex;
flex-flow: column;
padding: 20% 0;
text-align:center;
}
.title h2 {
color: #ffffff;
font-weight: 700;
font-size: 22px;
}
.title:last-child {
font-size: 16px;
padding-top: 0;
}
header {
position: relative;
min-height: 100vh;
width: 100%;
transform-style: inherit;
z-index: -1;
}
header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: block;
background: url(https://picsum.photos/g/1921/1081?random) top center;
background-size: cover;
transform: translateZ(-1px) scale(3.1);
min-height: 100%;
z-index: -2;
}
section {
position: relative;
height: 100%;
max-height: 100vw;
min-width: 360px;
width: 100%;
transform-style: inherit;
}
.solutions {
background: url('https://svgshare.com/i/DDg.svg');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
padding: 0;
z-index: 1;
}
.timeline::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: block;
background: teal;
background-size: cover;
transform: translateZ(-0.5px) scale(1.6);
z-index: -1;
}
.owl-carousel .card {
color: #222222;
background:...
JavaScript
var owl = $('.owl-carousel');
owl.owlCarousel({
touchDrag:true,
loop:true,
nav:false,
responsive:{
0:{
items:1
},
600:{
items:3
},
960:{
items:5
},
1200:{
items:6
}
}
});
owl.on('mousewheel', '.owl-stage', function (e) {
if (e.deltaY>0) {
owl.trigger('next.owl');
} else {
owl.trigger('prev.owl');
}
e.preventDefault();
});