Fix animations

This commit is contained in:
2026-05-02 07:23:13 +07:00
parent 2cde8401d3
commit 4b954eaa7e
4 changed files with 213 additions and 50 deletions

View File

@@ -113,23 +113,36 @@ function renderScheduleTeaser() {
const container = document.getElementById('sfB-coming-row');
if (!container) return;
const now = new Date();
const today = getTodayName();
const startIdx = DAYS_ORDER.indexOf(today);
const order = [...DAYS_ORDER.slice(startIdx), ...DAYS_ORDER.slice(0, startIdx)];
const dayOffset = {};
DAYS_ORDER.forEach(name => {
dayOffset[name] = (DAYS_ORDER.indexOf(name) - startIdx + 7) % 7;
});
const sorted = [...SCHEDULE].sort(
(a, b) => order.indexOf(a.day) - order.indexOf(b.day)
);
container.innerHTML = sorted.slice(0, 4).map(row => `
container.innerHTML = sorted.slice(0, 4).map(row => {
const offset = dayOffset[row.day];
const date = new Date(now);
date.setDate(now.getDate() + offset);
const dayNum = `${date.getDate()}/${date.getMonth() + 1}`;
return `
<a href="schedule.html" class="sfB-tcard">
<div class="day">${row.day}</div>
<div class="day"><span class="day-date">${dayNum}</span> ${row.day}</div>
<div class="when">${row.when || ''}</div>
<h4>${row.social}</h4>
<div class="organizer">${row.organizer}</div>
<div class="at">@ ${row.venue} · ${row.city}</div>
<div class="chips">${musicToChips(row.music)}</div>
</a>
`).join('');
`;
}).join('');
}
// ---- Filter pills (studios.html / classes.html) ----