diff --git a/site/assets/css/style.css b/site/assets/css/style.css index 153b69c..2d06d44 100644 --- a/site/assets/css/style.css +++ b/site/assets/css/style.css @@ -2725,7 +2725,9 @@ h3.contact-title { align-items: center; } -.schedule.is-3day .sched-nav, +/* Desktop 3-day view: arrows stay only beside the centred/focused day — + the side days are already directly clickable, arrows there would be noise. */ +.schedule.is-3day .schedule_dayhead.sched-side .sched-nav, .schedule-export .sched-nav { display: none; } @@ -2843,6 +2845,10 @@ h3.contact-title { .schedule.is-3day:not(.schedule-export) .schedule_dayhead.sched-side { cursor: pointer; } + .schedule.is-3day:not(.schedule-export) .schedule_dayhead.sched-pos-2 { + gap: 10px; + align-items: center; + } } /* ── Aula experimental modal ───────────────────────────────────────────────── */ diff --git a/site/assets/js/main.js b/site/assets/js/main.js index 0aa1853..2fdec7c 100644 --- a/site/assets/js/main.js +++ b/site/assets/js/main.js @@ -446,6 +446,24 @@ document.addEventListener('DOMContentLoaded', function () { var reflow = function () { if (current) showDay(current); }; if (wide.addEventListener) wide.addEventListener('change', reflow); else if (wide.addListener) wide.addListener(reflow); + // Swipe left/right on phones/tablets to change day — same effect as the + // arrows. Only acts on mostly-horizontal drags, so a vertical page scroll + // starting over the schedule is never hijacked. + var touchStart = null; + var container = scope.querySelector('.schedule_container') || scope; + container.addEventListener('touchstart', function (e) { + var t = e.changedTouches[0]; + touchStart = { x: t.clientX, y: t.clientY }; + }, { passive: true }); + container.addEventListener('touchend', function (e) { + if (!touchStart) return; + var t = e.changedTouches[0]; + var dx = t.clientX - touchStart.x, dy = t.clientY - touchStart.y; + touchStart = null; + if (Math.abs(dx) < 40 || Math.abs(dx) < Math.abs(dy) * 1.5) return; + step(dx < 0 ? 1 : -1); + }, { passive: true }); + // Pre-select today when the schedule has a header for it (PT day names), // otherwise the first day. var ptDays = { 1: 'segunda', 2: 'terça', 3: 'quarta', 4: 'quinta', 5: 'sexta', 6: 'sábado' }; @@ -454,6 +472,22 @@ document.addEventListener('DOMContentLoaded', function () { if (start) showDay(start); }); +/* ── Horário: hide the "Ver Horário das aulas" toggle once open ───────────── + The button's only job is opening the accordion — once it has, leaving it + sitting above the now-visible schedule is dead weight (and confusing when + the navbar link opened it without a click on the button itself). */ +document.addEventListener('DOMContentLoaded', function () { + document.querySelectorAll('.collapse[id^="horarioCollapse"]').forEach(function (el) { + var toggles = document.querySelectorAll('[data-bs-toggle="collapse"][data-bs-target="#' + el.id + '"]'); + el.addEventListener('shown.bs.collapse', function () { + toggles.forEach(function (b) { b.hidden = true; }); + }); + el.addEventListener('hidden.bs.collapse', function () { + toggles.forEach(function (b) { b.hidden = false; }); + }); + }); +}); + /* ── Equipa: detail card that grows out of the tile ───────────────────────── Desktop: hover (or keyboard focus) opens. The card is laid exactly over the tile photo, tilted like it, and the CSS unclips/straightens it sideways —