Which car do you want to drive?
{
const isDesktop = window.innerWidth >= 1024;
const el = document.getElementById((isDesktop ? 'expand-d-' : 'expand-m-') + '7');
if (!el) return;
// Keep scroll position stable after DOM reflow
if (window.scrollY !== startY) window.scrollTo(0, startY);
const rect = el.getBoundingClientRect();
const elTopAbs = rect.top + window.scrollY;
const viewportH = window.innerHeight;
let target;
if (isDesktop) {
// Vertically center expanded in viewport
target = elTopAbs + rect.height / 2 - viewportH / 2;
} else {
// Mobile: align top of expanded ~100px from viewport top
target = elTopAbs - 100;
}
const maxScroll = document.documentElement.scrollHeight - viewportH;
target = Math.max(0, Math.min(target, maxScroll));
const distance = target - startY;
if (Math.abs(distance) < 8) return;
// Gentle: pace ~1px per ms, clamped
const duration = Math.min(1800, Math.max(800, Math.abs(distance) * 1.3));
const startTime = performance.now();
const easeInOutSine = t => -(Math.cos(Math.PI * t) - 1) / 2;
const step = now => {
const elapsed = now - startTime;
const progress = Math.min(elapsed / duration, 1);
window.scrollTo(0, startY + distance * easeInOutSine(progress));
if (progress < 1) requestAnimationFrame(step);
};
requestAnimationFrame(step);
});
}
"
:class="selectedCar === 7 ? 'border-primary ring-2 ring-primary/20' : 'border-gray-200 hover:border-primary/50'"
class="bg-white rounded-2xl border-2 overflow-hidden cursor-pointer transition-all duration-200">
Limousine AUTOMATIC
Limousine AUTOMATIC
Mercedes V-Class
or Similar Limousine
320 KM (€164)
/ per Day
7
Automatic
5 5+
Unlimited Kilometers
No Deposit