summaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js')
-rw-r--r--public/js/album.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/public/js/album.js b/public/js/album.js
index 74d524c..d3a563a 100644
--- a/public/js/album.js
+++ b/public/js/album.js
@@ -96,6 +96,19 @@ window.addEventListener('DOMContentLoaded', () => {
}
});
+// Album search filter
+(function () {
+ const input = document.getElementById('album-search');
+ if (!input) return;
+ input.addEventListener('input', () => {
+ const q = input.value.trim().toLowerCase();
+ document.querySelectorAll('#album-grid .album-card').forEach(card => {
+ const label = (card.querySelector('.album-label')?.textContent || '').toLowerCase();
+ card.style.display = !q || label.includes(q) ? '' : 'none';
+ });
+ });
+})();
+
// Touch swipe
(function () {
let startX = null;