File size: 1,963 Bytes
f446185 6811524 f446185 6811524 f446185 6811524 f446185 | 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 53 54 55 56 57 58 | // Shared JavaScript for dashboard
console.log('DashVista loaded');
// Initialize Vanta.js background effect
document.addEventListener('DOMContentLoaded', function() {
// Check if we're on the main dashboard page
if (document.querySelector('#mainChart')) {
VANTA.NET({
el: 'body',
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0xe74141,
backgroundColor: 0xf9fafb,
points: 12.00,
maxDistance: 22.00,
spacing: 18.00
});
// Update Vanta on theme change
document.getElementById('theme-toggle').addEventListener('click', function() {
setTimeout(() => {
const isDark = document.documentElement.classList.contains('dark');
VANTA.NET({
el: 'body',
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: isDark ? 0xd11f1f : 0xe74141,
backgroundColor: isDark ? 0x111827 : 0xf9fafb,
points: 12.00,
maxDistance: 22.00,
spacing: 18.00
});
}, 300);
});
}
// Make all cards hoverable
document.querySelectorAll('.hover\\:bg-gray-50').forEach(card => {
card.addEventListener('mouseenter', () => {
card.classList.add('shadow-md');
card.classList.remove('shadow');
});
card.addEventListener('mouseleave', () => {
card.classList.remove('shadow-md');
card.classList.add('shadow');
});
});
}); |