feat: add reusable gallery carousel and ranking feed infrastructure

This commit is contained in:
2026-02-28 07:56:25 +01:00
parent 67ef79766c
commit 6536d4ae78
36 changed files with 3177 additions and 373 deletions

View File

@@ -0,0 +1,31 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import CategoryPillCarousel from './components/gallery/CategoryPillCarousel';
function mountAll() {
document.querySelectorAll('[data-react-pill-carousel]').forEach((container) => {
if (container.dataset.reactMounted) return;
container.dataset.reactMounted = '1';
let items = [];
try {
items = JSON.parse(container.dataset.items || '[]');
} catch {
items = [];
}
createRoot(container).render(
<CategoryPillCarousel
items={items}
ariaLabel={container.dataset.ariaLabel || 'Filter by category'}
className={container.dataset.className || ''}
/>,
);
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', mountAll);
} else {
mountAll();
}