fix that bullshit button

This commit is contained in:
sakrecoer 2026-08-07 11:56:26 +02:00
parent e18ed3f320
commit c3a9df080e
2 changed files with 9 additions and 3 deletions

View file

@ -743,6 +743,7 @@ button {
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
margin-top: 0.8rem; margin-top: 0.8rem;
z-index: 10;
} }
.lyrics-toggle:hover { .lyrics-toggle:hover {

View file

@ -222,9 +222,10 @@ function renderMusicTracks(tracks, containerId, randomize = false) {
card.className = 'music-card clickable'; card.className = 'music-card clickable';
card.dataset.playlistIndex = index; card.dataset.playlistIndex = index;
// Click on card opens lightbox // Click on card opens lightbox (except when clicking on info button)
card.addEventListener('click', function(e) { card.addEventListener('click', function(e) {
if (e.target.closest('audio') || e.target.closest('.lyrics-toggle') || e.target.closest('.lyrics')) { // Don't trigger if clicking on lyrics-toggle or inside lyrics
if (e.target.closest('.lyrics-toggle') || e.target.closest('.lyrics')) {
return; return;
} }
const idx = parseInt(this.dataset.playlistIndex); const idx = parseInt(this.dataset.playlistIndex);
@ -259,6 +260,7 @@ function renderMusicTracks(tracks, containerId, randomize = false) {
content = originalTrack.content || ''; content = originalTrack.content || '';
} }
// Build the card HTML
let cardHTML = ` let cardHTML = `
<div class="music-card-inner"> <div class="music-card-inner">
<div class="music-image-wrapper"> <div class="music-image-wrapper">
@ -298,7 +300,10 @@ function initMusicEventListeners() {
}); });
} }
function handleLyricsToggle() { function handleLyricsToggle(e) {
// Stop the click from bubbling up to the card
e.stopPropagation();
const lyrics = this.nextElementSibling; const lyrics = this.nextElementSibling;
if (lyrics && lyrics.classList.contains('lyrics')) { if (lyrics && lyrics.classList.contains('lyrics')) {
if (lyrics.style.display === 'none') { if (lyrics.style.display === 'none') {