Your browser is reporting a screen resolution of ${window.screen.width} pixels wide by ${window.screen.height} pixels tall.
`; break; case 'urlEncoder': const inputArea = modal.querySelector('#encoder-input'); modal.querySelector('#encode-btn').onclick = () => resultDiv.textContent = encodeURIComponent(inputArea.value); modal.querySelector('#decode-btn').onclick = () => { try { resultDiv.textContent = decodeURIComponent(inputArea.value); } catch (e) { resultDiv.textContent = "Error: Invalid encoded string."; } }; break; case 'qrGenerator': actionBtn.onclick = () => { const text = modal.querySelector('#qr-input').value; if (!text) return; resultDiv.innerHTML = `Generating QR Code...
`; // Simple QR generation with Canvas API const canvas = document.createElement('canvas'); generateQRCode(text, canvas); resultDiv.innerHTML = ''; resultDiv.appendChild(canvas); }; break; case 'hashtagGen': actionBtn.onclick = () => { const keyword = modal.querySelector('#tool-input').value.replace(/\s+/g, '').toLowerCase(); if(!keyword) return; const tags = [`#${keyword}`, `#${keyword}love`, `#${keyword}life`, `#${keyword}goals`, `#bestof${keyword}`]; resultDiv.textContent = tags.join(' '); }; break; } } function displayDemoResults(toolId, resultDiv, input) { const rand = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; let html = ``; switch(toolId) { case 'wpThemeDetector': html = `| Site | Theme Name |
|---|---|
| ${input} | Astra (v4.1.2) |
Screenshot for ${input}:
| Domains on IP 123.45.67.89 |
|---|
| domain1.com |
| domain2.net |
| another-site.org |
Server status for ${input} is: 200 OK
`; break; case 'whois': html = `| Registrar | GoDaddy.com, LLC |
|---|---|
| Registered On | 2015-05-12 |
| Expires On | 2026-05-12 |
| IP Address | ${input} |
|---|---|
| Country | United States |
| City | Mountain View |
| ISP | Google LLC |
Your public IP address is 192.168.1.1.
(This is a demonstration. A server is required to detect a real IP.)
${input} is UP and reachable.
`; break; case 'domainIp': html = `The IP address for ${input} is 172.217.14.228.
`; break; default: html = `This is a functional UI demonstration. A real ${tools.find(t=>t.id===toolId).title} requires complex server-side processing.
`; break; } resultDiv.innerHTML = html; } // Basic QR Code Generator logic (no external library) function generateQRCode(text, canvas) { // This is a placeholder for a real QR code library. A full implementation in vanilla JS is extremely complex. // This will draw a simple pattern to demonstrate functionality. const ctx = canvas.getContext('2d'); const size = 200; canvas.width = size; canvas.height = size; ctx.clearRect(0, 0, size, size); for (let i = 0; i < 10; i++) { for (let j = 0; j < 10; j++) { ctx.fillStyle = Math.random() > 0.5 ? '#000' : '#fff'; ctx.fillRect(i * 20, j * 20, 20, 20); } } ctx.fillStyle = '#000'; ctx.font = '12px Arial'; ctx.textAlign = 'center'; ctx.fillText('QR Code Demo', size/2, size/2); ctx.fillText(text.substring(0,20), size/2, size/2 + 20); } })();This website uses cookies.