Siteβ―Builder
Editing:
sar-summary.html.txt
writable 0666
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SAR Summary</title> <style> body { font-family: Arial, sans-serif; padding: 20px; } .sar-summary-container { display: flex; align-items: flex-start; } .phone-details { margin-right: 20px; } .phone-details img { max-width: 200px; height: auto; } .phone-details p { margin: 5px 0; } .phone-details a { text-decoration: none; color: #0073aa; } .phone-details a:hover { text-decoration: underline; } .sar-summary { font-size: 16px; } .sar-summary strong { font-weight: bold; } </style> </head> <body> <div class="sar-summary-container"> <div class="phone-details" id="phone-details"></div> <div id="sar-summary" class="sar-summary"></div> </div> <script> 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 => { if (pid) { const phone = phoneData.find(p => p.post_id == pid); if (phone) { displayPhoneDetails(phone); displaySARSummary(phone); } else { document.getElementById('sar-summary').innerHTML = '<p>Phone data not found.</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) { displayPhoneDetails(matchedPhone); displaySARSummary(matchedPhone); } else { document.getElementById('sar-summary').innerHTML = '<p>No matching phone model found in the directory name.</p>'; } } }); function displayPhoneDetails(phone) { const { brand, model, thumbnail_url, screensize, dimensions, product_permalink, product_title, product_price } = phone; const phoneDetailsHTML = ` <img src="${thumbnail_url}" alt="${brand} ${model}"> <p><strong>${brand} ${model}</strong></p> <p>Screen Size: ${screensize || 'Coming Soon'}</p> <p>Dimensions: ${dimensions || 'Coming Soon'}</p> <p><a href="${product_permalink || 'https://www.rfsafe.com/best-phone-case-for-smartphone-radiation-protection/'}">${product_title || 'QuantaCase'}</a></p> <p>${formatPrice(product_price)}</p> `; document.getElementById('phone-details').innerHTML = phoneDetailsHTML; } function displaySARSummary(phone) { const phoneName = `${phone.brand} ${phone.model}`; const fccid = phone.fccid || 'N/A'; const ushead = phone.ushead || 'N/A'; const usbody = phone.usbody || 'N/A'; const productspecific = phone.productspecific || 'N/A'; const simulheadus = phone.simulheadus || 'N/A'; const simulbodyus = phone.simulbodyus || 'N/A'; const hotspot = phone.hotspot || 'N/A'; let summaryHTML = ` <p><br><br><br> <br> <strong>${phoneName} SAR Level Summary: </strong><br><br> The cellular transmission <strong>SAR values for the ${phoneName}</strong> (FCC ID ${fccid}) are <strong>${ushead} W/kg (watts per kilogram) at the head</strong> and <strong>${usbody} W/kg when worn on the body</strong>. `; if (productspecific !== '0.00') { summaryHTML += ` The hotspot/Airplay SAR level is <strong>${productspecific} W/kg</strong>. `; } if (simulheadus !== '0.00') { summaryHTML += ` The simultaneous transmission SAR values for ${phone.model} (cellular plus Wi-Fi) is <strong>${simulheadus} W/kg at the head</strong>, `; } if (simulbodyus !== '0.00') { summaryHTML += `<strong>${simulbodyus} W/kg when worn on the body</strong>, `; } if (hotspot !== '0.00') { summaryHTML += `and <strong>${hotspot} W/kg when used as a hotspot</strong> simultaneously with other transmitters active.<br><hr><br> `; } summaryHTML += '</p>'; document.getElementById('sar-summary').innerHTML = summaryHTML; } function formatPrice(priceString) { const [regularPrice, salePrice] = priceString.split('|'); if (salePrice && !isNaN(salePrice)) { return `<del aria-hidden="true"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>${regularPrice}</bdi></span></del> <ins aria-hidden="true"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>${salePrice}</bdi></span></ins>`; } else { return `<del aria-hidden="true"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>${regularPrice}</bdi></span></del> <span class="screen-reader-text">Check Price</span>`; } } }); </script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel