Siteβ―Builder
Editing:
compare-kidyyyyys.php
writable 0666
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Phone SAR Comparison</title> <style> body { font-family: Arial, sans-serif; } .header { background-color: white; padding: 10px 20px; border-bottom: 1px solid #ccc; display: flex; justify-content: space-between; align-items: center; } .header img { height: 50px; } .nav { display: flex; gap: 20px; } .nav a { text-decoration: none; color: #0056b3; font-weight: bold; } .news-flash { background-color: red; color: white; text-align: center; padding: 10px 0; } .compare-sar-container { padding: 20px; } .sar-table { width: 100%; border-collapse: collapse; } .sar-table td { vertical-align: top; text-align: center; } .sar-block { position: relative; width: 100%; } .sar-image-container { position: relative; width: 100%; padding-bottom: 100%; /* Aspect ratio */ overflow: hidden; } .sar-image-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .background-fill { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(255, 0, 0, 0.5); /* Semi-transparent red */ } .thermometer { position: relative; width: 50px; height: 200px; margin: 20px auto; border: 2px solid #ccc; border-radius: 25px; background: linear-gradient(to top, red, yellow); } .thermometer .fill { position: absolute; bottom: 0; width: 100%; height: 0; background: red; border-radius: 25px; } .thermometer .percent { position: absolute; bottom: 0; width: 100%; text-align: center; font-weight: bold; color: white; } @media (max-width: 768px) { .sar-table, .sar-table tr, .sar-table td { display: block; width: 100%; } } </style> </head> <body> <div class="compare-sar-container"> <div class="blurb"> <p><strong>W/WO WiFi SAR Comparison Tool!</strong></p> <p>This tool allows you to see how turning off Wi-Fi and Bluetooth on your phone can significantly reduce your exposure to radiation. Select your phoneβs brand and model from the dropdown menus to compare the Specific Absorption Rate (SAR) levels when your phone is used in cellular-only mode versus simultaneous use with Wi-Fi and Bluetooth. Discover how you can lower RF radiation exposure by optimizing your phoneβs settings. Try it now to make your phone usage safer!</p> </div> <div class="compare-sar-dropdown-container"> <div class="dropdown-wrapper"> <label for="sar2-brand-select">Select Brand</label> <select id="sar2-brand-select"> <option value="">Select Brand</option> </select> </div> <div class="dropdown-wrapper"> <label for="sar2-model-select">Select Model</label> <select id="sar2-model-select"> <option value="">Select Model</option> </select> </div> </div> <div id="sar-comparison-container"></div> <div class="copy-link-container" id="copy-link-container" style="display:none;"> <p><a href="#" id="copy-link-url">This phone comparison is saved here:</a></p> <input type="text" id="copy-link" readonly> <button id="copy-button">Click to Copy Link</button> </div> </div> <script> function toggleMenu() { const navOverlay = document.getElementById('nav-overlay'); navOverlay.style.display = navOverlay.style.display === 'flex' ? 'none' : 'flex'; } document.addEventListener("DOMContentLoaded", function() { const urlParams = new URLSearchParams(window.location.search); const pid = urlParams.get('pid'); fetch('/cache/sar2_cache.json') .then(response => response.json()) .then(phoneData => { initializePage(phoneData); if (pid) { const phone = phoneData.find(p => p.post_id == pid); if (phone) { autoSelectPhone(phone, phoneData); displayPhoneComparison(phone); updateCopyLink(phone.post_id); } else { document.getElementById('sar-comparison-container').innerHTML += '<p>Invalid phone ID.</p>'; } } else { const currentPath = window.location.pathname.split('/'); const slug = currentPath[currentPath.length - 2]; const matchedPhone = phoneData.find(p => (p.brand + ' ' + p.model).toLowerCase().replace(/ /g, '-') === slug); if (matchedPhone) { autoSelectPhone(matchedPhone, phoneData); displayPhoneComparison(matchedPhone); } else { document.getElementById('sar-comparison-container').innerHTML += '<p>No matching phone model found in the directory name.</p>'; } } function initializePage(phoneData) { const brands = {}; phoneData.forEach(phone => { if (!brands[phone.brand]) { brands[phone.brand] = []; } brands[phone.brand].push(phone); }); const brandSelect = document.getElementById('sar2-brand-select'); const modelSelect = document.getElementById('sar2-model-select'); for (const brand in brands) { const option = document.createElement('option'); option.value = brand; option.text = capitalize(brand); brandSelect.appendChild(option); } brandSelect.addEventListener('change', (event) => { const selectedBrand = event.target.value; modelSelect.innerHTML = '<option value="">Select Model</option>'; if (selectedBrand) { const models = brands[selectedBrand]; models.forEach(phone => { const option = document.createElement('option'); option.value = phone.post_id; option.text = phone.model; modelSelect.appendChild(option); }); } }); modelSelect.addEventListener('change', (event) => { const selectedModel = event.target.value; if (selectedModel) { const phone = phoneData.find(p => p.post_id == selectedModel); displayPhoneComparison(phone); updateCopyLink(selectedModel); } }); document.getElementById('copy-button').addEventListener('click', () => { const copyLinkInput = document.getElementById('copy-link'); copyLinkInput.select(); document.execCommand('copy'); }); } function updateCopyLink(selectedModel) { const currentUrl = window.location.href.split('?')[0]; const fullUrl = `${currentUrl}?pid=${selectedModel}`; const copyLinkInput = document.getElementById('copy-link'); copyLinkInput.value = fullUrl; document.getElementById('copy-link-url').href = fullUrl; document.getElementById('copy-link-url').textContent = "This phone comparison is saved here"; } function autoSelectPhone(phone, phoneData) { const brandSelect = document.getElementById('sar2-brand-select'); const modelSelect = document.getElementById('sar2-model-select'); brandSelect.value = phone.brand; modelSelect.innerHTML = '<option value="">Select Model</option>'; const models = phoneData.filter(p => p.brand === phone.brand); models.forEach(p => { const option = document.createElement('option'); option.value = p.post_id; option.text = p.model; modelSelect.appendChild(option); }); modelSelect.value = phone.post_id; displayPhoneComparison(phone); updateCopyLink(phone.post_id); document.getElementById('copy-link-container').style.display = 'block'; } function displayPhoneComparison(phone) { const { brand, model, ushead, usbody, simulheadus, simulbodyus } = phone; const headPercentCellular = ((ushead / 1.6) * 100).toFixed(2); const headPercentWiFi = ((simulheadus / 1.6) * 100).toFixed(2); const bodyPercentCellular = ((usbody / 1.6) * 100).toFixed(2); const bodyPercentWiFi = ((simulbodyus / 1.6) * 100).toFixed(2); const content = ` <table class="sar-table"> <tr> <td colspan="2"><h3>Head SAR (Cellular Only)</h3></td> <td colspan="2"><h3>Head SAR (Wi-Fi + Cellular)</h3></td> </tr> <tr> <td> <div class="sar-image-container"> <div class="background-fill" style="height:${headPercentCellular}%;"></div> <img src="https://www.rfsafe.com/wp-content/uploads/2022/12/children-absorb-more-phone-radiation-heads.png" alt="Head SAR"> </div> </td> <td> <div class="thermometer"> <div class="fill" style="height:${headPercentCellular}%;"></div> <div class="percent">${headPercentCellular}%</div> </div> </td> <td> <div class="sar-image-container"> <div class="background-fill" style="height:${headPercentWiFi}%;"></div> <img src="https://www.rfsafe.com/wp-content/uploads/2022/12/children-absorb-more-phone-radiation-heads.png" alt="Head SAR"> </div> </td> <td> <div class="thermometer"> <div class="fill" style="height:${headPercentWiFi}%;"></div> <div class="percent">${headPercentWiFi}%</div> </div> </td> </tr> <tr> <td colspan="2"><h3>Body SAR (Cellular Only)</h3></td> <td colspan="2"><h3>Body SAR (Wi-Fi + Cellular)</h3></td> </tr> <tr> <td> <div class="sar-image-container"> <div class="background-fill" style="height:${bodyPercentCellular}%;"></div> <img src="https://www.rfsafe.com/wp-content/uploads/2023/01/body-sar-warnings.png" alt="Body SAR"> </div> </td> <td> <div class="thermometer"> <div class="fill" style="height:${bodyPercentCellular}%;"></div> <div class="percent">${bodyPercentCellular}%</div> </div> </td> <td> <div class="sar-image-container"> <div class="background-fill" style="height:${bodyPercentWiFi}%;"></div> <img src="https://www.rfsafe.com/wp-content/uploads/2023/01/body-sar-warnings.png" alt="Body SAR"> </div> </td> <td> <div class="thermometer"> <div class="fill" style="height:${bodyPercentWiFi}%;"></div> <div class="percent">${bodyPercentWiFi}%</div> </div> </td> </tr> </table> <div class="sar-summary"> <p>1.07 W/kg (66.94% of limit) ranked #36.00</p> <p>1.43 W/kg (89.38% of limit) ranked #30.00</p> <p>1.11 W/kg (69.31% of limit) ranked #36.00</p> <p>1.48 W/kg (92.31% of limit) ranked #30.00</p> </div> `; const sarComparisonContainer = document.getElementById('sar-comparison-container'); sarComparisonContainer.innerHTML = content; document.getElementById('copy-link-container').style.display = 'block'; } function calcPercentDifference(value1, value2) { if (value1 && value2) { return Math.abs(((value1 - value2) / value2) * 100).toFixed(1); } return 'N/A'; } function capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1); } }); }); </script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel