-
-
- - -
-
2,500
- Total Users +
+
+
+
+
+
+
+ +
+
+
+
Total Users
+

2,500

+
+
+
+ 4% + From last Week +
+
-
-
- - -
-
123.5min
- Average Time + +
+
+
+
+
+
+ +
+
+
+
Average Time
+

123.5min

+
+
+
+ 2% + From last Week +
+
-
-
- - -
-
1,240
- Total Orders + +
+
+
+
+
+
+ +
+
+
+
Total Orders
+

1,240

+
+
+
+ 15% + From last Week +
+
-
-
- - -
-
$24,567
- Total Revenue + +
+
+
+
+
+
+ +
+
+
+
Total Revenue
+

$24,567

+
+
+
+ 8% + From last Week +
+
-
-
- - -
-
2,315
- Conversions + +
+
+
+
+
+
+ +
+
+
+
Conversions
+

2,315

+
+
+
+ 12% + From last Week +
+
-
-
- - -
-
47,325
- Page Views + +
+
+
+
+
+
+ +
+
+
+
Page Views
+

47,325

+
+
+
+ 18% + From last Week +
+
-
@@ -1231,7 +1308,6 @@ if (startDatePicker && endDatePicker) { try { // TempusDominus is directly available in main-minimal-modern.js - console.log('๐Ÿ“… Initializing date pickers with TempusDominus...'); const TempusDominus = window.TempusDominus || globalThis.TempusDominus; const DateTime = window.DateTime || globalThis.DateTime; @@ -1272,9 +1348,7 @@ startPicker.dates.setValue(thirtyDaysAgo); endPicker.dates.setValue(today); - console.log('โœ… Date pickers initialized with default dates'); } catch (error) { - console.error('Error setting default dates for date range picker:', error); } // Link pickers @@ -1286,12 +1360,9 @@ startPicker.updateOptions({ restrictions: { minDate: e.detail.date } }); }); - console.log('โœ… Dashboard date pickers initialized'); } else { - console.warn('TempusDominus or DateTime not available after loading forms module'); } } catch (error) { - console.error('Failed to initialize date pickers:', error); } } }); @@ -1365,7 +1436,6 @@ }; new Chart(ctx, config); - console.log('โœ… Dashboard chart initialized'); } // Profile completion gauge @@ -1407,25 +1477,20 @@ }; new Chart(ctx, config); - console.log('โœ… Profile completion gauge initialized'); } // Initialize charts - Chart.js is directly available in main-minimal-modern.js document.addEventListener('DOMContentLoaded', function() { - console.log('๐Ÿ“Š Index.html DOM loaded, starting chart initialization...'); // Check if basic elements exist const chartContainer = document.getElementById('chart_plot_01'); const collapseLinks = document.querySelectorAll('.collapse-link'); - console.log('๐Ÿ“Š Chart container found:', !!chartContainer); - console.log('๐ŸŽ›๏ธ Collapse links found:', collapseLinks.length); if (chartContainer) { // Wait for Chart.js to be available (from module) function waitForChart() { if (typeof window.Chart !== 'undefined') { try { - console.log('๐Ÿ“ˆ Chart.js available:', typeof window.Chart); // Initialize main dashboard chart initializeDashboardChart(); @@ -1435,9 +1500,7 @@ initializeProfileGauge(); } - console.log('โœ… Charts initialized successfully'); } catch (error) { - console.error('โŒ Failed to initialize charts:', error); } } else { // Try again in 50ms @@ -1448,7 +1511,6 @@ // Start waiting waitForChart(); } else { - console.warn('โš ๏ธ No chart container found on this page'); } }); diff --git a/production/index2.html b/production/index2.html index bece4f0c..813d5f6f 100755 --- a/production/index2.html +++ b/production/index2.html @@ -753,9 +753,7 @@ startPicker.updateOptions({ restrictions: { maxDate: e.detail.date } }); }); - console.log('โœ… Date range pickers initialized on index2.html'); } else { - console.log('โ„น๏ธ Date picker elements not found on this page - skipping initialization'); } } }); diff --git a/production/index4.html b/production/index4.html index 92a18e20..4d781980 100755 --- a/production/index4.html +++ b/production/index4.html @@ -599,9 +599,7 @@ startPicker.updateOptions({ restrictions: { maxDate: e.detail.date } }); }); - console.log('โœ… Date range pickers initialized on index4.html'); } else { - console.log('โ„น๏ธ Date picker elements not found on this page - skipping initialization'); } } }); diff --git a/production/landing.html b/production/landing.html index 5d520ee0..5d67e71b 100644 --- a/production/landing.html +++ b/production/landing.html @@ -14,661 +14,10 @@ - - + - +
diff --git a/production/map.html b/production/map.html index 0afb013d..520d6102 100755 --- a/production/map.html +++ b/production/map.html @@ -304,7 +304,6 @@ }); } catch (error) { - console.error('Error loading map:', error); document.getElementById('leaflet-map').innerHTML = '

Map failed to load

'; } diff --git a/production/profile.html b/production/profile.html index c6726976..e9a393c4 100755 --- a/production/profile.html +++ b/production/profile.html @@ -719,7 +719,6 @@ // Time range filter functionality document.querySelectorAll('input[name="timeRange"]').forEach(radio => { radio.addEventListener('change', function() { - console.log('Time range changed to:', this.id); // Here you would update the chart data based on the selected time range }); }); diff --git a/production/projects.html b/production/projects.html index b28e505a..0bc82564 100755 --- a/production/projects.html +++ b/production/projects.html @@ -1191,7 +1191,6 @@ } // In a real application, you would send this data to your backend - console.log('New Project Data:', { name: projectName, category: category, priority: priority, diff --git a/production/tables_dynamic.html b/production/tables_dynamic.html index deeddef3..61dd7079 100755 --- a/production/tables_dynamic.html +++ b/production/tables_dynamic.html @@ -1954,91 +1954,7 @@
- - - - - + + \ No newline at end of file diff --git a/production/typography.html b/production/typography.html index 47b0736c..15014e06 100755 --- a/production/typography.html +++ b/production/typography.html @@ -610,7 +610,6 @@
Inline Code
-

Use the <code> tag for inline code snippets like console.log() or document.querySelector().

Keyboard Input

Press Ctrl + C to copy and Ctrl + V to paste.

@@ -630,7 +629,6 @@ // Usage example const message = greetUser('John Doe'); -console.log(message);
diff --git a/src/chart-initializer.js b/src/chart-initializer.js index b51f4458..59053f12 100644 --- a/src/chart-initializer.js +++ b/src/chart-initializer.js @@ -170,7 +170,6 @@ class ChartInitializer { attempts++; setTimeout(checkChart, 50); } else { - console.warn('โš ๏ธ Chart.js not loaded after 5 seconds'); resolve(false); } }; @@ -221,7 +220,6 @@ class ChartInitializer { const data = customData || SAMPLE_DATA[chartType]; if (!config || !data) { - console.warn(`Invalid chart type: ${chartType}`); return null; } @@ -238,10 +236,8 @@ class ChartInitializer { const canvasId = ctx.canvas.id || `chart_${Date.now()}`; this.charts.set(canvasId, chart); - console.log(`โœ… ${chartType} chart created:`, canvasId); return chart; } catch (error) { - console.error(`โŒ Failed to create ${chartType} chart:`, error); return null; } } @@ -322,7 +318,6 @@ class ChartInitializer { const chartReady = await this.waitForChart(); if (!chartReady) return; - console.log('๐Ÿš€ Starting comprehensive chart initialization...'); // 1. Chart.js demo pages (chartjs.html, chartjs2.html) this.initChartjsPages(); @@ -347,13 +342,11 @@ class ChartInitializer { // 8. Weather icons handled by dedicated weather.js module - console.log('โœ… Comprehensive chart initialization complete!'); } initChartjsPages() { // Handle canvas elements with data-chart attribute const chartCanvases = this.DOM.selectAll('canvas[data-chart]'); - console.log(`๐Ÿ“Š Found ${chartCanvases.length} Chart.js demo canvases`); chartCanvases.forEach(canvas => { const chartType = canvas.getAttribute('data-chart'); @@ -830,7 +823,6 @@ class ChartInitializer { element.style.display = 'inline-block'; element.appendChild(centerText); - console.log(`โœ… ${label} chart (${percent}%) initialized`); }); } @@ -880,9 +872,7 @@ class ChartInitializer { } } }); - console.log('โœ… USA revenue chart initialized'); } catch (error) { - console.error('โŒ Failed to initialize USA map:', error); } } @@ -891,6 +881,11 @@ class ChartInitializer { try { const worldMapContainer = this.DOM.select('#world-map-gdp'); + // Check if map is already initialized + if (worldMapContainer._leaflet_id) { + return; + } + // Create interactive world map const map = L.map('world-map-gdp').setView([20, 0], 2); @@ -915,9 +910,7 @@ class ChartInitializer { marker.bindPopup(`${market.name}
Revenue: ${market.revenue}`); }); - console.log('โœ… World map initialized with revenue markers'); } catch (error) { - console.error('โŒ Failed to initialize World map:', error); } } } @@ -925,11 +918,9 @@ class ChartInitializer { initDataTables() { // Wait for DataTables to be available if (typeof DataTable === 'undefined') { - console.warn('DataTables not available'); return; } - console.log('๐Ÿš€ Initializing DataTables...'); // Basic DataTable const basicTable = this.DOM.select('#datatable'); @@ -953,9 +944,7 @@ class ChartInitializer { } }); basicTable.dataTableInstance = dataTable; - console.log('โœ… Basic DataTable initialized'); } catch (error) { - console.error('โŒ Failed to initialize basic DataTable:', error); } } @@ -995,9 +984,7 @@ class ChartInitializer { } }); buttonsTable.dataTableInstance = dataTable; - console.log('โœ… DataTable with Buttons initialized'); } catch (error) { - console.error('โŒ Failed to initialize DataTable with Buttons:', error); } } @@ -1019,19 +1006,15 @@ class ChartInitializer { ] }); responsiveTable.dataTableInstance = dataTable; - console.log('โœ… Responsive DataTable initialized'); } catch (error) { - console.error('โŒ Failed to initialize Responsive DataTable:', error); } } - console.log('โœ… All DataTables initialized successfully'); } destroyAllCharts() { this.charts.forEach(chart => chart.destroy()); this.charts.clear(); - console.log('๐Ÿงน All charts destroyed'); } } diff --git a/src/js/examples.js b/src/js/examples.js index 6495ec0b..3e9182dd 100644 --- a/src/js/examples.js +++ b/src/js/examples.js @@ -1434,14 +1434,14 @@ function init_IonRangeSlider() { max_interval: 50 }); $('.range_time24').ionRangeSlider({ - min: +moment().subtract(12, 'hours').format('X'), - max: +moment().format('X'), - from: +moment().subtract(6, 'hours').format('X'), + min: +dayjs().subtract(12, 'hours').unix(), + max: +dayjs().unix(), + from: +dayjs().subtract(6, 'hours').unix(), grid: true, force_edges: true, prettify: function (num) { - var m = moment(num, 'X'); - return m.format('Do MMMM, HH:mm'); + var d = dayjs.unix(num); + return d.format('Do MMMM, HH:mm'); } }); } @@ -4906,7 +4906,6 @@ $(document).ready(function () { init_EasyPieChart(); init_charts(); init_echarts(); - // init_morris_charts(); // Removed - using Chart.js instead init_skycons(); init_select2(); init_validator(); diff --git a/src/main-core.js b/src/main-core.js index e328b4a1..f58e0b02 100644 --- a/src/main-core.js +++ b/src/main-core.js @@ -46,7 +46,7 @@ window.NProgress = NProgress; window.addEventListener('error', event => { // Only log to console in development if (process.env.NODE_ENV === 'development') { - console.error('๐Ÿšจ Global error caught:', { + console.error({ message: event.message, filename: event.filename, lineno: event.lineno, @@ -69,16 +69,16 @@ if (process.env.NODE_ENV === 'development') { const originalLog = console.log; const originalError = console.error; const originalWarn = console.warn; - - console.log = function (...args) { + + console.log = (...args) => { originalLog(`[${new Date().toLocaleTimeString()}]`, ...args); }; - console.error = function (...args) { + console.error = (...args) => { originalError(`[${new Date().toLocaleTimeString()}] โŒ`, ...args); }; - console.warn = function (...args) { + console.warn = (...args) => { originalWarn(`[${new Date().toLocaleTimeString()}] โš ๏ธ`, ...args); }; } @@ -180,7 +180,6 @@ window.loadModule = async function (moduleName, showLoading = true) { return module; } catch (error) { if (process.env.NODE_ENV === 'development') { - console.error(`Failed to load module ${moduleName}:`, error); } return null; } finally { @@ -200,19 +199,13 @@ window.preloadModules = async function (moduleNames) { // Debug utility to show module loading stats (development only) window.getModuleStats = function () { if (process.env.NODE_ENV === 'development') { - console.group('๐Ÿ“Š Module Loading Statistics'); - console.log('Cached modules:', Array.from(window.moduleCache.keys())); - console.log('Load times:'); Array.from(window.moduleLoadTimes.entries()) .sort((a, b) => b[1] - a[1]) .forEach(([module, time]) => { - console.log(` ${module}: ${time.toFixed(2)}ms`); }); const totalTime = Array.from(window.moduleLoadTimes.values()).reduce((a, b) => a + b, 0); - console.log(`Total load time: ${totalTime.toFixed(2)}ms`); - console.groupEnd(); } }; diff --git a/src/main-form-advanced.js b/src/main-form-advanced.js index d7be1fd4..19a2087d 100644 --- a/src/main-form-advanced.js +++ b/src/main-form-advanced.js @@ -38,7 +38,6 @@ try { await import('./js/sidebar-modern.js'); await import('./js/init-modern.js'); } catch (error) { - console.error('โŒ Error loading JavaScript modules:', error); } // Create a library availability checker for inline scripts @@ -55,7 +54,6 @@ window.waitForLibraries = function (libraries, callback, timeout = 5000) { } else if (Date.now() - startTime < timeout) { setTimeout(check, 50); } else { - console.warn( 'Timeout waiting for libraries:', libraries.filter( lib => typeof window[lib] === 'undefined' && typeof globalThis[lib] === 'undefined' @@ -90,6 +88,5 @@ document.addEventListener('DOMContentLoaded', async function () { // Cropper.js await import('cropper'); } catch (error) { - console.error('โŒ Error loading form components:', error); } }); diff --git a/src/main-form-basic.js b/src/main-form-basic.js index 1ce6ea83..b7335ece 100644 --- a/src/main-form-basic.js +++ b/src/main-form-basic.js @@ -135,7 +135,6 @@ document.addEventListener('DOMContentLoaded', () => { canvas.style.height = 'auto'; previewEl.appendChild(canvas); }) - .catch(err => console.error('Preview render error:', err)); }; // Rotate button @@ -147,7 +146,6 @@ document.addEventListener('DOMContentLoaded', () => { imgElement && imgElement.$rotate(90); refreshPreview(); } catch (err) { - console.error('Rotate failed:', err); } }); } @@ -161,7 +159,6 @@ document.addEventListener('DOMContentLoaded', () => { cropperInstance.getCropperSelection()?.$reset(); refreshPreview(); } catch (err) { - console.error('Reset failed:', err); } }); } @@ -182,7 +179,6 @@ document.addEventListener('DOMContentLoaded', () => { link.download = 'cropped-image.jpg'; link.click(); }) - .catch(err => console.error('Download failed:', err)); }); } @@ -191,9 +187,5 @@ document.addEventListener('DOMContentLoaded', () => { // Initial preview render after load setTimeout(refreshPreview, 600); - } else { - console.warn( - 'โš ๏ธ Cropper source image or library not found. Skipping Cropper.js v2 initialization' - ); } }); diff --git a/src/main-inbox.js b/src/main-inbox.js index 192c7005..5bff0697 100644 --- a/src/main-inbox.js +++ b/src/main-inbox.js @@ -86,10 +86,8 @@ document.addEventListener('DOMContentLoaded', function () { } }); } catch (error) { - console.error('โŒ Error initializing WYSIWYG editor:', error); } } else { - console.warn('โš ๏ธ WYSIWYG editor elements not found or jQuery not available'); } }); diff --git a/src/main-minimal-modern.js b/src/main-minimal-modern.js index c9e6c035..b2f277e3 100644 --- a/src/main-minimal-modern.js +++ b/src/main-minimal-modern.js @@ -101,7 +101,6 @@ try { window.Chart = Chart; globalThis.Chart = Chart; } catch (error) { - console.error('โŒ Chart.js registration error:', error); window.Chart = Chart; globalThis.Chart = Chart; } @@ -118,7 +117,6 @@ try { window.Skycons = Skycons; globalThis.Skycons = Skycons; } catch (error) { - console.error('Skycons loading error:', error); } // Leaflet (for maps) @@ -131,12 +129,10 @@ import './main.scss'; // Add global error handlers to prevent uncaught promise rejections window.addEventListener('unhandledrejection', event => { - console.warn('๐Ÿšจ Unhandled promise rejection:', event.reason); event.preventDefault(); }); window.addEventListener('error', event => { - console.warn('๐Ÿšจ Global error caught:', event.error); }); // CSS imports for libraries @@ -214,7 +210,6 @@ document.addEventListener('DOMContentLoaded', () => { }); advancedTableEl.dataTableInstance = dataTable; } catch (error) { - console.error('โŒ DataTable initialization failed:', error); } } }); @@ -256,7 +251,6 @@ document.addEventListener('DOMContentLoaded', () => { }); advancedTable.dataTableInstance = dataTable; } catch (error) { - console.error('โŒ Failed to initialize Advanced DataTable:', error); } } } @@ -269,7 +263,6 @@ import './chart-initializer.js'; // Widget-specific initialization (jQuery-free) DOM.ready(() => { - console.log('๐ŸŽฏ DOM ready, chart initializer will handle all charts automatically'); // The chart initializer handles all chart initialization // No need for manual chart initialization here anymore @@ -357,4 +350,3 @@ import './modules/maps.js'; // Import echarts module for echarts.html import './modules/echarts-modern.js'; -console.log('โœ… Modern jQuery-free bundle loaded successfully'); \ No newline at end of file diff --git a/src/main-minimal.js b/src/main-minimal.js index c8f304a6..08cc657a 100644 --- a/src/main-minimal.js +++ b/src/main-minimal.js @@ -59,7 +59,6 @@ try { window.Chart = Chart; globalThis.Chart = Chart; } catch (error) { - console.error('โŒ Chart.js registration error:', error); window.Chart = Chart; // Still assign even if registration fails globalThis.Chart = Chart; } @@ -78,7 +77,6 @@ try { window.Skycons = Skycons; globalThis.Skycons = Skycons; } catch (error) { - console.error('Skycons loading error:', error); } // Leaflet (for maps) @@ -91,13 +89,11 @@ import './main.scss'; // Add global error handlers to prevent uncaught promise rejections window.addEventListener('unhandledrejection', event => { - console.warn('๐Ÿšจ Unhandled promise rejection:', event.reason); // Prevent the default browser behavior (like logging to console) event.preventDefault(); }); window.addEventListener('error', event => { - console.warn('๐Ÿšจ Global error caught:', event.error); }); // Leaflet CSS @@ -181,7 +177,6 @@ document.addEventListener('DOMContentLoaded', () => { } }); } catch (error) { - console.error('โŒ DataTable initialization failed:', error); } } }); @@ -225,7 +220,6 @@ document.addEventListener('DOMContentLoaded', () => { }); advancedTable.dataTableInstance = dataTable; } catch (error) { - console.error('โŒ Failed to initialize Advanced DataTable:', error); } } } @@ -247,7 +241,6 @@ window.waitForLibraries = function (libraries, callback, timeout = 5000) { } else { // Only warn in development if (process.env.NODE_ENV === 'development') { - console.warn( 'Timeout waiting for libraries:', libraries.filter( lib => typeof window[lib] === 'undefined' && typeof globalThis[lib] === 'undefined' diff --git a/src/main-tables.js b/src/main-tables.js new file mode 100644 index 00000000..59a7d631 --- /dev/null +++ b/src/main-tables.js @@ -0,0 +1,146 @@ +// Dedicated entry point for tables_dynamic.html +// Ensures proper DataTables initialization without conflicts + +// Import security utilities +import './utils/security.js'; + +// Bootstrap 5 - No jQuery dependency +import * as bootstrap from 'bootstrap'; +window.bootstrap = bootstrap; +globalThis.bootstrap = bootstrap; + +// Global styles +import './main.scss'; + +// DataTables with all extensions - LOAD FIRST +import DataTable from 'datatables.net-bs5'; +import 'datatables.net-responsive-bs5'; +import 'datatables.net-buttons-bs5'; +import 'datatables.net-buttons/js/buttons.html5.js'; +import 'datatables.net-buttons/js/buttons.print.js'; +import 'datatables.net-fixedheader'; +import 'datatables.net-keytable'; + +// Required for export functionality +import JSZip from 'jszip'; +window.JSZip = JSZip; + +// Make DataTable globally available immediately +window.DataTable = DataTable; +globalThis.DataTable = DataTable; + +// DOM utilities for vanilla JS operations +const DOM = { + ready: (callback) => { + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', callback); + } else { + callback(); + } + }, + select: (selector) => document.querySelector(selector), + selectAll: (selector) => [...document.querySelectorAll(selector)] +}; + +window.DOM = DOM; + +// Essential JavaScript functionality - modern versions +import './js/helpers/smartresize-modern.js'; +import './js/sidebar-modern.js'; +import './js/init-modern.js'; + +// Initialize DataTables immediately when DOM is ready +DOM.ready(() => { + + // Small delay to ensure all modules are loaded + setTimeout(() => { + + if (typeof window.DataTable === 'undefined') { + return; + } + + try { + // Initialize basic DataTable + const basicTable = DOM.select('#datatable'); + if (basicTable) { + const dt1 = new DataTable(basicTable, { + responsive: true, + pageLength: 10, + lengthMenu: [[10, 25, 50, 100], [10, 25, 50, 100]], + order: [[0, 'asc']], + language: { + search: 'Search employees:', + lengthMenu: 'Show _MENU_ entries per page', + info: 'Showing _START_ to _END_ of _TOTAL_ entries', + paginate: { + first: 'First', + last: 'Last', + next: 'Next', + previous: 'Previous' + } + } + }); + } + + // Initialize DataTable with Buttons + const buttonsTable = DOM.select('#datatable-buttons'); + if (buttonsTable) { + const dt2 = new DataTable(buttonsTable, { + responsive: true, + pageLength: 10, + dom: 'Bfrtip', + buttons: [ + { + extend: 'copy', + text: ' Copy', + className: 'btn btn-secondary btn-sm' + }, + { + extend: 'csv', + text: ' CSV', + className: 'btn btn-success btn-sm' + }, + { + extend: 'excel', + text: ' Excel', + className: 'btn btn-primary btn-sm' + }, + { + extend: 'print', + text: ' Print', + className: 'btn btn-info btn-sm' + } + ], + language: { + search: 'Search records:', + lengthMenu: 'Show _MENU_ entries per page', + info: 'Showing _START_ to _END_ of _TOTAL_ entries' + } + }); + } + + // Initialize Responsive DataTable + const responsiveTable = DOM.select('#datatable-responsive'); + if (responsiveTable) { + const dt3 = new DataTable(responsiveTable, { + responsive: true, + pageLength: 10, + order: [[0, 'asc']], + language: { + search: 'Search records:', + lengthMenu: 'Show _MENU_ entries per page', + info: 'Showing _START_ to _END_ of _TOTAL_ entries' + }, + columnDefs: [ + { responsivePriority: 1, targets: 0 }, + { responsivePriority: 2, targets: -1 } + ] + }); + } + + + } catch (error) { + } + }, 300); +}); + diff --git a/src/main-upload.js b/src/main-upload.js index 95b8c321..9a584647 100644 --- a/src/main-upload.js +++ b/src/main-upload.js @@ -116,9 +116,7 @@ document.addEventListener('DOMContentLoaded', function () { window.myDropzone = myDropzone; globalThis.myDropzone = myDropzone; } catch (error) { - console.error('โŒ Error initializing Dropzone:', error); } } else { - console.warn('โš ๏ธ Dropzone element not found'); } }); diff --git a/src/main.scss b/src/main.scss index 5c96b21d..f6385192 100644 --- a/src/main.scss +++ b/src/main.scss @@ -4,6 +4,7 @@ @use "./scss/font-optimization.scss"; @use "./scss/index2.scss"; @use "./scss/index4.scss"; +@use "./scss/landing.scss"; // CSS files using @import (legacy approach for .css files) @import "@fortawesome/fontawesome-free/css/all.min.css"; diff --git a/src/modules/charts.js b/src/modules/charts.js index b590a399..5b9c1b7b 100644 --- a/src/modules/charts.js +++ b/src/modules/charts.js @@ -16,7 +16,6 @@ window.Skycons = Skycons; // Mini charts now handled by Chart.js instead of jQuery Sparkline -// Morris.js removed - using Chart.js instead export default { Chart, diff --git a/src/modules/maps.js b/src/modules/maps.js index 1c2d61cc..fe88546a 100644 --- a/src/modules/maps.js +++ b/src/modules/maps.js @@ -107,6 +107,12 @@ function initializeWorldMapGDP() { return; } + // Check if map is already initialized + if (worldMapElement._leaflet_id) { + console.log('World GDP map already initialized, skipping...'); + return; + } + try { // World map centered on a global view const worldCenter = [20, 0]; // Centered globally diff --git a/src/scss/custom.scss b/src/scss/custom.scss index bc9a693f..b1e7dffa 100644 --- a/src/scss/custom.scss +++ b/src/scss/custom.scss @@ -3912,7 +3912,6 @@ ul.project_files li a i { /* ********* /verticle tabs **************************** */ -/* Morris.js CSS removed - using Chart.js instead */ /* ********* ecommerce **************************** */ diff --git a/src/scss/landing.scss b/src/scss/landing.scss new file mode 100644 index 00000000..4e3675bf --- /dev/null +++ b/src/scss/landing.scss @@ -0,0 +1,645 @@ +// Landing page specific styles +body.landing-page { + --primary-color: #1ABB9C; + --primary-gradient: linear-gradient(135deg, #1ABB9C 0%, #26B99A 100%); + --secondary-gradient: linear-gradient(135deg, #2A3F54 0%, #34495e 100%); + --accent-color: #1ABB9C; + --text-dark: #2A3F54; + --text-muted: #6c757d; + --bg-light: #f8f9fa; + --shadow-sm: 0 2px 4px rgba(0,0,0,0.1); + --shadow-md: 0 4px 6px rgba(0,0,0,0.1); + --shadow-lg: 0 10px 15px rgba(0,0,0,0.1); + --border-radius: 12px; + + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + line-height: 1.6; + color: var(--text-dark); + background: white; + margin: 0; + padding: 0; + width: 100%; + overflow-x: hidden; + + * { + margin: 0; + padding: 0; + box-sizing: border-box; + } +} + +body.landing-page .container { + max-width: 1000px; + margin: 0 auto; + padding: 0 20px; +} + +body.landing-page .container-wide { + max-width: 1180px; + margin: 0 auto; + padding: 0 20px; +} + +/* Override Bootstrap container for custom widths */ +body.landing-page .container-custom { + max-width: 1000px !important; + margin: 0 auto; + padding-left: 20px; + padding-right: 20px; +} + +body.landing-page .container-wide-custom { + max-width: 1180px !important; + margin: 0 auto; + padding-left: 20px; + padding-right: 20px; +} + +body.landing-page .container-features { + max-width: 1200px !important; + margin: 0 auto; + padding-left: 20px; + padding-right: 20px; +} + +/* Hero Section */ +body.landing-page .hero { + background: var(--primary-gradient); + color: white; + padding: 120px 0 140px; + position: relative; + overflow: hidden; + min-height: 100vh; + display: flex; + align-items: center; +} + +body.landing-page .hero::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: url('data:image/svg+xml,') repeat; + background-size: 100px 100px; + animation: float 30s infinite linear; + opacity: 0.3; +} + +@keyframes float { + 0% { transform: translateY(0px) translateX(0px); } + 100% { transform: translateY(-100px) translateX(-100px); } +} + +body.landing-page .hero-content { + position: relative; + z-index: 2; + text-align: center; + max-width: 800px; + margin: 0 auto; +} + +body.landing-page .hero h1 { + font-size: 4rem; + font-weight: 700; + margin-bottom: 1.5rem; + text-shadow: 2px 2px 4px rgba(0,0,0,0.3); + letter-spacing: -1px; +} + +body.landing-page .hero .subtitle { + font-size: 1.5rem; + margin-bottom: 1rem; + opacity: 0.95; + font-weight: 400; +} + +body.landing-page .hero .credit { + font-size: 1.1rem; + margin-bottom: 2rem; + opacity: 0.8; + font-weight: 300; +} + +body.landing-page .hero .description { + font-size: 1.1rem; + margin-bottom: 3rem; + opacity: 0.9; + font-weight: 300; + line-height: 1.7; + max-width: 600px; + margin-left: auto; + margin-right: auto; +} + +body.landing-page .cta-buttons { + display: flex; + gap: 20px; + justify-content: center; + flex-wrap: wrap; +} + +body.landing-page .btn-primary-custom { + background: var(--secondary-gradient); + border: none; + padding: 16px 32px; + font-size: 1.1rem; + border-radius: 50px; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; + color: white; + font-weight: 600; + box-shadow: var(--shadow-lg); + min-width: 180px; + justify-content: center; +} + +body.landing-page .btn-primary-custom:hover { + transform: translateY(-3px); + box-shadow: 0 15px 25px rgba(0,0,0,0.2); + color: white; + text-decoration: none; +} + +body.landing-page .btn-outline-custom { + background: rgba(255,255,255,0.1); + border: 2px solid rgba(255,255,255,0.3); + padding: 14px 30px; + font-size: 1.1rem; + border-radius: 50px; + transition: all 0.3s ease; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; + color: white; + font-weight: 600; + backdrop-filter: blur(10px); + min-width: 180px; + justify-content: center; +} + +body.landing-page .btn-outline-custom:hover { + background: white; + color: var(--primary-color); + text-decoration: none; + transform: translateY(-3px); +} + +/* Features Section */ +body.landing-page .features { + padding: 120px 0; + background: white; +} + +body.landing-page .section-title { + text-align: center; + margin-bottom: 4rem; +} + +body.landing-page .section-title h2 { + font-size: 2.8rem; + color: var(--text-dark); + margin-bottom: 1.5rem; + font-weight: 700; +} + +body.landing-page .section-title p { + font-size: 1.2rem; + color: var(--text-muted); + max-width: 600px; + margin: 0 auto; + line-height: 1.6; +} + +body.landing-page .features-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 2.5rem; + margin-top: 2rem; +} + +body.landing-page .feature-card { + background: white; + padding: 2.5rem 2rem; + border-radius: var(--border-radius); + box-shadow: var(--shadow-md); + text-align: center; + transition: all 0.3s ease; + border: 1px solid #f1f3f4; +} + +body.landing-page .feature-card:hover { + transform: translateY(-8px); + box-shadow: 0 20px 40px rgba(0,0,0,0.1); + border-color: var(--primary-color); +} + +body.landing-page .feature-icon { + width: 90px; + height: 90px; + background: var(--primary-gradient); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + margin: 0 auto 1.5rem; + font-size: 2.2rem; + color: white; + box-shadow: var(--shadow-md); +} + +body.landing-page .feature-card h4 { + color: var(--text-dark); + margin-bottom: 1rem; + font-size: 1.4rem; + font-weight: 600; +} + +body.landing-page .feature-card p { + color: var(--text-muted); + line-height: 1.7; + font-size: 1rem; +} + +/* Dashboard Preview Section */ +body.landing-page .dashboard-preview-section { + padding: 120px 0; + background: var(--bg-light); +} + +body.landing-page .dashboard-preview { + background: white; + border-radius: 20px; + padding: 3rem 2rem; + box-shadow: 0 25px 50px rgba(0,0,0,0.1); + margin: 3rem auto; + max-width: 1000px; + position: relative; + overflow: hidden; +} + +body.landing-page .dashboard-preview::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 50px; + background: var(--primary-gradient); + border-radius: 20px 20px 0 0; +} + +body.landing-page .dashboard-preview::after { + content: ''; + position: absolute; + top: 18px; + left: 25px; + width: 14px; + height: 14px; + background: #ff5f56; + border-radius: 50%; + box-shadow: 25px 0 0 #ffbd2e, 50px 0 0 #27ca3f; +} + +body.landing-page .dashboard-content { + margin-top: 50px; + background: #f8f9fb; + border-radius: 15px; + padding: 2.5rem; + min-height: 400px; +} + +body.landing-page .dashboard-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 2.5rem; + padding-bottom: 1.5rem; + border-bottom: 2px solid #e9ecef; +} + +body.landing-page .dashboard-title { + color: var(--text-dark); + font-size: 1.6rem; + font-weight: 700; + margin: 0; +} + +body.landing-page .dashboard-subtitle { + color: var(--text-muted); + font-size: 0.95rem; + margin-top: 4px; +} + +body.landing-page .dashboard-user { + display: flex; + align-items: center; + gap: 12px; + color: var(--text-muted); + font-size: 0.9rem; +} + +body.landing-page .user-avatar { + width: 35px; + height: 35px; + background: var(--primary-gradient); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-weight: 600; +} + +body.landing-page .stats-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1.5rem; + margin-bottom: 2.5rem; +} + +body.landing-page .stat-card { + background: white; + padding: 1.8rem 1.5rem; + border-radius: var(--border-radius); + box-shadow: var(--shadow-sm); + text-align: center; + border: 1px solid #f1f3f4; + transition: all 0.2s ease; +} + +body.landing-page .stat-card:hover { + transform: translateY(-2px); + box-shadow: var(--shadow-md); +} + +body.landing-page .stat-number { + font-size: 2.2rem; + font-weight: 700; + color: var(--primary-color); + margin-bottom: 0.5rem; + display: block; +} + +body.landing-page .stat-label { + color: var(--text-muted); + font-size: 0.9rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +body.landing-page .chart-area { + background: white; + border-radius: var(--border-radius); + padding: 2rem; + box-shadow: var(--shadow-sm); + display: flex; + align-items: center; + justify-content: center; + min-height: 250px; + border: 2px dashed #e9ecef; + position: relative; +} + +body.landing-page .chart-placeholder { + text-align: center; + color: var(--text-muted); +} + +body.landing-page .chart-placeholder i { + font-size: 4rem; + color: var(--primary-color); + margin-bottom: 1rem; + opacity: 0.7; +} + +body.landing-page .chart-placeholder p { + font-size: 1.1rem; + font-weight: 500; +} + +body.landing-page .chart-placeholder small { + font-size: 0.9rem; + opacity: 0.8; +} + +/* Stats Section */ +body.landing-page .stats-section { + padding: 100px 0; + background: var(--primary-gradient); + color: white; +} + +body.landing-page .stats-grid-main { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 3rem 4rem; + text-align: center; + max-width: none; + margin: 0 auto; +} + +body.landing-page .stat-item-main { + padding: 1rem; +} + +body.landing-page .stat-item-main h3 { + font-size: 3.5rem; + font-weight: 700; + margin-bottom: 0.8rem; + text-shadow: 2px 2px 4px rgba(0,0,0,0.2); +} + +body.landing-page .stat-item-main p { + font-size: 1.2rem; + opacity: 0.9; + font-weight: 400; +} + +/* CTA Section */ +body.landing-page .cta-section { + padding: 120px 0; + background: var(--text-dark); + color: white; + text-align: center; +} + +body.landing-page .cta-section h2 { + font-size: 2.5rem; + margin-bottom: 1.5rem; + font-weight: 700; +} + +body.landing-page .cta-section p { + font-size: 1.2rem; + margin-bottom: 3rem; + opacity: 0.9; + max-width: 600px; + margin-left: auto; + margin-right: auto; + line-height: 1.6; +} + +/* Footer */ +body.landing-page .footer { + background: #1a252f; + color: white; + padding: 3rem 0; + text-align: center; + width: 100%; + margin: 0; + position: relative; +} + +body.landing-page .footer p { + margin: 0; + opacity: 0.8; + font-size: 1rem; +} + +body.landing-page .footer a { + color: var(--primary-color); + text-decoration: none; + font-weight: 600; +} + +body.landing-page .footer a:hover { + color: #26B99A; + text-decoration: underline; +} + +/* Responsive Design */ +@media (max-width: 1024px) { + .features-grid { + grid-template-columns: repeat(2, 1fr); + gap: 2rem; + } + + .stats-grid-main { + grid-template-columns: repeat(2, 1fr); + gap: 2rem 3rem; + } +} + +@media (max-width: 768px) { + .hero { + padding: 80px 0 100px; + min-height: auto; + } + + .hero h1 { + font-size: 2.8rem; + } + + .hero .subtitle { + font-size: 1.2rem; + } + + .hero .description { + font-size: 1rem; + margin-bottom: 2rem; + } + + .cta-buttons { + flex-direction: column; + align-items: center; + } + + .btn-primary-custom, + .btn-outline-custom { + width: 100%; + max-width: 280px; + } + + .features { + padding: 80px 0; + } + + .features-grid { + grid-template-columns: 1fr; + gap: 2rem; + } + + .section-title h2 { + font-size: 2.2rem; + } + + .dashboard-preview { + margin: 2rem 1rem; + padding: 2rem 1rem; + } + + .dashboard-content { + padding: 1.5rem; + } + + .dashboard-header { + flex-direction: column; + gap: 1rem; + text-align: center; + } + + .stats-grid { + grid-template-columns: 1fr; + } + + .stats-grid-main { + grid-template-columns: repeat(2, 1fr); + gap: 2rem; + } + + .stat-item-main h3 { + font-size: 2.5rem; + } +} + +@media (max-width: 480px) { + .container { + padding: 0 15px; + } + + .container-wide { + padding: 0 15px; + } + + .container-custom { + padding-left: 15px !important; + padding-right: 15px !important; + } + + .container-wide-custom { + padding-left: 15px !important; + padding-right: 15px !important; + } + + .container-features { + padding-left: 15px !important; + padding-right: 15px !important; + } + + .hero h1 { + font-size: 2.2rem; + } + + .features-grid { + grid-template-columns: 1fr; + } + + .feature-card { + padding: 2rem 1.5rem; + } + + .stats-grid-main { + grid-template-columns: 1fr; + } + + .stats-grid { + grid-template-columns: 1fr; + } +} diff --git a/vite.config.js b/vite.config.js index 97cee088..0af07dda 100644 --- a/vite.config.js +++ b/vite.config.js @@ -27,10 +27,28 @@ export default defineConfig({ ], output: { manualChunks: { + // Core UI framework - used on all pages 'vendor-core': ['bootstrap', '@popperjs/core'], - 'vendor-charts': ['chart.js', 'echarts', 'leaflet'], + + // Chart libraries - only loaded on chart pages + 'vendor-charts': ['chart.js', 'echarts'], + + // Maps - separate since it's large and only used on map pages + 'vendor-maps': ['leaflet'], + + // Form libraries - loaded on form pages 'vendor-forms': ['choices.js', 'nouislider', 'autosize', 'switchery', '@eonasdan/tempus-dominus'], - 'vendor-ui': ['nprogress', 'datatables.net', 'datatables.net-bs5'], + + // DataTables core - frequently used + 'vendor-tables': ['datatables.net', 'datatables.net-bs5'], + + // DataTables extensions - only loaded when needed + 'vendor-tables-ext': ['jszip'], + + // UI utilities and progress + 'vendor-ui': ['nprogress'], + + // Date/time and small utilities 'vendor-utils': ['dayjs', 'skycons'] }, assetFileNames: (assetInfo) => { @@ -96,7 +114,8 @@ export default defineConfig({ pricing_tables: 'production/pricing_tables.html', level2: 'production/level2.html', - map: 'production/map.html' + map: 'production/map.html', + landing: 'production/landing.html' } }, minify: 'terser', @@ -104,7 +123,8 @@ export default defineConfig({ compress: { drop_console: true, drop_debugger: true, - pure_funcs: ['console.log', 'console.info', 'console.warn', 'console.error', 'console.debug', 'console.group', 'console.groupEnd', 'console.trace'] + unsafe_comps: true, + passes: 2 }, mangle: { safari10: true