feat(site): horário — esconde botão ao abrir, setas no desktop, swipe no telemóvel
- "Ver Horário das aulas" desaparece assim que o acordeão abre (clique no próprio botão ou o link "Horário" da navbar a abrir por JS) — deixa de ficar um botão grande por cima da grelha já visível. - Setas ‹ › junto ao dia em foco também no desktop (vista de 3 dias): só o dia central as mostra, os laterais continuam sem elas (já são clicáveis diretamente). - Deslizar no telemóvel/tablet muda de dia, com o mesmo efeito das setas — só reage a arrastos maioritariamente horizontais, para não roubar o scroll vertical da página. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1e88781b8
commit
4bf177289a
2 files changed
+41
-1
No files matched your search
@@ -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 ───────────────────────────────────────────────── */
|
||||
|
||||
@@ -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 —
|
||||
|
||||
Reference in new issue
Block a user