feat: remplacer les étoiles par les réactions dans le hero article

This commit is contained in:
Cedric Abonnel
2026-05-13 01:48:28 +02:00
parent f603c02c81
commit 86baf0bfbb
12 changed files with 410 additions and 92 deletions
+11 -7
View File
@@ -26,14 +26,18 @@ document.addEventListener('DOMContentLoaded', function () {
if (!json.ok) { form.submit(); return; }
var nowActive = json.active;
btn.classList.toggle('btn-primary', nowActive);
btn.classList.toggle('btn-outline-secondary', !nowActive);
if (badge) {
badge.classList.toggle('bg-light', nowActive);
badge.classList.toggle('text-primary', nowActive);
badge.classList.toggle('bg-secondary', !nowActive);
badge.textContent = json.count;
if (btn.classList.contains('hero-reaction-btn')) {
btn.classList.toggle('hero-reaction-btn--active', nowActive);
} else {
btn.classList.toggle('btn-primary', nowActive);
btn.classList.toggle('btn-outline-secondary', !nowActive);
if (badge) {
badge.classList.toggle('bg-light', nowActive);
badge.classList.toggle('text-primary', nowActive);
badge.classList.toggle('bg-secondary', !nowActive);
}
}
if (badge) { badge.textContent = json.count; }
})
.catch(function () { form.submit(); });
});