Siteβ―Builder
Editing:
sar-sum,mary.html
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; flex-wrap: wrap; align-items: flex-start; } .phone-details { margin-right: 20px; flex: 1; } .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 { flex: 2; font-size: 16px; } .sar-summary strong { font-weight: bold; } @media (max-width: 768px) { .sar-summary-container { flex-direction: column; } .phone-details { margin-right: 0; margin-bottom: 20px; } } .sar-ranking-box { background-color: #0044cc; /* Different color for the ranking box */ color: #fff; text-align: center; padding: 10px; border-radius: 5px; margin-bottom: 10px; position: relative; } .sar-ranking-box .sar-ranking { font-size: 18px; font-weight: bold; } .sar-ranking-box .sar-value { font-size: 16px; } .sar-ranking-box a { color: #fff; /* White color for the link */ text-decoration: underline; font-size: 20px; font-weight: bold; /* Bold font for the link */ } .sar-ranking-box .btn { position: absolute; top: 50%; transform: translateY(-50%); background-color: transparent; color: #fff; border: none; font-size: 20px; cursor: pointer; } .sar-ranking-box .btn.prev { left: 10px; } .sar-ranking-box .btn.next { right: 10px; } .sar-table-container { overflow-x: auto; } .sar-table { width: 100%; border-collapse: collapse; } .sar-table th, .sar-table td { border: 1px solid #ddd; padding: 8px; text-align: center; cursor: pointer; } .sar-table th { background-color: #000; color: #fff; font-weight: bold; } .sar-table .highlight { background-color: yellow; } .sar-info { text-align: center; margin-top: 10px; } .sar-info a { color: #0073aa; text-decoration: none; font-weight: bold; } .sar-info a:hover { color: #005a87; } @media (max-width: 600px) { .sar-ranking-box { padding: 5px; font-size: 14px; } .sar-table th, .sar-table td { padding: 4px; font-size: 14px; } .sar-ranking-box .btn { font-size: 16px; } } </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> <div id="sar-ranking-container"></div> <script> document.addEventListener("DOMContentLoaded", function() { const testPositions = [ 'ushead', 'usbody', 'productspecific', 'simulheadus', 'simulbodyus', 'hotspot' ]; const testPositionNames = { 'ushead': 'Head SAR (Cellular Only)', 'usbody': 'Body SAR (Cellular Only)', 'productspecific': 'Hot Spot SAR (Cellular Only)', 'simulheadus': 'Head SAR (Wi-Fi + Cellular)', 'simulbodyus': 'Body SAR (Wi-Fi + Cellular)', 'hotspot': 'Hot Spot SAR (Wi-Fi + Cellular)' }; const urlParams = new URLSearchParams(window.location.search); const pid = urlParams.get('pid'); const currentPath = window.location.pathname.split('/'); const slug = currentPath[currentPath.length - 2]; fetch('/cache/sar2_cache.json') .then(response => response.json()) .then(phoneData => { const phone = phoneData.find(p => p.post_id == pid || (p.brand + ' ' + p.model).toLowerCase().replace(/ /g, '-') === slug); if (phone) { displayPhoneDetails(phone); displaySARSummary(phone); initializeSARRanking(phone); } else { document.getElementById('sar-summary').innerHTML = '<p>Phone data not found.</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>`; } } function initializeSARRanking(phone) { let currentIndex = 0; const sarData = testPositions.map(testpos => ({ type: testPositionNames[testpos], link: `/phones/${phone.brand.toLowerCase().replace(/\s+/g, '-')}-${phone.model.toLowerCase().replace(/\s+/g, '-')}/`, rank: phone.rank || 'N/A', percent: phone.percent || 'N/A', value: phone[testpos] || 'N/A' })); function updateRankingBox(index) { const data = sarData[index]; const rankingBoxHTML = ` <div class="sar-ranking-box"> <button class="btn prev" onclick="changeRanking(-1)"><<</button> <div class="sar-ranking">${data.type}</div> <div class="sar-value"> <a href="${data.link}"> <strong>${data.value} W/kg</strong> </a> <a href="${data.link}"> <span>Ranked #${data.rank} (${data.percent}% of limit)</span> </a> </div> <button class="btn next" onclick="changeRanking(1)">>></button> </div> <div class="sar-table-container"> <table class="sar-table"> <thead> <tr> <th>Radiation Levels</th> <th>Head</th> <th>Body</th> <th>Hot Spot</th> </tr> </thead> <tbody> <tr> <td>Cellular Only</td> <td class="${data.value > phone.simulheadus ? 'sar-value-higher' : 'sar-value-lower'}">${phone.ushead} W/kg</td> <td class="${data.value > phone.simulbodyus ? 'sar-value-higher' : 'sar-value-lower'}">${phone.usbody} W/kg</td> <td class="${data.value > phone.simulbodyus ? 'sar-value-higher' : 'sar-value-lower'}">${phone.productspecific} W/kg</td> </tr> <tr> <td>Wi-Fi + Cellular</td> <td class="${phone.simulheadus > phone.ushead ? 'sar-value-higher' : 'sar-value-lower'}">${phone.simulheadus} W/kg</td> <td class="${phone.simulbodyus > phone.usbody ? 'sar-value-higher' : 'sar-value-lower'}">${phone.simulbodyus} W/kg</td> <td class="${phone.hotspot > phone.productspecific ? 'sar-value-higher' : 'sar-value-lower'}">${phone.hotspot} W/kg</td> </tr> </tbody> </table> </div> `; document.getElementById('sar-ranking-container').innerHTML = rankingBoxHTML; } window.changeRanking = function (direction) { currentIndex = (currentIndex + direction + sarData.length) % sarData.length; updateRankingBox(currentIndex); }; updateRankingBox(currentIndex); } }); </script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel