62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
/**
|
|
* 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 () {
|
|
this.initFilterHighlight();
|
|
this.initCardHover();
|
|
},
|
|
|
|
/**
|
|
* Animate filter button active state
|
|
*/
|
|
initFilterHighlight: function () {
|
|
var filters = document.querySelectorAll('.aksrt-download-hero__filter');
|
|
if (filters.length === 0) return;
|
|
|
|
filters.forEach(function (btn) {
|
|
btn.addEventListener('mouseenter', function () {
|
|
btn.style.transform = 'translateY(-1px)';
|
|
});
|
|
btn.addEventListener('mouseleave', function () {
|
|
btn.style.transform = '';
|
|
});
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Card hover depth effect
|
|
*/
|
|
initCardHover: function () {
|
|
var cards = document.querySelectorAll('.aksrt-download-card');
|
|
if (cards.length === 0) return;
|
|
|
|
cards.forEach(function (card) {
|
|
card.addEventListener('mouseenter', function () {
|
|
card.style.transform = 'translateY(-2px)';
|
|
});
|
|
card.addEventListener('mouseleave', function () {
|
|
card.style.transform = '';
|
|
});
|
|
});
|
|
},
|
|
};
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', function () { DownloadStatus.init(); });
|
|
} else {
|
|
DownloadStatus.init();
|
|
}
|
|
})();
|