`; }function renderVirusTotalDetails(data) { // Just return the provided HTML snippet as is return ` Reputation Details
DNS Records
TargetIPCountry
ns4.google.com216.239.38.10United States
ns3.google.com216.239.36.10United States
Domain Blacklist
EngineDetected
OpenPhishNo
Spam404No
Redirection

Redirection Found: Yes

URL: https://www.google.com/

Response Headers

Code: 200

Status: HTTP/2 200

`; }function showVerboseDetails(details, renderType) { const overlay = document.createElement('div'); overlay.style.cssText = ` position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 2000; display: flex; justify-content: center; align-items: center; `;const detailsBox = document.createElement('div'); detailsBox.style.cssText = ` background-color: #2c2c2c; border-radius: 8px; padding: 20px; color: #f5f5f5; font-family: 'Inter', sans-serif; max-width: 80%; max-height: 80%; overflow-y: auto; box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5); `;let content = ''; if (renderType === 'urlvoid') { content = renderURLVoidDetails(details); } else if (renderType === 'ipqs') { content = renderIPQSDetails(details); } else if (renderType === 'virustotal') { content = renderVirusTotalDetails(details); }detailsBox.innerHTML = ` ${content} `;overlay.appendChild(detailsBox); document.body.appendChild(overlay);detailsBox.querySelector('button').addEventListener('click', function () { document.body.removeChild(overlay); }); }function displayThreatScores(threatScores) { // Handle URLVoid const urlVoidDetails = parseApiResponse(threatScores.apivoid);// Handle IPQS const ipqsDetails = parseApiResponse(threatScores.ipqs);// Handle VirusTotal const virusTotalDetails = parseApiResponse(threatScores.virus_total); container.innerHTML = `
URLVoid Icon

URLVoid

Threat Score: ${threatScores.apivoid?.data?.report?.risk_score?.result || "N/A"}/100

IPQS Icon

IPQS

Threat Score: ${threatScores.ipqs?.risk_score || "N/A"}/100

VirusTotal Icon

VirusTotal

Threat Score: ${ Math.round( (threatScores.virus_total?.data?.attributes?.stats?.malicious + threatScores.virus_total?.data?.attributes?.stats?.suspicious) / (threatScores.virus_total?.data?.attributes?.stats?.total || 1) * 100 ) || "N/A" }/100

`;const detailButtons = container.querySelectorAll('.view-details-button'); detailButtons.forEach(button => { button.addEventListener('click', function () { try { const details = JSON.parse(decodeURIComponent(this.getAttribute('data-details'))); const renderType = this.getAttribute('data-render'); showVerboseDetails(details, renderType); } catch (e) { console.error("Error parsing JSON: ", e.message); } }); }); }function triggerScan() { if (isScanning) return; isScanning = true;const loadingWheel = showLoadingWheel();const inputValue = inputField.value.trim(); if (!inputValue) { alert("Input cannot be empty. Please provide a valid URL, IP address, or email."); isScanning = false; hideLoadingWheel(loadingWheel); return; }fetchThreatScores(inputValue, function (threatScores) { hideLoadingWheel(loadingWheel); displayThreatScores(threatScores); isScanning = false; }); }submitButton.addEventListener('click', triggerScan);inputField.addEventListener('keydown', function (event) { if (event.key === 'Enter') { triggerScan(); } }); });