feat: show 24 genre pills on desktop, 12 on mobile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-23 11:54:31 +02:00
1 parent 6894e8a94a
commit 790f02e5b4
1 file changed
+3 -3
+3 -3
View File
@@ -168,7 +168,7 @@ function _genreColor(name) {
let _allGenres = [];
let _genresExpanded = false;
const GENRE_LIMIT = 15;
const GENRE_LIMIT = () => window.innerWidth >= 700 ? 24 : 12;
async function loadGenreSection() {
const el = document.getElementById('home-genres');
@@ -180,14 +180,14 @@ async function loadGenreSection() {
.filter(g => (g.songCount || 0) > 0)
.sort((a, b) => (b.songCount || 0) - (a.songCount || 0));
_renderGenres();
if (_allGenres.length > GENRE_LIMIT && more) more.style.display = '';
if (_allGenres.length > GENRE_LIMIT() && more) more.style.display = '';
} catch { el.style.display = 'none'; }
}
function _renderGenres() {
const el = document.getElementById('home-genres');
if (!el) return;
const list = _genresExpanded ? _allGenres : _allGenres.slice(0, GENRE_LIMIT);
const list = _genresExpanded ? _allGenres : _allGenres.slice(0, GENRE_LIMIT());
el.innerHTML = '';
list.forEach(g => {
const card = document.createElement('div');