Boutique Customized Experience

Experimenta el encanto!

Habitaciones desde:

$160

Alojamiento
Áreas Sociales
Desayuno

Reservar Ahora

Contacta con Nosotros

4 + 11 =

Reservar una habitación

/** * MAIDITH — ROOMS CAROUSEL * Paste into: Divi > Theme Options > Integration > "Add code to the " * Wrap in tags when pasting into Divi */ (function () { function initMaidithCarousel() { var track = document.getElementById('maidith-track'); var vp = document.getElementById('maidith-vp'); var prev = document.getElementById('maidith-prev'); var next = document.getElementById('maidith-next'); var curEl = document.getElementById('maidith-cur'); var dots = document.querySelectorAll('.maidith-rooms__dot'); /* Exit silently if carousel is not on this page */ if (!track) return; var cards = track.querySelectorAll('.maidith-room-card'); var total = cards.length; var GAP = 16; var idx = 0; /* Live card width — recalculates correctly after resize */ function cw() { return cards[0] ? cards[0].getBoundingClientRect().width : 0; } /* ── Navigate to a slide ── */ function goTo(i, anim) { if (anim === undefined) anim = true; idx = Math.max(0, Math.min(i, total - 1)); track.style.transition = anim ? 'transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94)' : 'none'; track.style.transform = 'translateX(-' + (idx * (cw() + GAP)) + 'px)'; /* Update counter */ if (curEl) curEl.textContent = idx + 1; /* Update arrow disabled states */ if (prev) prev.disabled = (idx === 0); if (next) next.disabled = (idx === total - 1); /* Update dots */ dots.forEach(function (d, j) { d.classList.toggle('active', j === idx); d.setAttribute('aria-selected', String(j === idx)); }); } /* ── Arrow buttons ── */ if (prev) { prev.addEventListener('click', function () { goTo(idx - 1); }); } if (next) { next.addEventListener('click', function () { goTo(idx + 1); }); } /* ── Dot buttons ── */ dots.forEach(function (d) { d.addEventListener('click', function () { goTo(parseInt(d.getAttribute('data-i'))); }); }); /* ── Keyboard navigation ── */ if (vp) { vp.addEventListener('keydown', function (e) { if (e.key === 'ArrowLeft') goTo(idx - 1); if (e.key === 'ArrowRight') goTo(idx + 1); }); } /* ── Pointer drag (desktop click & drag) ── */ var down = false; var sx = 0; var so = 0; if (vp) { vp.addEventListener('pointerdown', function (e) { down = true; sx = e.clientX; so = idx * (cw() + GAP); track.style.transition = 'none'; vp.setPointerCapture(e.pointerId); }); vp.addEventListener('pointermove', function (e) { if (!down) return; track.style.transform = 'translateX(-' + (so - (e.clientX - sx)) + 'px)'; }); vp.addEventListener('pointerup', function (e) { if (!down) return; down = false; var dx = e.clientX - sx; var th = cw() * 0.2; if (dx th) goTo(idx - 1); else goTo(idx); }); } /* ── Touch swipe (mobile) ── */ var tx = 0; if (vp) { vp.addEventListener('touchstart', function (e) { tx = e.touches[0].clientX; }, { passive: true }); vp.addEventListener('touchend', function (e) { var dx = e.changedTouches[0].clientX - tx; if (dx 50) goTo(idx - 1); }, { passive: true }); } /* ── Recalculate position on window resize ── */ window.addEventListener('resize', function () { goTo(idx, false); }, { passive: true }); /* ── Initialise at slide 0 ── */ goTo(0, false); } /* Run after DOM is ready */ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initMaidithCarousel); } else { initMaidithCarousel(); } })();