1
Talks personally I’m about to develop this screen with html and css and I needed to know if it is possible to create a slide with these Dots or to do otherwise the idea is to click on these links and he change the background image would be a slide let’s say so I thought to use this slide here the more the same challenge would be styling these Dots
You follow my code: html:
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide slide-wonder-woman">
<div class="container">
<div class="row">
<div class="col-lg-8">
<h1 class="title">wonder<br><span>Woman</span></h1>
</div>
<div class="-wonder-woman"></div>
</div>
</div>
</div>
<div class="swiper-slide slide-superman">Slide 2</div>
<div class="swiper-slide slide-batman">Slide 3</div>
<div class="swiper-slide slide-aquaman">Slide 4</div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
</div>
CSS:
.swiper-container {
width: 100%;
height: 100%;
position: absolute;
top: 0;
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.slide-wonder-woman{
background-image: url("../images/bg-slide-wonder-woman.jpg");
background-size: cover;
background-repeat: no-repeat;
.title{
position: relative;
color: $white;
font-family: 'gotham-book';
text-transform: uppercase;
letter-spacing: 45px;
text-align: center;
line-height: 90px;
font-size: 3.5em;
z-index: 1;
&:after{
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
background-image: url("../images/wonder-woman-logo.png");
width: 496px;
height: 212px;
z-index: -1;
}
span{
font-family: 'gotham-ultra';
letter-spacing: normal;
font-size: 2.5em;
}
}
.-wonder-woman{
background-image: url("../images/wonder-woman.png");
width: 1000px;
height: 100vh;
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
}
.swiper-container-vertical>.swiper-pagination-bullets{
left: 40px!important;
right: auto;
}
.swiper-pagination-bullet {
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
font-size: 12px;
color: #000;
opacity: 1;
background: rgba(0, 0, 0, 0.2);
}
.swiper-pagination-bullet-active {
color: #fff;
background: #007aff;
}
JS:
var swiper = new Swiper('.swiper-container', {
direction: 'vertical',
pagination: {
el: '.swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '<span class="' + className + '">' + (index + 1) + '</span>';
},
},
});
Face is perfectly possible, but I suggest you save the question for when you already have your code more developed, or at least you already have part of the code running so we can at least simulate your problem here... Look here http://prntscr.com/m2jzkr by the same Devtools has already started to style something in less than 2 minutes
– hugocsl
@hugocsl oloko as you did ? each dot would have to have a different style follows more calmly I’ll code
– Felipe Henrique
This Dot is actually a
span
Just put the text inside that Span. If this Span is generated automatically (I believe it is), then it is a little more difficult to style everything... but it is not impossible... it has to do with code running locally and with a real example, so I told you to develop more things before asking..., it is just a hint ;)– hugocsl
@hugocsl I edited the question and added the code I think it is now in the format that commented can help me from here ?
– Felipe Henrique
@hugocsl has as?
– Felipe Henrique
Yes, I’ve already moved here... it’s not very complex... but you have to have some technique with CSS, mainly to put the text in span that is generated dynamically... But virtually no need for JS, I did everything with CSS :D now is hope to reopen....
– hugocsl
@hugocsl cool face will it take to reopen ? is that all that is missing you can not answer now ?
– Felipe Henrique
That time I was at lunch :D, it worked with the code there?
– hugocsl