All files main.js

90.9% Statements 20/22
50% Branches 1/2
66.66% Functions 2/3
95.23% Lines 20/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52                          1x 1x 1x 1x 1x           1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x         1x     1x     1x          
/* MAIN.JS - Application Entry Point ====================================================
   Copyright 2025, Mark Forscher */
/* ======================================================================================= */
 
import { Core } from './core.js';
import { Animations } from './animations.js';
import { Pages } from './pages.js';
import { Features } from './features.js';
import { Monitoring } from './monitoring.js';
 
// Main application object
class UnderAfter {
  constructor() {
    this.core = new Core();
    this.animations = new Animations(this.core);
    this.pages = new Pages();
    this.features = new Features();
    this.monitoring = new Monitoring();
  }
 
  // Initialize application
  init() {
    // Initialize error monitoring first (to catch initialization errors)
    this.monitoring.init();
 
    this.core.detectWebPSupport();
    this.core.initPreloader();
    this.core.bindEvents();
    this.pages.initPageSpecific();
    this.animations.initFadeIn();
    this.animations.initNavigation();
    this.animations.initImageLoading();
    this.core.detectHoverCapability();
    this.features.initSlideshows();
    this.features.initAnalyticsConsent();
    this.features.initProjectsCursorFollower();
  }
}
 
// Create global instance
const app = new UnderAfter();
 
// Initialize when DOM is ready
Iif (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', () => app.init());
} else {
  app.init();
}
 
// Export for potential use in other modules
export default app;