upskill-event-manager/assets/js/spectra-counter.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
3.1 KiB
JavaScript

UAGBCounter={elements:{},init(e,t={}){this.elements=this.getDefaultElements(e);e=document.querySelectorAll(".wp-block-uagb-counter"+e);if(e&&1<e.length)for(const r of e)this.elements.counterWrapper=r,this.handleCounterWrapper(t);else this.handleCounterWrapper(t)},handleCounterWrapper(e){var t;(e=this._getCounterData(this.elements.counterWrapper,e)).isFrontend||this.elements.counterWrapper.removeAttribute("played"),void 0!==this.elements.counterWrapper&&this.elements.counterWrapper&&(t=this._numberCount(e),this._inViewInit(t,e))},getDefaultElements(e){return{counterWrapper:this.getElement(e)}},getElement(e,t=null){let r=document.querySelector(e);if(r){if(t)return r.querySelector(t)}else{const a=document.querySelector('iframe[name="editor-canvas"]');if(a&&a.contentDocument&&(r=a.contentDocument.querySelector(e),t))return r=r.querySelector(t)}return r},_inViewInit(a,n){const o=this;const e=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target;var r=t.hasAttribute("played");e.isIntersecting&&!r&&(a.error||("bars"===n.layout?o._triggerBar(t,n):"circle"===n.layout&&o._triggerCircle(t,n),a.start()))})},{threshold:.75});e.observe(o.elements.counterWrapper)},_numberCount(e){var t=this,r=this.elements.counterWrapper.querySelector(".uagb-counter-block-number");if(void 0!==r&&r)return new window.countUp.CountUp(r,t._getEndNumber(e),{startVal:t._getStartNumber(e),duration:t._getAnimationDuration(e),separator:e.thousandSeparator,useEasing:!1,decimalPlaces:e.decimalPlaces})},_triggerBar(e,t){var r=this;const a=e.querySelector(".wp-block-uagb-counter__number");var n=r._getAnimationDurationForCSS(t),r=[{width:(r._getStartNumber(t)<r._getTotalNumber(t)?Math.ceil(r._getStartNumber(t)/r._getTotalNumber(t)*100):100)+"%"},{width:(r._getEndNumber(t)<=r._getTotalNumber(t)?Math.ceil(r._getEndNumber(t)/r._getTotalNumber(t)*100):100)+"%"}],t={duration:n,fill:"forwards"};e.classList.contains("wp-block-uagb-counter--bars")&&a?.animate(r,t),e.setAttribute("played",!0)},_triggerCircle(e,t){var r=this;const a=e.querySelector(".wp-block-uagb-counter-circle-container svg .uagb-counter-circle__progress");var n=t.circleSize-t.circleStokeSize,n=Math.PI*n,o=r._getTotalNumber(t);let u=r._getStartNumber(t)/o*100,i=(u=(u=100-(u=u<100?u:100))/100*n,r._getEndNumber(t)/o*100);i=(i=100-(i=i<100?i:100))/100*n;o=r._getAnimationDurationForCSS(t),n=[{strokeDashoffset:u+"px"},{strokeDashoffset:i+"px"}];a?.animate(n,{duration:o,fill:"forwards"}),e.setAttribute("played",!0)},_getAnimationDuration(e){return e.animationDuration/1e3},_getAnimationDurationForCSS(e){return e.animationDuration},_getStartNumber(e){return!isNaN(e.startNumber)&&(e.startNumber||parseFloat(e.startNumber)===parseFloat(0))?parseFloat(e.startNumber):parseFloat(0)},_getEndNumber(e){return!isNaN(e.endNumber)&&(e.endNumber||parseFloat(e.startNumber)===parseFloat(0))?parseFloat(e.endNumber):parseFloat(80)},_getTotalNumber(e){return isNaN(e.startNumber)?parseFloat(0):e.totalNumber||parseFloat(e.startNumber)===parseFloat(0)?parseFloat(e.totalNumber):parseFloat(100)},_getCounterData(e,t){e=e?.getAttribute("data-counter");return(e=e&&JSON.parse(e))?{...t,...e}:t}};