How to make loop jQuery slider - html

I have the following code for a slider and it works perfect but the slider stops after going throught the images to the last one. I want to make this slider loop infinitely.
I have the following code for a slider and it works perfect but the slider stops after going throught the images to the last one. I want to make this slider loop infinitely.
Here's my attempt so far:
$(document).ready(function() {
$(".c-3d-carousel__item").on("click", function() {
$(this).prop("class", "c-3d-carousel__item c-3d-carousel__item-active");
let activeSlide = $(this).data("slide");
$(this)
.siblings()
.each(function() {
let slideNumber = $(this).data("slide");
if (slideNumber <= activeSlide) {
$(this).attr(
"class",
"c-3d-carousel__item c-3d-carousel__item-before c-3d-carousel__item-before--" +
(activeSlide - slideNumber)
);
} else {
$(this).prop(
"class",
"c-3d-carousel__item c-3d-carousel__item-after c-3d-carousel__item-after--" +
(slideNumber - activeSlide)
);
}
});
});
$(".next").on("click", function(i) {
$(".c-3d-carousel__item-active").next().click();
});
$(".prev").on("click", function(i) {
$(".c-3d-carousel__item-active").prev().click();
});
});
.c-carousel-showcase__carousel {
margin: 0 auto 30px;
min-height: 500px;
position: relative;
z-index: 1;
}
.c-3d-carousel {
position: relative;
}
.c-3d-carousel .c-3d-carousel__inner {
margin: 0 auto;
position: relative;
z-index: 1;
min-height: 450px;
width: 300px;
}
.c-3d-carousel .c-3d-carousel__inner .c-3d-carousel__item img {
width: 300px;
}
.c-3d-carousel__item {
top: 0;
left: 0;
position: absolute;
backface-visibility: hidden;
/* box-shadow: 0 20px 100px -18px rgba(0, 0, 0, 0.5); */
transition: all 600ms ease;
bottom: 0;
right: 0;
z-index: 1;
opacity: 0;
cursor: pointer;
display: flex;
align-items: center;
gap: 50px;
}
.c-3d-carousel__item .gatsby-image-wrapper {
pointer-events: none;
margin-bottom: -10px;
}
.c-3d-carousel__item.c-3d-carousel__item .content {
display: none;
background: #019047;
width: 150%;
height: calc(100% - 20%);
flex-direction: column;
justify-content: center;
padding-inline: 50px;
gap: 30px;
color: white;
position: absolute;
left: 100%;
text-align: center;
}
.c-3d-carousel__item.c-3d-carousel__item .content .title {
font-size: 20px;
font-weight: 500;
text-transform: uppercase;
}
.c-3d-carousel__item.c-3d-carousel__item .content p {
font-size: 16px;
font-weight: 300;
line-height: 150%;
}
.c-3d-carousel__item.c-3d-carousel__item-active .content {
display: flex;
}
.c-3d-carousel__item.c-3d-carousel__item-active {
z-index: 6;
opacity: 1;
}
.c-3d-carousel__item.c-3d-carousel__item-after--1 {
transform: translate3d(150px, 0, 0) scale(0.8);
opacity: 1;
z-index: 4;
}
.c-3d-carousel__item.c-3d-carousel__item-after--2 {
transform: translate3d(300px, 0, 0) scale(0.6);
opacity: 1;
z-index: 3;
}
.c-3d-carousel__item.c-3d-carousel__item-after--3 {
transform: translate3d(380px, 0, 0) scale(0.4);
opacity: 1;
z-index: 2;
}
.c-3d-carousel__item.c-3d-carousel__item-after--4 {
transform: translate3d(420px, 0, 0) scale(0.2);
opacity: 1;
z-index: 1;
}
.c-3d-carousel__item.c-3d-carousel__item-before--1 {
transform: translate3d(-150px, 0, 0) scale(0.8);
opacity: 1;
}
.c-3d-carousel__item.c-3d-carousel__item-before--2 {
transform: translate3d(-300px, 0, 0) scale(0.6);
opacity: 1;
}
.c-3d-carousel__item.c-3d-carousel__item-before--3 {
transform: translate3d(-380px, 0, 0) scale(0.4);
opacity: 1;
}
.c-3d-carousel__item.c-3d-carousel__item-before--4 {
transform: translate3d(-420px, 0, 0) scale(0.2);
opacity: 1;
}
.c-3d-carousel__item-after {
transform-origin: right center;
}
.c-3d-carousel__item-before {
transform-origin: left center;
}
.slider-control .c-btn {
margin: 0;
border: none;
background: none;
position: absolute;
top: 40%;
}
.slider-control .c-btn:hover svg path {
stroke: #019047;
stroke-opacity: 1;
}
.slider-control .c-btn.prev {
left: -5%;
}
.slider-control .c-btn.next {
right: -10%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="c-carousel-showcase__carousel">
<div class="c-3d-carousel">
<div class="c-3d-carousel__inner">
<figure class="c-3d-carousel__item c-3d-carousel__item-before c-3d-carousel__item-before--2" data-slide="1">
<img src="./images/about/slide1.png" alt="slide1">
<div class="content">
<div class="title">Results through teamwork</div>
<p>We collaborate effectively, always looking for more efficient ways to serve our employees and customers.</p>
</div>
</figure>
<figure class="c-3d-carousel__item c-3d-carousel__item-before c-3d-carousel__item-before--1" data-slide="2">
<img src="./images/about/slide1.png" alt="slide1">
<div class="content">
<div class="title">Results through teamwork</div>
<p>We collaborate effectively, always looking for more efficient ways to serve our employees and customers.</p>
</div>
</figure>
<figure class="c-3d-carousel__item c-3d-carousel__item-active" data-slide="3">
<img src="./images/about/slide1.png" alt="slide1">
<div class="content">
<div class="title">Results through teamwork</div>
<p>We collaborate effectively, always looking for more efficient ways to serve our employees and customers.</p>
</div>
</figure>
<figure class="c-3d-carousel__item c-3d-carousel__item-after c-3d-carousel__item-after--1" data-slide="4">
<img src="./images/about/slide1.png" alt="slide1">
<div class="content">
<div class="title">Results through teamwork</div>
<p>We collaborate effectively, always looking for more efficient ways to serve our employees and customers.</p>
</div>
</figure>
<figure class="c-3d-carousel__item c-3d-carousel__item-after c-3d-carousel__item-after--2" data-slide="5">
<img src="./images/about/slide1.png" alt="slide1">
<div class="content">
<div class="title">Results through teamwork</div>
<p>We collaborate effectively, always looking for more efficient ways to serve our employees and customers.</p>
</div>
</figure>
</div>
</div>
</div>
<!-- ./c-carousel-showcase__carousel -->
<div class="slider-control">
<button class="c-btn c-btn--dark prev">
<svg width="60" height="60" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M64.4 21.2002L35.6 50.0002L64.4 78.8002" stroke="black" stroke-opacity="0.4" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<button class="c-btn c-btn--dark next">
<svg width="60" height="60" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M35.6 21.2002L64.4 50.0002L35.6 78.8002" stroke="black" stroke-opacity="0.4" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
<!-- ./slider-control -->
What do I need to add to the jquery code to make it loop?

Related

Gap between card on mobile

I have a very basic problem I tried to fix it for hours. I have made these cards using grid layout but on mobile, it doesn't have a gap between them. I need it to be at least 10px gap among them.
Image 01
It works fine on the desktop(but not centered).
Image 02
Here's the code I'm using.
HTML:
<ul class="cards">
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title" >BALA KRISHNA</h3>
<span class="card__status">Game Architect</span>
</div>
</div>
<p class="card__description">I drive the game here!</p>
</div>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Prasanta Bhattacharya</h3>
<span class="card__status">Game Developer</span>
</div>
</div>
<p class="card__description">I make what you love!</p>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Myriam Roos</h3>
<span class="card__status">Community Manager</span>
</div>
</div>
<p class="card__description">Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores, blanditiis?</p>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Alxsander</h3>
<span class="card__status">Content Creator</span>
</div>
</div>
<p class="card__description">I create content here!</p>
</div>
</a>
</li>
</ul>
</div>
</div>
And CSS
* {
box-sizing: border-box;
}
:root {
--surface-color:black;
--curve: 40;
}
.cards {
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 10px 2rem;
grid-row-gap: 5px;
margin: 4rem 5vw;
padding: 5;
list-style-type: none;
}
.card {
position: relative;
display: block;
height: 130%;
border-radius: calc(var(--curve) * 1px);
overflow: hidden;
text-decoration: none;
border: solid;
border-color: white;
}
.card__image {
width: 120%;
height: auto;
}
.card__overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
border-radius: calc(var(--curve) * 1px);
background-color: var(--surface-color);
transform: translateY(100%);
transition: .2s ease-in-out;
}
.card:hover .card__overlay {
transform: translateY(0);
}
.card__header {
position: relative;
display: flex;
align-items: center;
gap: 2em;
padding: 2em;
border-radius: calc(var(--curve) * 1px) 0 0 0;
background-color: var(--surface-color);
transform: translateY(-100%);
transition: .2s ease-in-out;
}
.card__arc {
width: 80px;
height: 80px;
position: absolute;
bottom: 100%;
right: 0;
z-index: 1;
}
.card__arc path {
fill: var(--surface-color);
d: path("M 40 80 c 22 0 40 -22 40 -40 v 40 Z");
}
.card:hover .card__header {
transform: translateY(0);
}
.card__thumb {
flex-shrink: 0;
width: 50px;
height: 50px;
border-radius: 50%;
}
.card__title {
font-size: 1em;
margin: 0 0 .3em;
color: #6A515E;
}
.card__tagline {
display: block;
margin: 1em 0;
font-size: .8em;
color: #D7BDCA;
}
.card__status {
font-size: .8em;
color: #D7BDCA;
}
.card__description {
padding: 0 2em 2em;
margin: 0;
color: #D7BDCA;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
I'm a noob in web design so please help! And of course, sorry for bad English :D
You destroyed the vertical gap by setting .card { height: 130%; }. Also the image width of 120% has no sense. Better add some bottom padding, or use flex instead. With padding it may look like this:
* {
box-sizing: border-box;
}
:root {
--surface-color: black;
--curve: 40;
}
.cards {
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 10px 2rem;
grid-row-gap: 5px;
margin: 4rem 5vw;
padding: 5;
list-style-type: none;
}
.card {
position: relative;
display: block;
padding-bottom: 50px;
border-radius: calc(var(--curve) * 1px);
overflow: hidden;
text-decoration: none;
border: solid;
border-color: white;
}
.card__image {
width: 100%;
height: auto;
}
.card__overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
border-radius: calc(var(--curve) * 1px);
background-color: var(--surface-color);
transform: translateY(100%);
transition: .2s ease-in-out;
}
.card:hover .card__overlay {
transform: translateY(0);
}
.card__header {
position: relative;
display: flex;
align-items: center;
gap: 2em;
padding: 2em;
border-radius: calc(var(--curve) * 1px) 0 0 0;
background-color: var(--surface-color);
transform: translateY(-100%);
transition: .2s ease-in-out;
}
.card__arc {
width: 80px;
height: 80px;
position: absolute;
bottom: 100%;
right: 0;
z-index: 1;
}
.card__arc path {
fill: var(--surface-color);
d: path("M 40 80 c 22 0 40 -22 40 -40 v 40 Z");
}
.card:hover .card__header {
transform: translateY(0);
}
.card__thumb {
flex-shrink: 0;
width: 50px;
height: 50px;
border-radius: 50%;
}
.card__title {
font-size: 1em;
margin: 0 0 .3em;
color: #6A515E;
}
.card__tagline {
display: block;
margin: 1em 0;
font-size: .8em;
color: #D7BDCA;
}
.card__status {
font-size: .8em;
color: #D7BDCA;
}
.card__description {
padding: 0 2em 2em;
margin: 0;
color: #D7BDCA;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
<ul class="cards">
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg">
<path /></svg>
<div class="card__header-text">
<h3 class="card__title">BALA KRISHNA</h3>
<span class="card__status">Game Architect</span>
</div>
</div>
<p class="card__description">I drive the game here!</p>
</div>
</div>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg">
<path /></svg>
<div class="card__header-text">
<h3 class="card__title">Prasanta Bhattacharya</h3>
<span class="card__status">Game Developer</span>
</div>
</div>
<p class="card__description">I make what you love!</p>
</div>
</div>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg">
<path /></svg>
<div class="card__header-text">
<h3 class="card__title">Myriam Roos</h3>
<span class="card__status">Community Manager</span>
</div>
</div>
<p class="card__description">Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores, blanditiis?</p>
</div>
</div>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg">
<path /></svg>
<div class="card__header-text">
<h3 class="card__title">Alxsander</h3>
<span class="card__status">Content Creator</span>
</div>
</div>
<p class="card__description">I create content here!</p>
</div>
</div>
</li>
</ul>
Also on JS Fiddle.
Just changing your row-gap fixes that. Here I used
grid-row-gap: 100px;
in .cards css.
Adjust to suit your needs.
MDN
* {
box-sizing: border-box;
}
:root {
--surface-color: black;
--curve: 40;
}
.cards {
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
grid-row-gap: 100px; /* <----------------------------Changed to 100px */
margin: 4rem 5vw;
padding: 5;
list-style-type: none;
}
.card {
position: relative;
display: block;
height: 130%;
border-radius: calc(var(--curve) * 1px);
overflow: hidden;
text-decoration: none;
border: solid;
border-color: white;
}
.card__image {
width: 120%;
height: auto;
}
.card__overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
border-radius: calc(var(--curve) * 1px);
background-color: var(--surface-color);
transform: translateY(100%);
transition: .2s ease-in-out;
}
.card:hover .card__overlay {
transform: translateY(0);
}
.card__header {
position: relative;
display: flex;
align-items: center;
gap: 2em;
padding: 2em;
border-radius: calc(var(--curve) * 1px) 0 0 0;
background-color: var(--surface-color);
transform: translateY(-100%);
transition: .2s ease-in-out;
}
.card__arc {
width: 80px;
height: 80px;
position: absolute;
bottom: 100%;
right: 0;
z-index: 1;
}
.card__arc path {
fill: var(--surface-color);
d: path("M 40 80 c 22 0 40 -22 40 -40 v 40 Z");
}
.card:hover .card__header {
transform: translateY(0);
}
.card__thumb {
flex-shrink: 0;
width: 50px;
height: 50px;
border-radius: 50%;
}
.card__title {
font-size: 1em;
margin: 0 0 .3em;
color: #6A515E;
}
.card__tagline {
display: block;
margin: 1em 0;
font-size: .8em;
color: #D7BDCA;
}
.card__status {
font-size: .8em;
color: #D7BDCA;
}
.card__description {
padding: 0 2em 2em;
margin: 0;
color: #D7BDCA;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
<ul class="cards">
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">BALA KRISHNA</h3>
<span class="card__status">Game Architect</span>
</div>
</div>
<p class="card__description">I drive the game here!</p>
</div>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Prasanta Bhattacharya</h3>
<span class="card__status">Game Developer</span>
</div>
</div>
<p class="card__description">I make what you love!</p>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Myriam Roos</h3>
<span class="card__status">Community Manager</span>
</div>
</div>
<p class="card__description">Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores, blanditiis?</p>
</div>
</a>
</li>
<li>
<div class="card">
<img src="https://cdn.discordapp.com/attachments/888655046080872458/900257495333863444/unknown.png" class="card__image" alt="" />
<div class="card__overlay">
<div class="card__header">
<svg class="card__arc" xmlns="http://www.w3.org/2000/svg"><path /></svg>
<div class="card__header-text">
<h3 class="card__title">Mr. Unity Buddy</h3>
<span class="card__status">Content Creator</span>
</div>
</div>
<p class="card__description">I create content here!</p>
</div>
</a>
</li>
</ul>
</div>
</div>

Adding classes to a parent div on click

I have a setup that works similarly to an accordion, but vertical. I would like the add the class "unset" to the "choice" class, also while removing the "expand" and "small" classes.
I've edited the jQuery code to include to say when the card-close class is clicked, choice removes expand and adds class unset, and also if card-close is clicked, choice removes small and adds class unset.
Nothing I have used though has worked and I'm thinking it's because the div is inside the "choice" section.
Any ideas on how to get this to work?
jQuery(document).ready(function() {
jQuery(".card-close").on("click", function() {
jQuery(".choice").removeClass("expand");
jQuery(".choice").addClass("unset");
jQuery(".choice").removeClass("small");
jQuery(".choice").addClass("unset");
});
jQuery(".choice").on("click", function() {
jQuery(".choice").removeClass("expand unset ");
jQuery(".choice").addClass("small");
jQuery(this).removeClass("small");
jQuery(this).addClass("expand");
});
})
.container {
display: flex;
width: 100%;
padding: 0;
}
.choice {
height: 40vw;
box-sizing: border-box;
padding: 0;
overflow: hidden;
float: left;
align-items: center;
transition: width 0.2s;
position: relative;
}
.card-body {
z-index: 9;
}
.card-body h4 {
text-align: center;
font-family: 'Poppins', sans-serif !important;
color: #fff;
font-weight: 700;
opacity: .7;
text-decoration: none;
text-transform: uppercase;
margin-bottom: 3px;
width: max-content;
}
.card-body .card-title {
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
text-align: center;
}
.expand .card-body .card-title {
left: 56%;
top: 40%;
}
.card-body .card-title .card-open,
.card-body .card-title .card-close {
color: #000;
background-color: #CBE3A9;
width: max-content;
padding: 0 7px;
font-size: 20px;
margin: 0 auto;
}
.card-body .card-title .card-close,
.expand .card-body .card-title .card-open {
display: none;
}
.expand .card-body .card-title .card-close,
.card-body .card-title .card-open {
display: block;
}
.choice .bg-image {
background-size: cover;
width: 100%;
height: 100%;
position: absolute;
filter: blur(6px);
transition: 1s;
z-index: -9;
}
.danger-color .bg-image {
background-color: green;
}
.warning-color .bg-image {
background-color: blue;
}
.success-color .bg-image {
background-color: red;
}
.info-color .bg-image {
background-color: yellow;
}
.choice.expand .bg-image {
filter: blur(0px);
transition: 1s;
z-index: -999;
}
.expand .card-text {
width: 32%;
background-color: #A7D16D;
padding: 2%;
margin: 0 auto;
position: absolute;
left: 57%;
top: 51.9%;
}
.expand .card-body h4 {
opacity: 1;
font-size: 65px;
}
.small .card-body h4 {
font-size: 25px;
}
.expand {
width: 130%;
}
.unset {
width: 25%;
cursor: pointer;
}
.small .card-title h4 {
display: none;
}
.small {
width: 5%;
cursor: pointer;
background-color: #0000006e;
}
.small>.card-body .card-text {
opacity: 0;
}
.unset>div>p {
opacity: 0;
}
.expand>div {
transition-delay: 200ms;
opacity: 1;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<div class="container mt-5 justify-content-center">
<div class="choice unset mx-2 danger-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Strategic</h4>
<p class="card-open">+</p>
<p class="card-close">-</p>
</div>
<!-- Text -->
<p class="card-text">Every FeltonBuford Partners’ insight strategist has worked on the client side. As former leaders of businesses, we can understand the problems our clients face and deliver the level of strategic thinking that leads to true business breakthroughs.</p>
</div>
</div>
<div class="choice unset mx-2 warning-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Experience</h4>
<p class="card-open">+</p>
<p class="card-close">-</p>
</div>
<!-- Text -->
<p class="card-text">For more than two decades, FeltonBuford Partners has been providing powerful insights that lead to transformational growth for our clients. From the beginning, our goal has been to be the kind of research firm we would have wanted to hire when we
were on the client side.</p>
</div>
</div>
<div class="choice unset mx-2 success-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Fearless</h4>
<p class="card-open">+</p>
<p class="card-close">-</p>
</div>
<!-- Text -->
<p class="card-text">We have earned the reputation for being fearless. Because of our depth of experience, we have the confidence to tackle the toughest and most complex projects across the globe.</p>
</div>
</div>
<div class="choice unset mx-2 info-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Diverse</h4>
<p class="card-open">+</p>
<p class="card-close">-</p>
</div>
<!-- Text -->
<p class="card-text">Our diversity is a true strength. As a minority and women-owned company, we have a unique appreciation of the diversity of the human experience. We can apply our varied talents and perspectives to a broader and more relevant understanding of the
complex world in which we live.</p>
</div>
</div>
</div>
Or you can use stopPropagation in the close event, the event will be stopped before triggering open e.g
jQuery(".card-close").on("click", function(event) {
event.stopPropagation();
jQuery(".choice").removeClass("expand");
jQuery(".choice").addClass("unset");
jQuery(".choice").removeClass("small");
jQuery(".choice").addClass("unset");
});
Read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation
Use relative addressing
Something like this - run in full screen
$(document).ready(function() {
$(".card-toggle").on("click", function() {
const $parent = $(this).closest(".choice")
$parent.toggleClass("expand");
$parent.toggleClass("unset");
$parent.toggleClass("small");
$parent.toggleClass("unset");
$(this).text($parent.hasClass("expand") ? "+" : "-")
});
})
.container {
display: flex;
width: 100%;
padding: 0;
}
.choice {
height: 40vw;
box-sizing: border-box;
padding: 0;
overflow: hidden;
float: left;
align-items: center;
transition: width 0.2s;
position: relative;
}
.card-body {
z-index: 9;
}
.card-body h4 {
text-align: center;
font-family: 'Poppins', sans-serif !important;
color: #fff;
font-weight: 700;
opacity: .7;
text-decoration: none;
text-transform: uppercase;
margin-bottom: 3px;
width: max-content;
}
.card-body .card-title {
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
text-align: center;
}
.expand .card-body .card-title {
left: 56%;
top: 40%;
}
.card-body .card-title .card-open,
.card-body .card-title .card-close {
color: #000;
background-color: #CBE3A9;
width: max-content;
padding: 0 7px;
font-size: 20px;
margin: 0 auto;
}
.card-body .card-title .card-close,
.expand .card-body .card-title .card-open {
display: none;
}
.expand .card-body .card-title .card-close,
.card-body .card-title .card-open {
display: block;
}
.choice .bg-image {
background-size: cover;
width: 100%;
height: 100%;
position: absolute;
filter: blur(6px);
transition: 1s;
z-index: -9;
}
.danger-color .bg-image {
background-color: green;
}
.warning-color .bg-image {
background-color: blue;
}
.success-color .bg-image {
background-color: red;
}
.info-color .bg-image {
background-color: yellow;
}
.choice.expand .bg-image {
filter: blur(0px);
transition: 1s;
z-index: -999;
}
.expand .card-text {
width: 32%;
background-color: #A7D16D;
padding: 2%;
margin: 0 auto;
position: absolute;
left: 57%;
top: 51.9%;
}
.expand .card-body h4 {
opacity: 1;
font-size: 65px;
}
.small .card-body h4 {
font-size: 25px;
}
.expand {
width: 130%;
}
.unset {
width: 25%;
cursor: pointer;
}
.small .card-title h4 {
display: none;
}
.small {
width: 5%;
cursor: pointer;
background-color: #0000006e;
}
.small>.card-body .card-text {
opacity: 0;
}
.unset>div>p {
opacity: 0;
}
.expand>div {
transition-delay: 200ms;
opacity: 1;
}
.card-toggle { font-size: xx-large }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<div class="container mt-5 justify-content-center">
<div class="choice unset mx-2 danger-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Strategic</h4>
<p class="card-toggle">-</p>
</div>
<!-- Text -->
<p class="card-text">Every FeltonBuford Partners’ insight strategist has worked on the client side. As former leaders of businesses, we can understand the problems our clients face and deliver the level of strategic thinking that leads to true business breakthroughs.</p>
</div>
</div>
<div class="choice unset mx-2 warning-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Experience</h4>
<p class="card-toggle">-</p>
</div>
<!-- Text -->
<p class="card-text">For more than two decades, FeltonBuford Partners has been providing powerful insights that lead to transformational growth for our clients. From the beginning, our goal has been to be the kind of research firm we would have wanted to hire when we
were on the client side.</p>
</div>
</div>
<div class="choice unset mx-2 success-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Fearless</h4>
<p class="card-toggle">-</p>
</div>
<!-- Text -->
<p class="card-text">We have earned the reputation for being fearless. Because of our depth of experience, we have the confidence to tackle the toughest and most complex projects across the globe.</p>
</div>
</div>
<div class="choice unset mx-2 info-color">
<div class="bg-image"></div>
<div class="card-body">
<!-- Title -->
<div class="card-title">
<h4>Diverse</h4>
<p class="card-toggle">-</p>
</div>
<!-- Text -->
<p class="card-text">Our diversity is a true strength. As a minority and women-owned company, we have a unique appreciation of the diversity of the human experience. We can apply our varied talents and perspectives to a broader and more relevant understanding of the
complex world in which we live.</p>
</div>
</div>
</div>

Link Bootstrap with my caroussel's image disappears

I have this carousel which works fine, i need to add the bootstrap 4 style to my page, whenever i add the link, my carousel's pictures disappear.
I tried to figure out if there is anything confusing between the classes but still can't find anything, i also tried to add '!important' to the img tag in css but still can't solve it, what seems to be the problem ? Thanks.
var carousel = document.querySelector('.acc-carousel');
var container = carousel.querySelector('.carousel-container');
var prevBtn = carousel.querySelector('.carousel-prev');
var nextBtn = carousel.querySelector('.carousel-next');
var pagination = carousel.querySelector('.carousel-pagination');
var bullets = [].slice.call(carousel.querySelectorAll('.carousel-bullet'));
var totalItems = container.querySelectorAll('.carousel-item').length;
var percent = (100 / totalItems);
var currentIndex = 0;
function next() {
slideTo(currentIndex + 1);
}
function prev() {
slideTo(currentIndex - 1);
}
function slideTo(index) {
index = index < 0 ? totalItems - 1 : index >= totalItems ? 0 : index;
container.style.WebkitTransform = container.style.transform = 'translate(-' + (index * percent) + '%, 0)';
bullets[currentIndex].classList.remove('active-bullet');
bullets[index].classList.add('active-bullet');
currentIndex = index;
}
bullets[currentIndex].classList.add('active-bullet');
prevBtn.addEventListener('click', prev, false);
nextBtn.addEventListener('click', next, false);
pagination.addEventListener('click', function(e) {
var index = bullets.indexOf(e.target);
if (index !== -1 && index !== currentIndex) {
slideTo(index);
}
}, false);
.text{
position: absolute;
/* width: 100px; */
/* height: 50px; */
background-color: red;
top: 52%;
left: 44%;
text-align: center;
transform: translate(0%, 50%);
}
.container {
width: 80%;
margin: 0 auto;
}
.carousel-item > div {
height: 400px;
line-height: 500px;
font-size: 1.5em;
text-align: center;
color: #fff;
}
img {
width: 100%;
height: 100%;
}
/* Carousel */
.acc-carousel {
position: relative;
overflow: hidden;
height: 300px;
width: 100%;
}
.carousel-container {
list-style: none;
overflow: hidden;
padding: 0;
margin: 0;
width: 500%;
transition: transform 0.3s cubic-bezier(.694, .0482, .335, 1);
}
.carousel-item {
position: relative;
float: left;
width: 20%;
}
/* Next / Prev Buttons */
.carousel-prev,
.carousel-next {
position: absolute;
top: 50%;
background-color: #222;
opacity: 0.7;
border-radius: 50%;
color: #fff;
font-size: 1em;
cursor: pointer;
width: 40px;
height: 40px;
line-height: 40px;
-webkit-transform: translate(0, -50%);
transform: translate(0, -50%);
text-align: center;
z-index: 10;
transition: opacity 0.3s ease;
}
.carousel-prev {
left: 2%;
padding-right: 3px;
}
.carousel-prev::before {
content: '\f053';
font-family: "FontAwesome";
}
.carousel-next {
right: 2%;
padding-left: 3px;
}
.carousel-next::before {
content: '\f054';
font-family: "FontAwesome";
}
.carousel-prev:hover,
.carousel-next:hover {
opacity: 1;
}
/* Pagination */
.carousel-pagination {
list-style: none;
position: absolute;
bottom: 3%;
left: 0;
right: 0;
width: 50%;
padding: 0;
margin: 0 auto;
text-align: center;
z-index: 10;
}
.carousel-bullet {
display: inline-block;
width: 12px;
height: 12px;
background-color: #000;
cursor: pointer;
margin: 0 7px;
border-radius: 50%;
opacity: 0.5;
transition-property: transform, opacity, background-color;
transition-duration: 0.3s;
}
.carousel-bullet:hover {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
.carousel-bullet.active-bullet,
.carousel-bullet.active-bullet:hover {
opacity: 1;
-webkit-transform: scale(1.3);
transform: scale(1.3);
background-color: #fff;
cursor: default;
}
<!--If i link Bootstrap 4 css, pictres will disappear -->
<!-- Bootstrap 4 css :
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css'>
<div class="container">
<div class="acc-carousel">
<div class="carousel-prev"></div>
<div class="carousel-next"></div>
<ul class="carousel-pagination">
<li class="carousel-bullet"></li>
<li class="carousel-bullet"></li>
<li class="carousel-bullet"></li>
<li class="carousel-bullet"></li>
<li class="carousel-bullet"></li>
</ul>
<ul class="carousel-container">
<li class="carousel-item">
<div class="item-1 img-fluid">
<img src="https://image.shutterstock.com/image-photo/mountains-during-sunset-beautiful-natural-260nw-407021107.jpg" />
</div>
<p class="text">First image</p>
</li>
<li class="carousel-item">
<div class="item-2 img-fluid">
<img src="https://cdn.pixabay.com/photo/2015/04/19/08/32/marguerite-729510__340.jpg" />
</div>
<p class="text">Second image</p>
</li>
<li class="carousel-item">
<div class="item-3"></div>
</li>
<li class="carousel-item">
<div class="item-4"></div>
</li>
<li class="carousel-item">
<div class="item-5"></div>
</li>
</ul>
</div>
</div>

backface-visibility is working only partly

I'm trying to make a card that flipping on hover. To hide the back part of a card I use backface-visibility: hidden. But it only hides background of the back part while all the elements are still visible on the front side in rotated variant.
I use Google Chrome.
Here's my html code
<div class="card">
<div class="card__side card__side--front">
<div class="card__picture card__picture--1"></div>
<div class="card__heading">
<span class="card__heading-span card__heading-span--1">
The sea explorer
</span>
</div>
<div class="card__details">
<ul class="card__list">
<li class="card__item">3 day tour</li>
<li class="card__item">Up to 30 people</li>
<li class="card__item">2 tour guides</li>
<li class="card__item">Sleep in cozy hotels</li>
<li class="card__item">Difficulty: easy</li>
</ul>
</div>
</div>
<div class="card__side card__side--back card__side--back-1">
<div class="card__cta">
<div class="card__price-box">
<p class="card__price--only">Only</p>
<p class="card__price--value">$297</p>
</div>
Book now
</div>
</div>
</div>
And here's my SASS code
.card {
position: relative;
height: 52rem;
perspective: 150rem;
&__side {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 52rem;
border-radius: 3px;
overflow: hidden;
box-shadow: 0 1.5rem 4rem rgba($color-black, .15);
transform-style: preserve-3d;
backface-visibility: hidden;
transition: all .8s ease;
&--front {
background-color: $color-white;
}
&--back {
transform: rotateY(180deg);
&-1 {
background-image:
linear-gradient(to right bottom,$color-secondary-light,$color-secondary-dark);
}
&-2 {}
&-3 {}
}
}
&:hover &__side--front {
transform: rotateY(-180deg);
}
&:hover &__side--back {
transform: rotateY(0);
}
// Front side styles
&__picture {
&--1 {}
&--2 {}
&--3 {}
}
&__heading {
}
&__heading-span {
&--1 {}
&--2 {}
&--3 {}
}
&__details {
}
&__list {
width: 80%;
margin: 0 auto;
list-style-type: none;
}
&__item {
&:not(:last-child) {
border-bottom: 1px solid $color-gray-light-2;
}
}
//Back side styles
&__cta {
#include absoluteCenter();
width: 90%;
text-align: center;
}
&__price-box {
margin-bottom: 6rem;
color: $color-black;
text-align: center;
}
&__price--only {
font-size: 1.4rem;
text-transform: uppercase;
}
&__price--value {
font-size: 6rem;
font-weight: 300;
}
}
And this is how the problem actually looks like in Chrome.
Adding transform-style: preserve-3d to .card instead of .card__side fixed the bug for me.

Div overlay on top of other elements even with low z-index value

I have a div overlay with a low z-index value. But even when i apply higher z-index values to my other content the overlay is always on top, when all i want is for it to be over my backgrounds.
Here's my markup:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
color: white;
}
body {
font-family: 'Open Sans', serif;
}
.section {
/* the imp ortant one*/
/* background-attachment: fixed;*/
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 100%;
z-index: 15;
}
#section1 {
background-image: url("../images/main_background.png");
}
#section2 {
background-image: url("../images/auction_background.png");
}
#section3 {
background-image: url("../images/convention_background.png");
}
#section4 {
background-image: url("../images/exhibition_background.png")
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
background-color: rgba(0, 0, 0, 0.8);
}
.topbar {
position: fixed;
display: flex;
justify-content: flex-end;
z-index: 15;
width: 100%;
}
.social-icons span {
display: inline-block;
position: relative;
bottom: 1em;
}
.social-icons * {
margin-left: 0.5em
}
.social-icons {
margin: 5em;
}
.social-icons li {
display: inline-block;
}
.social-icons svg {
fill: rgba( 255, 255, 255, 0.7);
width: 50px;
}
.logo {
/* margin: 10em;*/
z-index: 13;
width: 100%;
}
.logo img {
display: block;
width: 70em;
margin: 0 auto;
margin-top: 10em;
}
.coming-soon {
z-index: 15;
font-size: 5rem;
text-align: center;
margin-top: 1em
}
.coming {
font-weight: lighter;
}
.soon {
font-weight: bolder;
}
.keep {
text-align: center;
margin-top: 1em;
}
.text-block {
width: 50em;
margin-left: 25em;
margin-top: 15em;
}
.title {
font-size: 5rem;
}
.text-block p {
margin-top: 1em;
font-size: 2rem;
font-weight: 100;
}
.text-block span {
font-weight: 900;
}
.email-input {
height: 4em;
width: 30em;
border-color: white;
/* background: black;*/
border-radius: 20em;
margin: 0 auto;
}
.navigation {
position: fixed;
width: 100%;
}
.email-input input {
width: inherit;
height: inherit;
text-align: center;
border-radius: 20em;
background-color: transparent;
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="topbar">
<ul class="social-icons">
<span>Find us on</span>
<li>
<a class="icons" href="#">
<svg version="1.1" id="Facebook_w_x2F__circle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<path d="M10,0.4c-5.302,0-9.6,4.298-9.6,9.6s4.298,9.6,9.6,9.6s9.6-4.298,9.6-9.6S15.302,0.4,10,0.4z M12.274,7.034h-1.443
c-0.171,0-0.361,0.225-0.361,0.524V8.6h1.805l-0.273,1.486H10.47v4.461H8.767v-4.461H7.222V8.6h1.545V7.726
c0-1.254,0.87-2.273,2.064-2.273h1.443V7.034z"/>
</svg></a>
</li>
<li>
<a class="icons" href="#">
<svg id="Instagram_w_circle" data-name="Instagram w/circle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.19995 19.19995"><title>instagram-with-circle</title><path d="M13.89777,7.05115a1.65591,1.65591,0,0,0-.94891-0.94891,2.76589,2.76589,0,0,0-.92841-0.17218C11.49316,5.906,11.33508,5.90094,10,5.90094S8.50684,5.906,7.97955,5.93005a2.76589,2.76589,0,0,0-.92841.17218,1.65591,1.65591,0,0,0-.94891.94891,2.76589,2.76589,0,0,0-.17218.92841C5.906,8.50684,5.90094,8.665,5.90094,10s0.00507,1.49316.02911,2.02045a2.76553,2.76553,0,0,0,.17218.92841,1.65591,1.65591,0,0,0,.94891.94891,2.76589,2.76589,0,0,0,.92841.17218c0.52716,0.024.6853,0.02911,2.02045,0.02911s1.49329-.00507,2.02045-0.02911a2.76589,2.76589,0,0,0,.92841-0.17218,1.65591,1.65591,0,0,0,.94891-0.94891,2.76553,2.76553,0,0,0,.17218-0.92841c0.024-.52728.02911-0.68536,0.02911-2.02045S14.094,8.50684,14.06995,7.97955A2.76589,2.76589,0,0,0,13.89777,7.05115ZM10,12.56757A2.56757,2.56757,0,1,1,12.56757,10,2.56756,2.56756,0,0,1,10,12.56757ZM12.669,7.931a0.6,0.6,0,1,1,.6-0.6A0.6,0.6,0,0,1,12.669,7.931Z" transform="translate(-0.40002 -0.40002)"/><circle cx="9.59998" cy="9.59998" r="1.66669"/><path d="M10,0.4A9.6,9.6,0,1,0,19.6,10,9.59995,9.59995,0,0,0,10,.4Zm4.96991,11.6615a3.67039,3.67039,0,0,1-.23242,1.21368,2.55612,2.55612,0,0,1-1.46228,1.46228,3.67039,3.67039,0,0,1-1.21368.23242C11.5282,14.99426,11.35791,15,10,15s-1.5282-.00574-2.06152-0.03009a3.67039,3.67039,0,0,1-1.21368-.23242,2.55612,2.55612,0,0,1-1.46228-1.46228,3.67039,3.67039,0,0,1-.23242-1.21368C5.00574,11.5282,5,11.35791,5,10s0.00574-1.5282.03009-2.06152a3.67039,3.67039,0,0,1,.23242-1.21368A2.55612,2.55612,0,0,1,6.72479,5.26251a3.67039,3.67039,0,0,1,1.21368-.23242C8.4718,5.00574,8.64209,5,10,5s1.5282,0.00574,2.06152.03009a3.67039,3.67039,0,0,1,1.21368.23242,2.55612,2.55612,0,0,1,1.46228,1.46228,3.67039,3.67039,0,0,1,.23242,1.21368C14.99426,8.4718,15,8.64209,15,10S14.99426,11.5282,14.96991,12.06152Z" transform="translate(-0.40002 -0.40002)"/></svg>
</a>
</li>
<li>
<a class="icons" href="#">
<svg version="1.1" id="Twitter_w_x2F__circle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<path d="M10,0.4c-5.302,0-9.6,4.298-9.6,9.6s4.298,9.6,9.6,9.6s9.6-4.298,9.6-9.6S15.302,0.4,10,0.4z M13.905,8.264
c0.004,0.082,0.005,0.164,0.005,0.244c0,2.5-1.901,5.381-5.379,5.381c-1.068,0-2.062-0.312-2.898-0.85
c0.147,0.018,0.298,0.025,0.451,0.025c0.886,0,1.701-0.301,2.348-0.809c-0.827-0.016-1.525-0.562-1.766-1.312
c0.115,0.021,0.233,0.033,0.355,0.033c0.172,0,0.34-0.023,0.498-0.066c-0.865-0.174-1.517-0.938-1.517-1.854V9.033
C6.257,9.174,6.549,9.26,6.859,9.27C6.351,8.93,6.018,8.352,6.018,7.695c0-0.346,0.093-0.672,0.256-0.951
c0.933,1.144,2.325,1.896,3.897,1.977c-0.033-0.139-0.049-0.283-0.049-0.432c0-1.043,0.846-1.891,1.891-1.891
c0.543,0,1.035,0.23,1.38,0.598c0.431-0.086,0.835-0.242,1.2-0.459c-0.141,0.441-0.44,0.812-0.831,1.047
c0.383-0.047,0.747-0.148,1.086-0.299C14.595,7.664,14.274,7.998,13.905,8.264z"/>
</svg>
</a>
</li>
</ul>
</div>
<div id="pagepiling">
<!-- <div class="overlay"></div>-->
<div class="section" id="section1">
<div class="logo">
<img src="./images/auction_logo.png" alt="">
</div>
<div class="coming-soon">
<span class="coming">Coming</span> <span class="soon">Soon</span>
</div>
<div class="keep"><span>Keep in touch</span></div>
</div>
<div class="section" id="section2">
<div class="text-block">
<h1 class="title">Auction</h1>
<p><span>A full service dealer </span>and public auto auction.Experience the thrill of bidding and also tak advantage of available bargains on your next vehicle purchase</p>
</div>
</div>
<div class="section" id="section3">
<div class="text-block">
<h1 class="title">
Convention
</h1>
<p>
<span> A dynamic platform</span> for Business to Business and Business to Consumer relations, featuring the largest gathering of stakeholders in the automotive industry in Abuja.
</p>
</div>
</div>
<div class="section" id="section4">
<div class="text-block">
<h1 class="title">
Exhibition
</h1>
<p>
<span> A wide range</span> of exhibitors from all sectors of the automotive industry displaying products and services for direct marketing and service engagement opportunities
</p>
</div>
</div>
</div>
</body>
</html>
I'm using a java script library - pagepiling.js although i can't see how this could influence my markup. Here's the jsfiddle JsFiddle
Add
position: relative
to all elements with z-index, because elements with static position can't overlay
Your overlay's z-index is set to 10. That causes the issue it seems. Check below snippet(which i inherited from fiddler) for reference.
$(document).ready(function() {
$('#pagepiling').pagepiling({
verticalCentered: false,
css3: true,
});
});
* {
margin: 0;
padding: 0;
box-sizing: border-box;
color: white;
}
body {
font-family: 'Open Sans', serif;
/* position: relative;*/
}
.section {
/* the imp ortant one*/
/* background-attachment: fixed;*/
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 100%;
z-index: 15;
}
#section1 {
background-image: url("https://imgur.com/aeKw80J.png");
}
#section2 {
background-image: url("https://imgur.com/dnVZlHW.png");
}
#section3 {
background-image: url("https://imgur.com/wcmCU0Z.png");
}
#section4 {
background-image: url("https://imgur.com/mhVSOZx.png")
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: rgba(0, 0, 0, 0.8);
}
.topbar {
position: fixed;
display: flex;
justify-content: flex-end;
z-index: 15;
width: 100%;
}
.social-icons span {
display: inline-block;
position: relative;
bottom: 1em;
}
.social-icons * {
margin-left: 0.5em
}
.social-icons {
margin: 5em;
}
.social-icons li {
display: inline-block;
}
.social-icons svg {
fill: rgba( 255, 255, 255, 0.7);
width: 50px;
}
.logo {
/* margin: 10em;*/
z-index: 13;
width: 100%;
}
.logo img {
display: block;
width: 70em;
margin: 0 auto;
margin-top: 10em;
}
.coming-soon {
z-index: 15;
font-size: 5rem;
text-align: center;
margin-top: 1em
}
.coming {
font-weight: lighter;
}
.soon {
font-weight: bolder;
}
.keep {
text-align: center;
margin-top: 1em;
}
.text-block {
width: 50em;
margin-left: 25em;
margin-top: 15em;
}
.title {
font-size: 5rem;
}
.text-block p {
margin-top: 1em;
font-size: 2rem;
font-weight: 100;
}
.text-block span {
font-weight: 900;
}
.email-input {
height: 4em;
width: 30em;
border-color: white;
border-radius: 20em;
margin: 0 auto;
}
.navigation {
position: fixed;
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pagePiling.js/1.5.4/jquery.pagepiling.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/pagePiling.js/1.5.4/jquery.pagepiling.min.css" rel="stylesheet" />
<body>
<div class="topbar">
<ul class="social-icons">
<span>Find us on</span>
<li>
<a class="icons" href="#">
<svg version="1.1" id="Facebook_w_x2F__circle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<path d="M10,0.4c-5.302,0-9.6,4.298-9.6,9.6s4.298,9.6,9.6,9.6s9.6-4.298,9.6-9.6S15.302,0.4,10,0.4z M12.274,7.034h-1.443
c-0.171,0-0.361,0.225-0.361,0.524V8.6h1.805l-0.273,1.486H10.47v4.461H8.767v-4.461H7.222V8.6h1.545V7.726
c0-1.254,0.87-2.273,2.064-2.273h1.443V7.034z"/>
</svg></a>
</li>
<li>
<a class="icons" href="#">
<svg id="Instagram_w_circle" data-name="Instagram w/circle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.19995 19.19995"><title>instagram-with-circle</title><path d="M13.89777,7.05115a1.65591,1.65591,0,0,0-.94891-0.94891,2.76589,2.76589,0,0,0-.92841-0.17218C11.49316,5.906,11.33508,5.90094,10,5.90094S8.50684,5.906,7.97955,5.93005a2.76589,2.76589,0,0,0-.92841.17218,1.65591,1.65591,0,0,0-.94891.94891,2.76589,2.76589,0,0,0-.17218.92841C5.906,8.50684,5.90094,8.665,5.90094,10s0.00507,1.49316.02911,2.02045a2.76553,2.76553,0,0,0,.17218.92841,1.65591,1.65591,0,0,0,.94891.94891,2.76589,2.76589,0,0,0,.92841.17218c0.52716,0.024.6853,0.02911,2.02045,0.02911s1.49329-.00507,2.02045-0.02911a2.76589,2.76589,0,0,0,.92841-0.17218,1.65591,1.65591,0,0,0,.94891-0.94891,2.76553,2.76553,0,0,0,.17218-0.92841c0.024-.52728.02911-0.68536,0.02911-2.02045S14.094,8.50684,14.06995,7.97955A2.76589,2.76589,0,0,0,13.89777,7.05115ZM10,12.56757A2.56757,2.56757,0,1,1,12.56757,10,2.56756,2.56756,0,0,1,10,12.56757ZM12.669,7.931a0.6,0.6,0,1,1,.6-0.6A0.6,0.6,0,0,1,12.669,7.931Z" transform="translate(-0.40002 -0.40002)"/><circle cx="9.59998" cy="9.59998" r="1.66669"/><path d="M10,0.4A9.6,9.6,0,1,0,19.6,10,9.59995,9.59995,0,0,0,10,.4Zm4.96991,11.6615a3.67039,3.67039,0,0,1-.23242,1.21368,2.55612,2.55612,0,0,1-1.46228,1.46228,3.67039,3.67039,0,0,1-1.21368.23242C11.5282,14.99426,11.35791,15,10,15s-1.5282-.00574-2.06152-0.03009a3.67039,3.67039,0,0,1-1.21368-.23242,2.55612,2.55612,0,0,1-1.46228-1.46228,3.67039,3.67039,0,0,1-.23242-1.21368C5.00574,11.5282,5,11.35791,5,10s0.00574-1.5282.03009-2.06152a3.67039,3.67039,0,0,1,.23242-1.21368A2.55612,2.55612,0,0,1,6.72479,5.26251a3.67039,3.67039,0,0,1,1.21368-.23242C8.4718,5.00574,8.64209,5,10,5s1.5282,0.00574,2.06152.03009a3.67039,3.67039,0,0,1,1.21368.23242,2.55612,2.55612,0,0,1,1.46228,1.46228,3.67039,3.67039,0,0,1,.23242,1.21368C14.99426,8.4718,15,8.64209,15,10S14.99426,11.5282,14.96991,12.06152Z" transform="translate(-0.40002 -0.40002)"/></svg>
</a>
</li>
<li>
<a class="icons" href="#">
<svg version="1.1" id="Twitter_w_x2F__circle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<path d="M10,0.4c-5.302,0-9.6,4.298-9.6,9.6s4.298,9.6,9.6,9.6s9.6-4.298,9.6-9.6S15.302,0.4,10,0.4z M13.905,8.264
c0.004,0.082,0.005,0.164,0.005,0.244c0,2.5-1.901,5.381-5.379,5.381c-1.068,0-2.062-0.312-2.898-0.85
c0.147,0.018,0.298,0.025,0.451,0.025c0.886,0,1.701-0.301,2.348-0.809c-0.827-0.016-1.525-0.562-1.766-1.312
c0.115,0.021,0.233,0.033,0.355,0.033c0.172,0,0.34-0.023,0.498-0.066c-0.865-0.174-1.517-0.938-1.517-1.854V9.033
C6.257,9.174,6.549,9.26,6.859,9.27C6.351,8.93,6.018,8.352,6.018,7.695c0-0.346,0.093-0.672,0.256-0.951
c0.933,1.144,2.325,1.896,3.897,1.977c-0.033-0.139-0.049-0.283-0.049-0.432c0-1.043,0.846-1.891,1.891-1.891
c0.543,0,1.035,0.23,1.38,0.598c0.431-0.086,0.835-0.242,1.2-0.459c-0.141,0.441-0.44,0.812-0.831,1.047
c0.383-0.047,0.747-0.148,1.086-0.299C14.595,7.664,14.274,7.998,13.905,8.264z"/>
</svg>
</a>
</li>
</ul>
</div>
<div id="pagepiling">
<div class="overlay"></div>
<div class="section" id="section1">
<div class="logo">
<img src="https://imgur.com/GgfKM8n.png" alt="">
</div>
<div class="coming-soon">
<span class="coming">Coming</span> <span class="soon">Soon</span>
</div>
<div class="navigation">
<div class="keep"><span>Keep in touch</span></div>
<!-- <input type="text">-->
</div>
</div>
<div class="section" id="section2">
<div class="text-block">
<h1 class="title">Auction</h1>
<p><span>A full service dealer </span>and public auto auction.Experience the thrill of bidding and also tak advantage of available bargains on your next vehicle purchase</p>
</div>
</div>
<div class="section" id="section3">
<div class="text-block">
<h1 class="title">
Convention
</h1>
<p>
<span> A dynamic platform</span> for Business to Business and Business to Consumer relations, featuring the largest gathering of stakeholders in the automotive industry in Abuja.
</p>
</div>
</div>
<div class="section" id="section4">
<div class="text-block">
<h1 class="title">
Exhibition
</h1>
<p>
<span> A wide range</span> of exhibitors from all sectors of the automotive industry displaying products and services for direct marketing and service engagement opportunities
</p>
</div>
</div>