upskill-event-manager/assets/js/vertical-product-gallery-slider.min.js
Ben Reed cdc5ea85f4 feat: Add comprehensive CSS, JavaScript and theme asset infrastructure
Add massive collection of CSS, JavaScript and theme assets that were previously excluded:

**CSS Files (681 total):**
- HVAC plugin-specific styles (hvac-*.css): 34 files including dashboard, certificates, registration, mobile nav, accessibility fixes, animations, and welcome popup
- Theme framework files (Astra, builder systems, layouts): 200+ files
- Plugin compatibility styles (WooCommerce, WPForms, Elementor, Contact Form 7): 150+ files
- WordPress core and editor styles: 50+ files
- Responsive and RTL language support: 200+ files

**JavaScript Files (400+ total):**
- HVAC plugin functionality (hvac-*.js): 27 files including menu systems, dashboard enhancements, profile sharing, mobile responsive features, accessibility, and animations
- Framework and library files: jQuery plugins, GSAP, AOS, Swiper, Chart.js, Lottie, Isotope
- Plugin compatibility scripts: WPForms, WooCommerce, Elementor, Contact Form 7, LifterLMS
- WordPress core functionality: customizer, admin, block editor compatibility
- Third-party integrations: Stripe, SMTP, analytics, search functionality

**Assets:**
- Certificate background images and logos
- Comprehensive theme styling infrastructure
- Mobile-responsive design systems
- Cross-browser compatibility assets
- Performance-optimized minified versions

**Updated .gitignore:**
- Fixed asset directory whitelisting patterns to properly include CSS/JS/images
- Added proper directory structure recognition (!/assets/css/, !/assets/js/, etc.)
- Maintains security by excluding sensitive files while including essential assets

This commit provides the complete frontend infrastructure needed for:
- Full theme functionality and styling
- Plugin feature implementations
- Mobile responsiveness and accessibility
- Cross-browser compatibility
- Performance optimization
- Developer workflow support
2025-08-11 16:20:31 -03:00

1 line
No EOL
4.3 KiB
JavaScript

function dynamicImageResize(e,t){var r=document.querySelector("#ast-vertical-thumbnail-wrapper"),a=t.getElementsByTagName("div")[0],e=(a&&r&&(e.rowHeight=a.offsetHeight,t.style.height=a=e.numVisible*e.rowHeight+"px",r.style.height=a,t.style.visibility="visible"),document.querySelector(".woocommerce-product-gallery__wrapper"));if(e){let t=r.clientHeight;a=e.querySelectorAll("a img");a&&a.forEach(e=>{e.style.height=t-10+"px"})}}function MoveSlide(t,r,a){var i=document.querySelector("#ast-vertical-slider-inner");if(i){var l=i.querySelector("img").clientHeight+10;let e=parseInt(i.getAttribute("ast-translate"));l&&("next"===t?enableDisableNavigationArrows(r,a,e+=l,l):0<e&&enableDisableNavigationArrows(r,a,e-=l,l),i.setAttribute("ast-translate",e),i.style.transform=`translate3d( 0, -${e}px, 0 )`,i.style.transition=".3s")}}function verticalSliderNavigationArrows(e,t){e&&(e.onclick=function(){MoveSlide("prev",e,t)}),t&&(t.onclick=function(){MoveSlide("next",e,t)})}function focusSlideOnClick(){let r=document.querySelectorAll("#ast-vertical-slider-inner .ast-woocommerce-product-gallery__image");r.forEach(e=>{e.addEventListener("click",function(e){var t=e.currentTarget.getAttribute("data-slide-number");r.forEach(e=>{e.classList.remove("flex-active-slide")}),e.currentTarget.classList.add("flex-active-slide"),jQuery(".woocommerce-product-gallery").data("flexslider").flexAnimate(parseInt(t))})})}function enableDisableNavigationArrows(e,t,r=0,a=0){var i,l,s=document.querySelectorAll("#ast-vertical-slider-inner .ast-woocommerce-product-gallery__image");s&&(i=(s=s.length)-4,l="flex-disabled",(parseInt(r)<1||parseInt(r)<parseInt(a*i))&&(t.classList.remove(l),e.classList.remove(l)),parseInt(r)===parseInt(a*i)&&(t.classList.add(l),e.classList.remove(l)),0===parseInt(r)&&(t.classList.remove(l),e.classList.add(l)),parseInt(s)<=4)&&(t.classList.add(l),e.classList.add(l))}function saleBadgeAlignment(){var e,t,r,a;document.querySelector("#ast-vertical-slider-inner > div")&&(e=document.querySelector("#ast-gallery-thumbnails").clientWidth)&&(t=document.querySelector(".woocommerce div.product.ast-product-gallery-layout-vertical-slider > span.onsale, .woocommerce div.product.ast-product-gallery-layout-vertical-slider > span.ast-onsale-card"))&&(r=t.classList.contains("ast-onsale-card")?25:15,a=document.body.classList.contains("rtl")?"right":"left",t.style[a]=e+r+"px")}function scrollToSlideVariableProduct(i,l){let s=document.querySelector(".woocommerce-product-gallery .woocommerce-product-gallery__image"),t=document.querySelectorAll(".woocommerce-product-gallery .ast-woocommerce-product-gallery__image img");s&&t&&(observer=new MutationObserver(e=>{e.forEach(e=>{e.attributeName&&e.attributeName.includes("data-thumb")&&t.forEach(e=>{var t,r,a;e.getAttribute("srcset")&&e.getAttribute("srcset").includes(s.getAttribute("data-thumb"))&&(e.click(),t=document.querySelector("#ast-vertical-slider-inner"))&&(r=t.querySelector("img").clientHeight+10,e=e.closest(".ast-woocommerce-product-gallery__image").getAttribute("data-slide-number"),r)&&e&&(a=4*r,4<(e=parseInt(e)+1)?(t.style.transform=`translate3d( 0, -${e=r*e-a}px, 0 )`,t.setAttribute("ast-translate",e)):(t.setAttribute("ast-translate",0),t.style.transform="translate3d( 0, 0px, 0 )"),enableDisableNavigationArrows(i,l,t.getAttribute("ast-translate"),r),t.style.transition=".3s")})})})).observe(s,{attributes:!0})}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelector("#ast-vertical-slider-inner"),e=(e&&e.setAttribute("ast-translate",0),document.querySelector("#ast-gallery-thumbnails")),t=document.querySelector(".ast-product-gallery-layout-vertical-slider");if(!e||t.classList.contains("ast-product-gallery-with-no-image"))return!1;let r={width:e.clientWidth,numVisible:4},a=r.carousel=document.querySelector("#ast-vertical-slider-inner");if(!a)return!1;var t=document.querySelector("#ast-vertical-navigation-prev"),e=document.querySelector("#ast-vertical-navigation-next"),i=(dynamicImageResize(r,a),verticalSliderNavigationArrows(t,e),focusSlideOnClick(),document.querySelector(".ast-article-single"));i&&i.classList.contains("ast-product-single-variable")&&scrollToSlideVariableProduct(t,e),enableDisableNavigationArrows(t,e),saleBadgeAlignment();let l;window.onresize=function(){clearTimeout(l),l=setTimeout(function(){dynamicImageResize(r,a),saleBadgeAlignment()},400)}});