One Hat Cyber Team
Your IP :
216.73.216.55
Server IP :
5.189.175.239
Server :
Linux panel.gemx-ai.com 5.14.0-570.19.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 4 04:00:24 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
farmersapp
/
store.farmersapp.store
/
public
/
js
/
View File Name :
global-theme.js
// Store the theme color globally window.themeColor = ''; // Function to apply theme color to all elements function applyGlobalThemeColor() { const color = window.themeColor; if (!color) return; // Apply to CSS variables document.documentElement.style.setProperty('--color-primary', color); // Apply to all bg-primary elements document.querySelectorAll('.bg-primary').forEach(el => { el.style.setProperty('background-color', color, 'important'); }); // Apply to all text-primary elements document.querySelectorAll('.text-primary').forEach(el => { el.style.setProperty('color', color, 'important'); }); // Apply to all border-primary elements document.querySelectorAll('.border-primary').forEach(el => { el.style.setProperty('border-color', color, 'important'); }); // Apply to all switches document.querySelectorAll('[role="switch"]').forEach(el => { if (el.getAttribute('data-state') === 'checked') { el.style.setProperty('background-color', color, 'important'); } else { el.style.removeProperty('background-color'); } }); // Apply to all checkboxes document.querySelectorAll('[role="checkbox"]').forEach(el => { if (el.getAttribute('data-state') === 'checked') { el.style.setProperty('background-color', color, 'important'); } else { el.style.removeProperty('background-color'); } }); } // Initialize on page load document.addEventListener('DOMContentLoaded', function() { // Get initial color from CSS variable window.themeColor = getComputedStyle(document.documentElement).getPropertyValue('--color-primary').trim() || '#16a34a'; // Apply color initially applyGlobalThemeColor(); // Handle AJAX completions $(document).ajaxComplete(function() { setTimeout(applyGlobalThemeColor, 50); }); // Handle DataTables draw events $(document).on('draw.dt', function() { setTimeout(applyGlobalThemeColor, 50); }); // Handle external-toggle events (used in roles/index.blade.php) $(document).on('external-toggle', function() { setTimeout(applyGlobalThemeColor, 10); }); // Handle input events $(document).on('input', function() { setTimeout(applyGlobalThemeColor, 10); }); // Set up a periodic check for new elements setInterval(applyGlobalThemeColor, 1000); });