feat(video-cards): add click navigation to video and shorts cards

Implement click event handlers for video cards, shorts cards, and search results to navigate to their respective detail pages. Also adjust grid layout dimensions for better responsiveness.
This commit is contained in:
2026-02-11 19:23:07 +08:00
parent 593a5cc02a
commit 0f551dc541
2 changed files with 21 additions and 6 deletions

View File

@@ -619,6 +619,11 @@ function createVideoCard(video) {
menuDropdown.classList.remove('show');
});
// Add click event to the card
card.addEventListener('click', () => {
window.location.href = `video.html?id=${video.id}`;
});
return card;
}
@@ -639,6 +644,11 @@ function createShortsCard(video) {
</div>
`;
// Add click event to the card
card.addEventListener('click', () => {
window.location.href = `short.html?id=${video.id}`;
});
return card;
}
@@ -714,6 +724,11 @@ function renderSearchResults(results, query) {
</div>
`;
// Add click event to the search result item
item.addEventListener('click', () => {
window.location.href = `video.html?id=${video.id}`;
});
searchResultsContent.appendChild(item);
});