/** * AKSRT Download Status * * Handles download center page interactions: * - Resource type filter animation * - Price badge hover effects * - Status bar refresh on download completion * * @package AKSRT */ (function () { 'use strict'; var DownloadStatus = { init: function (root) { this.root = root || document; this.initFilterHighlight(); this.initCardHover(); }, /** * Animate filter button active state */ initFilterHighlight: function () { var filters = this.root.nodeType === 1 && this.root.matches('.aksrt-download-hero__filter') ? [this.root] : this.root.querySelectorAll('.aksrt-download-hero__filter'); if (filters.length === 0) return; filters.forEach(function (btn) { if (btn.dataset.aksrtDownloadHoverBound === '1') return; btn.dataset.aksrtDownloadHoverBound = '1'; btn.addEventListener('mouseenter', function () { btn.style.transform = 'translateY(-1px)'; }); btn.addEventListener('mouseleave', function () { btn.style.transform = ''; }); }); }, /** * Card hover depth effect */ initCardHover: function () { var cards = this.root.nodeType === 1 && this.root.matches('.aksrt-download-card') ? [this.root] : this.root.querySelectorAll('.aksrt-download-card'); if (cards.length === 0) return; cards.forEach(function (card) { if (card.dataset.aksrtDownloadHoverBound === '1') return; card.dataset.aksrtDownloadHoverBound = '1'; card.addEventListener('mouseenter', function () { card.style.transform = 'translateY(-2px)'; }); card.addEventListener('mouseleave', function () { card.style.transform = ''; }); }); }, }; window.AksrtFrontend.register('aksrt-download-status', function (root) { DownloadStatus.init(root); }); })();