Hello i would like some advices in what i can improve in the css for the carrousel with the glide library . I will post both carrousel and css code
body, html {
margin: 0;
padding: 0;
height: 100%;
}
.container-fluid {
padding: 0;
}
.navbar-bg {
margin-bottom: 0;
}
.footer {
margin-top: 0;
}
/* Define a altura do carrossel */
.carousel {
height: calc(100vh - 120px); /* Altura padrão para a área do carrossel em desktops */
margin-bottom: 0;
overflow: hidden;
}
@media (max-width: 768px) {
.carousel {
height: 50vh; /* Ajusta a altura do carrossel em dispositivos móveis */
}
}
.glide {
position: relative;
width: 100%;
height: 100%;
margin: auto;
}
.glide__track {
height: 100%;
}
.glide__slides {
height: 100%;
}
.glide__slide {
position: relative;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
height: 100%;
}
.glide__slide img {
width: 100%;
height: 100%;
object-fit: cover; /* Manter a proporção da imagem */
filter: brightness(70%);
}
.carousel-caption {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
z-index: 1;
width: 80%;
}
.carousel-caption h1, .carousel-caption h2, .carousel-caption h3 {
font-size: 2em;
line-height: 1.2;
}
@media (min-width: 768px) {
.carousel-caption h1, .carousel-caption h2, .carousel-caption h3 {
font-size: 3em;
}
}
@media (min-width: 1200px) {
.carousel-caption h1, .carousel-caption h2, .carousel-caption h3 {
font-size: 4em;
}
}
.glide__bullets {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
z-index: 1;
}
.glide__bullet {
background: rgba(255, 255, 255, 0.7);
border: 1px solid #333;
border-radius: 50%;
width: 12px;
height: 12px;
margin: 0 5px;
cursor: pointer;
}
.glide__bullet--active {
background: blue; /* Cor azul para o dot ativo */
}
.carousel-content {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.carousel-caption button {
font-size: 0.8em;
padding: 8px 16px;
}
@media (min-width: 768px) {
.carousel-caption button {
font-size: 1em;
padding: 10px 20px;
}
}
@media (min-width: 1200px) {
.carousel-caption button {
font-size: 1.2em;
padding: 12px 24px;
}
}
.glide__arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: #333;
color: #fff;
border: none;
padding: 5px;
cursor: pointer;
z-index: 1;
background: blue; /* Cor das setas de navegação */
}
.glide__arrow--left {
left: 10px;
}
.glide__arrow--right {
right: 10px;
}
</style>
</head>
<body>
<!-- Spinner Start -->
<div id="spinner" class="show w-100 vh-100 bg-white position-fixed translate-middle top-50 start-50 d-flex align-items-center justify-content-center" role="alert">
<div class="spinner-grow text-primary" role="status"></div>
</div>
<!-- Spinner End -->
<!-- Navbar Start -->
<div class="container-fluid navbar-bg">
<div class="container">
<nav class="navbar navbar-dark navbar-expand-lg py-lg-0" role="navigation">
<a href="index.html" class="navbar-brand">
<img data-src="img/logotipofinalv2.webp" alt="Logotipo da Empresa" width="75" height="75" style="height: auto;" class="lozad navbar-logo" srcset="img/logotipofinalv2.webp 1x, img/logotipofinalv2@2x.webp 2x, img/logotipofinalv2@3x.webp 3x">
</a>
<button class="navbar-toggler bg-primary" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-label="Toggle navigation">
<span class="fa fa-bars text-dark"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="navbar-nav mx-auto" role="menubar">
<a href="index.html" class="nav-item nav-link" role="menuitem">Home</a>
<a href="about.html" class="nav-item nav-link" role="menuitem">Acerca</a>
<a href="service.html" class="nav-item nav-link" role="menuitem">Serviços</a>
<a href="contact.html" class="nav-item nav-link" role="menuitem">Contatos</a>
</div>
</div>
</nav>
</div>
</div>
<!-- Navbar End -->
<!-- Carousel Start -->
<div class="container-fluid carousel px-0 mb-0">
<div class="glide">
<div class="glide__track" data-glide-el="track">
<div class="glide__slides">
<div class="glide__slide">
<img data-src="img/fotos33.webp" class="img-fluid w-100 lozad carousel-image" alt="First slide" width="719" height="512" />
<div class="carousel-caption">
<div class="container carousel-content">
<h1 class="text-white display-1 mb-4 animated slideInDown">Transformando ruas em passarelas</h1>
<a href="service.html" class="me-2">
<button type="button" class="px-5 py-3 btn btn-primary border-2 rounded-pill animated slideInDown">Saiba mais..</button>
</a>
</div>
</div>
</div>
<div class="glide__slide">
<img data-src="img/foto21.webp" class="img-fluid w-100 lozad carousel-image" alt="Second slide" width="719" height="512" />
<div class="carousel-caption">
<div class="container carousel-content">
<h2 class="text-white mb-4 animated slideInDown">Calçada Artesanal</h2>
<h3 class="text-white display-1 mb-4 animated slideInDown">Porque até o chão merece um upgrade!</h3>
<a href="service.html" class="me-2">
<button type="button" class="px-5 py-3 btn btn-primary border-2 rounded-pill animated slideInDown">Saiba mais..</button>
</a>
</div>
</div>
</div>
<div class="glide__slide">
<img data-src="img/fotos44.webp" class="img-fluid w-100 lozad carousel-image" alt="Third slide" width="719" height="512" />
<div class="carousel-caption">
<div class="container carousel-content">
<h2 class="text-white mb-4 animated slideInDown">Calçada Artesanal</h2>
<h3 class="text-white display-1 mb-4 animated slideInDown">Onde até os pombos tiram selfies!</h3>
<a href="service.html" class="me-2">
<button type="button" class="px-5 py-3 btn btn-primary border-2 rounded-pill animated slideInDown">Saiba mais..</button>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="glide__arrows" data-glide-el="controls">
<button class="glide__arrow glide__arrow--left" data-glide-dir="<">«</button>
<button class="glide__arrow glide__arrow--right" data-glide-dir=">">»</button>
</div>
<div class="glide__bullets" data-glide-el="controls[nav]">
<button class="glide__bullet" data-glide-dir="=0"></button>
<button class="glide__bullet" data-glide-dir="=1"></button>
<button class="glide__bullet" data-glide-dir="=2"></button>
</div>
</div>
</div>
<!-- Carousel End -->