<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Trend Car Rentals Fleet Carousel</title>
<style>
/* Container */
.trend-carousel {
max-width: 1200px;
margin: 40px auto;
padding: 0 20px;
position: relative;
overflow: hidden;
font-family: Arial, Helvetica, sans-serif;
}
/* Track */
.trend-carousel-track {
display: flex;
transition: transform 0.5s ease;
}
/* Card */
.trend-car-card {
min-width: calc(33.333% – 20px);
margin: 0 10px;
background: #fff;
border-radius: 14px;
overflow: hidden;
box-shadow: 0 5px 20px rgba(0,0,0,0.1);
flex-shrink: 0;
}
.trend-car-card img {
width: 100%;
height: 220px;
object-fit: cover;
display: block;
}
.trend-card-content {
padding: 20px;
}
.trend-card-content h3 {
margin: 0 0 10px;
color: #003366;
font-size: 22px;
}
.trend-card-content p {
color: #555;
margin-bottom: 15px;
line-height: 1.5;
}
.trend-btn {
display: inline-block;
background: #f58220;
color: #fff;
text-decoration: none;
padding: 10px 18px;
border-radius: 6px;
transition: 0.3s;
}
.trend-btn:hover {
background: #d96d11;
}
/* Navigation */
.carousel-nav {
position: absolute;
top: 45%;
transform: translateY(-50%);
width: 48px;
height: 48px;
border: none;
border-radius: 50%;
background: rgba(0,0,0,0.75);
color: #fff;
font-size: 24px;
cursor: pointer;
z-index: 10;
}
.carousel-prev {
left: 5px;
}
.carousel-next {
right: 5px;
}
/* Dots */
.carousel-dots {
text-align: center;
margin-top: 20px;
}
.carousel-dot {
width: 12px;
height: 12px;
background: #ccc;
border-radius: 50%;
display: inline-block;
margin: 0 5px;
cursor: pointer;
}
.carousel-dot.active {
background: #f58220;
}
/* Tablet */
@media (max-width: 992px) {
.trend-car-card {
min-width: calc(50% – 20px);
}
}
/* Mobile */
@media (max-width: 768px) {
.trend-car-card {
min-width: calc(100% – 20px);
}
}
</style>
</head>
<body>
<div class=”trend-carousel”>
<button class=”carousel-nav carousel-prev”>❮</button>
<button class=”carousel-nav carousel-next”>❯</button>
<div class=”trend-carousel-track”>
<div class=”trend-car-card”>
https://via.placeholder.com/600×400
<div class=”trend-card-content”>
<h3>Compact Car</h3>
<p>Fuel-efficient and ideal for city driving around Adelaide.</p>
/adelaide-airport-car-rentals/Book Now</a>
</div>
</div>
<div class=”trend-car-card”>
https://via.placeholder.com/600×400
<div class=”trend-card-content”>
<h3>SUV</h3>
<p>Extra luggage space and comfort for family adventures.</p>
/adelaide-airport-car-rentals/Book Now</a>
</div>
</div>
<div class=”trend-car-card”>
https://via.placeholder.com/600×400
<div class=”trend-card-content”>
<h3>Premium Sedan</h3>
<p>Business-class comfort with premium styling.</p>
/adelaide-airport-car-rentals/Book Now</a>
</div>
</div>
<div class=”trend-car-card”>
https://via.placeholder.com/600×400
<div class=”trend-card-content”>
<h3>People Mover</h3>
<p>Perfect for groups with generous passenger space.</p>
/adelaide-airport-car-rentals/Book Now</a>
</div>
</div>
<div class=”trend-car-card”>
https://via.placeholder.com/600×400
<div class=”trend-card-content”>
<h3>Ute</h3>
<p>Reliable utility vehicle suitable for work or travel.</p>
/adelaide-airport-car-rentals/Book Now</a>
</div>
</div>
</div>
<div class=”carousel-dots”></div>
</div>
<script>
const track = document.querySelector(‘.trend-carousel-track’);
const cards = document.querySelectorAll(‘.trend-car-card’);
const nextBtn = document.querySelector(‘.carousel-next’);
const prevBtn = document.querySelector(‘.carousel-prev’);
const dotsContainer = document.querySelector(‘.carousel-dots’);
let currentIndex = 0;
function getVisibleCards() {
if (window.innerWidth <= 768) return 1;
if (window.innerWidth <= 992) return 2;
return 3;
}
function renderDots() {
dotsContainer.innerHTML = ”;
const totalSlides = cards.length – getVisibleCards() + 1;
for (let i = 0; i < totalSlides; i++) {
const dot = document.createElement(‘span’);
dot.classList.add(‘carousel-dot’);
if (i === currentIndex) {
dot.classList.add(‘active’);
}
dot.addEventListener(‘click’, () => {
currentIndex = i;
updateCarousel();
});
dotsContainer.appendChild(dot);
}
}
function updateCarousel() {
const cardWidth = cards[0].offsetWidth + 20;
track.style.transform =
`translateX(-${currentIndex * cardWidth}px)`;
document.querySelectorAll(‘.carousel-dot’).forEach((dot, index) => {
dot.classList.toggle(‘active’, index === currentIndex);
});
}
nextBtn.addEventListener(‘click’, () => {
const maxIndex = cards.length – getVisibleCards();
if (currentIndex < maxIndex) {
currentIndex++;
} else {
currentIndex = 0;
}
updateCarousel();
});
prevBtn.addEventListener(‘click’, () => {
const maxIndex = cards.length – getVisibleCards();
if (currentIndex > 0) {
currentIndex–;
} else {
currentIndex = maxIndex;
}
updateCarousel();
});
// Touch swipe support
let startX = 0;
let endX = 0;
track.addEventListener(‘touchstart’, e => {
startX = e.touches[0].clientX;
});
track.addEventListener(‘touchend’, e => {
endX = e.changedTouches[0].clientX;
if (startX – endX > 50) nextBtn.click();
if (endX – startX > 50) prevBtn.click();
});
window.addEventListener(‘resize’, () => {
currentIndex = 0;
renderDots();
updateCarousel();
});
renderDots();
updateCarousel();
</script>
</body>
</html>