CoolFace
Apppublic

Webnet/cmf-radar-scanner

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes
script.js45 linesDownload Raw Back to root
1document.addEventListener('DOMContentLoaded', function() {2    // Initialize tooltips3    const tooltipTriggers = document.querySelectorAll('[data-tooltip]');4    5    tooltipTriggers.forEach(trigger => {6        const tooltip = document.createElement('div');7        tooltip.className = 'hidden absolute z-50 bg-gray-800 text-white text-xs rounded py-1 px-2';8        tooltip.textContent = trigger.getAttribute('data-tooltip');9        trigger.appendChild(tooltip);10        11        trigger.addEventListener('mouseenter', () => {12            tooltip.classList.remove('hidden');13        });14        15        trigger.addEventListener('mouseleave', () => {16            tooltip.classList.add('hidden');17        });18    });19 20    // Scanner button functionality21    const scannerBtn = document.querySelector('.scanner-btn');22    if (scannerBtn) {23        scannerBtn.addEventListener('click', function() {24            this.classList.toggle('scanner-active');25            const icon = this.querySelector('i');26            if (this.classList.contains('scanner-active')) {27                icon.setAttribute('data-feather', 'stop-circle');28                feather.replace();29                // Start scanning logic would go here30            } else {31                icon.setAttribute('data-feather', 'play');32                feather.replace();33                // Stop scanning logic would go here34            }35        });36    }37 38    // Responsive adjustments39    function handleResize() {40        // Add any responsive adjustments here41    }42 43    window.addEventListener('resize', handleResize);44    handleResize();45});