From a398bcb737d9da1bc15cc4577e1dc1c870419c85 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 12:47:51 +0200 Subject: [PATCH] feat: add map-to-card flash highlight on marker click --- themes/intotheeast/templates/trip.html.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index a45a9d7..90fbc4f 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -321,7 +321,12 @@ tripMap.on('load', function () { el.addEventListener('mouseleave', function () { popup.remove(); }); el.addEventListener('click', function () { var card = document.getElementById('entry-' + entry.slug); - if (card) card.scrollIntoView({ behavior: 'smooth', block: 'center' }); + if (!card) return; + card.scrollIntoView({ behavior: 'smooth', block: 'center' }); + setTimeout(function () { + card.classList.add('is-highlighted'); + setTimeout(function () { card.classList.remove('is-highlighted'); }, 700); + }, 350); }); new maplibregl.Marker({ element: el }).setLngLat(lngLat).addTo(tripMap);