Teste iniciais
This commit is contained in:
parent
ae1cd10cd7
commit
5d9f9e9602
242
index.html
242
index.html
@ -1,31 +1,221 @@
|
||||
<div id="destaques-moan" class="carousel slide" data-bs-ride="carousel">
|
||||
<div class="carousel-indicators">
|
||||
<button type="button" data-bs-target="#destaques-moan" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
|
||||
<button type="button" data-bs-target="#destaques-moan" data-bs-slide-to="1" aria-label="Slide 2"></button>
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Destaques da Editora Moan</title>
|
||||
|
||||
<style>
|
||||
* {box-sizing: border-box}
|
||||
body {font-family: Verdana, sans-serif; margin:0}
|
||||
img {vertical-align: middle;}
|
||||
|
||||
/* Slideshow container */
|
||||
.slideshow-container {
|
||||
position: relative;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
width: 100vw;
|
||||
max-width: 405px;
|
||||
height: 56.8vw;
|
||||
max-height: 230px;
|
||||
}
|
||||
|
||||
/* Next & previous buttons */
|
||||
.prev, .next {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: auto;
|
||||
padding: 9px;
|
||||
margin-top: -22px;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
transition: 0.6s ease;
|
||||
border-radius: 0 3px 3px 0;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
background-color: rgba(0,0,0,0.35);
|
||||
}
|
||||
|
||||
/* Position the "next button" to the right */
|
||||
.next {
|
||||
right: 0;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
/* On hover, add a black background color with a little bit see-through */
|
||||
.prev:hover, .next:hover {
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
}
|
||||
|
||||
/* Caption text */
|
||||
.text {
|
||||
color: #f2f2f2;
|
||||
font-size: 15px;
|
||||
padding: 8px 12px;
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dots {
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.dot {
|
||||
cursor: pointer;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
margin: 0 2px;
|
||||
background-color: #aaa;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
transition: background-color 0.6s ease;
|
||||
}
|
||||
|
||||
.active, .dot:hover {
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.slide {
|
||||
width: 100%;
|
||||
transition: all .3s ease-in-out;
|
||||
}
|
||||
|
||||
.slide img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
max-width: 405px;
|
||||
height: auto;
|
||||
max-height: 230px;
|
||||
}
|
||||
|
||||
.slide a {
|
||||
padding: 5px 10px;
|
||||
background-color: #F0AF2A;
|
||||
position: absolute;
|
||||
z-index: 101;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-weight: bold;
|
||||
font-family: sans-serif;
|
||||
bottom: 40px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: large;
|
||||
transition: all .4s ease-in-out;
|
||||
}
|
||||
|
||||
.slide a:hover {
|
||||
background-color: #eec26b;
|
||||
}
|
||||
|
||||
/* On smaller screens, decrease text size */
|
||||
@media only screen and (max-width: 310px) {
|
||||
.prev, .next,.text {font-size: 11px}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="slideshow-container">
|
||||
|
||||
<div class="slide">
|
||||
|
||||
<img src="./Imagem1.png" alt=""/>
|
||||
|
||||
<a href="#">Veja</a>
|
||||
|
||||
</div>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<img src="/carrossel/Imagem1.png" class="d-block w-100" alt="...">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h5>First slide label</h5>
|
||||
<p>Some representative placeholder content for the first slide.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="/carrossel/Captura.png" class="d-block w-100" alt="...">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h5>Second slide label</h5>
|
||||
<p>Some representative placeholder content for the second slide.</p>
|
||||
|
||||
<div class="slide">
|
||||
|
||||
<img src="./Captura.png" alt=""/>
|
||||
|
||||
<a href="#">Leia agora</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<a class="prev" onclick="plusSlides(-1)">❮</a>
|
||||
<a class="next" onclick="plusSlides(1)">❯</a>
|
||||
|
||||
<div class="dots">
|
||||
<span class="dot" onclick="currentSlide(1)"></span>
|
||||
<span class="dot" onclick="currentSlide(2)"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button class="carousel-control-prev" type="button" data-bs-target="#destaques-moan" data-bs-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="visually-hidden">Anterior</span>
|
||||
</button>
|
||||
<button class="carousel-control-next" type="button" data-bs-target="#destaques-moan" data-bs-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="visually-hidden">Próximo</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
let slideIndex = 1;
|
||||
showSlides(slideIndex);
|
||||
|
||||
let slideInterval = setInterval(function() {
|
||||
plusSlides(1);
|
||||
}, 5000);
|
||||
|
||||
document.querySelector('.slideshow-container').addEventListener('mouseenter', function() {
|
||||
clearInterval(slideInterval);
|
||||
});
|
||||
|
||||
document.querySelector('.slideshow-container').addEventListener('mouseleave', function() {
|
||||
slideInterval = setInterval(function() {
|
||||
plusSlides(1);
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
document.querySelector('.dot').addEventListener('mouseenter', function() {
|
||||
clearInterval(slideInterval);
|
||||
});
|
||||
|
||||
document.querySelector('.dot').addEventListener('mouseleave', function() {
|
||||
slideInterval = setInterval(function() {
|
||||
plusSlides(1);
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
function plusSlides(n) {
|
||||
|
||||
showSlides(slideIndex += n);
|
||||
}
|
||||
|
||||
function currentSlide(n) {
|
||||
|
||||
showSlides(slideIndex = n);
|
||||
}
|
||||
|
||||
function showSlides(n) {
|
||||
let i;
|
||||
let slides = document.getElementsByClassName("slide");
|
||||
let dots = document.getElementsByClassName("dot");
|
||||
if (n > slides.length) {slideIndex = 1}
|
||||
if (n < 1) {slideIndex = slides.length}
|
||||
for (i = 0; i < slides.length; i++) {
|
||||
slides[i].style.opacity = 0;
|
||||
}
|
||||
for (i = 0; i < dots.length; i++) {
|
||||
dots[i].className = dots[i].className.replace(" active", "");
|
||||
}
|
||||
slides[slideIndex-1].style.opacity = 1;
|
||||
dots[slideIndex-1].className += " active";
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user