Files
aitbc/website/assets/js/web-vitals.js
oib 15427c96c0 chore: update file permissions to executable across repository
- Change file mode from 644 to 755 for all project files
- Add chain_id parameter to get_balance RPC endpoint with default "ait-devnet"
- Rename Miner.extra_meta_data to extra_metadata for consistency
2026-03-06 22:17:54 +01:00

29 lines
1.0 KiB
JavaScript
Executable File

// Web Vitals monitoring for AITBC
// Tracks Core Web Vitals: LCP, FID, CLS, TTFB, FCP
(function() {
'use strict';
function sendToAnalytics(metric) {
const safeValue = Number.isFinite(metric.value) ? Math.round(metric.value) : 0;
// In production we log to console. The /api/web-vitals endpoint was removed
// to reduce unnecessary network noise as we are not running a telemetry backend.
console.log(`[Web Vitals] ${metric.name}: ${safeValue}`);
}
// Load web-vitals from CDN
const script = document.createElement('script');
script.src = 'https://unpkg.com/web-vitals@3/dist/web-vitals.iife.js';
script.onload = function() {
if (window.webVitals) {
window.webVitals.onCLS(sendToAnalytics);
window.webVitals.onFID(sendToAnalytics);
window.webVitals.onLCP(sendToAnalytics);
window.webVitals.onFCP(sendToAnalytics);
window.webVitals.onTTFB(sendToAnalytics);
}
};
document.head.appendChild(script);
})();