Siteβ―Builder
Editing:
index-updat3333333e.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>Phone Specifications</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; } .specs-container { padding: 20px; } .specs-table { width: 100%; border-collapse: collapse; margin-top: 20px; } .specs-table th, .specs-table td { border: 1px solid #ddd; padding: 10px; text-align: left; } .specs-table th { background-color: #000; color: #fff; font-weight: bold; } .spec-group-title { background-color: #0073aa; color: white; padding: 10px; text-align: left; font-size: 18px; } .review-summary { display: none; } .review-summary p { display: inline; } .review-summary a { color: #0056b3; cursor: pointer; text-decoration: underline; } .menu-button { display: none; background-color: #0056b3; color: white; padding: 5px; border: none; cursor: pointer; position: relative; z-index: 2; } .menu-button div { width: 25px; height: 3px; background-color: white; margin: 3px 0; } .nav-overlay { display: none; position: fixed; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); top: 0; left: 0; z-index: 1; flex-direction: column; justify-content: center; align-items: center; } .nav-overlay a { color: white; font-size: 24px; margin: 10px 0; } @media (max-width: 600px) { .nav { display: none; } .menu-button { display: flex; flex-direction: column; } } .sar-summary-container { padding: 20px; display: flex; flex-wrap: wrap; align-items: flex-start; } .phone-details { margin-right: 20px; flex: 1; } .phone-details img { max-width: 300px; 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-wrapper { flex: 2; display: flex; flex-direction: column; } .sar-summary { font-size: 16px; margin-bottom: 10px; } .sar-summary strong { font-weight: bold; } .button-container { margin-top: 10px; margin-bottom: 10px; } .button-container a { display: inline-block; padding: 10px 15px; margin-right: 10px; background-color: black; color: white; text-decoration: none; border-radius: 5px; font-size: 14px; } .button-container a:hover { background-color: #444; } @media (max-width: 768px) { .sar-summary-container { flex-direction: column; } .phone-details { margin-right: 0; margin-bottom: 20px; } .button-container a { margin-bottom: 10px; } } .sar-ranking-box { background-color: #0044cc; 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; text-decoration: underline; font-size: 20px; font-weight: bold; } .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; } } .blink-yellow { animation: blinkYellow 1s infinite; } @keyframes blinkYellow { 0% { color: white; } 50% { color: yellow; } 100% { color: white; } } .blink-red { animation: blinkRed 1s infinite; } @keyframes blinkRed { 0% { color: white; } 50% { color: red; } 100% { color: white; } } .blink-green { animation: blinkGreen 1s infinite; } @keyframes blinkGreen { 0% { color: white; } 50% { color: green; } 100% { color: white; } } </style> </head> <body> <div class="header"> <img src="https://www.rfsafe.com/wp-content/uploads/2022/03/rfsafe-logo-r.jpg" alt="RF Safe Logo"> <div class="nav"> <a href="#">Info</a> <a href="#">News</a> <a href="#">SAR Database</a> <a href="#">QuantaCase</a> <a href="#">iPhone</a> <a href="#">Samsung</a> <a href="#">Google</a> </div> <button class="menu-button" onclick="toggleMenu()"> <div></div> <div></div> <div></div> </button> <div class="nav-overlay" id="nav-overlay"> <a href="#">Info</a> <a href="#">News</a> <a href="#">SAR Database</a> <a href="#">QuantaCase</a> <a href="#">iPhone</a> <a href="#">Samsung</a> <a href="#">Google</a> <button onclick="toggleMenu()">Close</button> </div> </div> <div class="news-flash"> News Flash β‘ Spot Fake Anti Radiation Phone Cases </div> <div id="error-message" class="error-message"></div> <div class="sar-summary-container"> <div class="phone-details" id="phone-details"></div> <div class="sar-summary-wrapper"> <div id="sar-summary" class="sar-summary"></div> <div id="product-details" class="phone-details"></div> <div class="button-container" id="button-container"></div> </div> </div> <div id="sar-ranking-container"></div> <script> // Error handling window.onerror = function (msg, url, lineNo, columnNo, error) { const errorMessage = ` <strong>Error:</strong> ${msg}<br> <strong>Script:</strong> ${url}<br> <strong>Line:</strong> ${lineNo}, Column: ${columnNo}<br> <strong>StackTrace:</strong> ${error?.stack || 'N/A'} `; document.getElementById('error-message').innerHTML = errorMessage; console.log(msg, url, lineNo, columnNo, error); return false; }; 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 pathArray = window.location.pathname.split('/'); const phoneSlug = pathArray[pathArray.length - 2]; // Get the second last segment which is the phone folder name const jsonFilePath = `/phones/${phoneSlug}/${phoneSlug}_cache.json`; fetch(jsonFilePath) .then(response => { if (!response.ok) { throw new Error('Network response was not ok ' + response.statusText); } return response.json(); }) .then(phoneData => { const phone = phoneData.Phone; if (phone) { displayPhoneDetails(phone); displaySARSummary(phone); displayButtons(phone); initializeSARRanking(phone); } else { document.getElementById('sar-summary').innerHTML = '<p>Phone data not found.</p>'; } }) .catch(error => { console.log('There has been a problem with your fetch operation:', error); document.getElementById('error-message').innerText = 'Error: ' + error.message; }); function displayPhoneDetails(phone) { const { brand, model, thumbnail_url, screensize, dimensions, product_permalink, product_title, product_price } = phone; const fullImageUrl = thumbnail_url.replace('-150x150', ''); const phoneDetailsHTML = ` <img src="${fullImageUrl}" alt="${brand} ${model}"> <p><strong>${brand} ${model}</strong></p> <p>Screen Size: ${screensize || 'Coming Soon'}</p> <p>Dimensions: ${dimensions || 'Coming Soon'}</p> `; const productDetailsHTML = ` <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; document.getElementById('product-details').innerHTML = productDetailsHTML; } 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> <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 displayButtons(phone) { const pid = phone.post_id; const buttonContainerHTML = ` <a href="phone-radiation-safety-information.html">SAR Safety Tip</a> <a href="cell-phone-radiation-kids.html">Children</a> <a href="/compare-important-specs-first.php?pid=${pid}">Compare Phones</a> `; document.getElementById('button-container').innerHTML = buttonContainerHTML; } 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 => { let rank = 'N/A'; let percent = 'N/A'; if (testpos === 'productspecific') { rank = phone['productspecific_rank'] || 'N/A'; percent = phone['productspecific_percent'] || 'N/A'; } else if (testpos === 'hotspot') { rank = phone['simulhotspot_rank'] || 'N/A'; percent = phone['simulhotspot_percent'] || 'N/A'; } else { rank = phone[`${testpos}_rank`] || 'N/A'; percent = phone[`${testpos}_percent`] || 'N/A'; } return { type: testPositionNames[testpos], link: `/compare-sar-rank.html?test=${testpos}&pid=${phone.post_id}`, rank: rank.replace('.00', ''), percent: percent, value: phone[testpos] || 'N/A' }; }); function updateRankingBox(index) { const data = sarData[index]; const percentValue = parseFloat(data.percent); let blinkClass = 'blink-yellow'; if (percentValue < 25) { blinkClass = 'blink-green'; } else if (percentValue > 75) { blinkClass = 'blink-red'; } 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}" class="${blinkClass}"> <strong>${data.value} W/kg</strong> </a> <a href="${data.link}" class="${blinkClass}"> <span class="rank-highlight">Ranked #<span class="rank-value">${data.rank}</span> (${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.type === 'Head SAR (Cellular Only)' ? 'highlight' : ''}" data-testpos="ushead">${phone.ushead} W/kg</td> <td class="${data.type === 'Body SAR (Cellular Only)' ? 'highlight' : ''}" data-testpos="usbody">${phone.usbody} W/kg</td> <td class="${data.type === 'Hot Spot SAR (Cellular Only)' ? 'highlight' : ''}" data-testpos="productspecific">${phone.productspecific} W/kg</td> </tr> <tr> <td>Wi-Fi + Cellular</td> <td class="${data.type === 'Head SAR (Wi-Fi + Cellular)' ? 'highlight' : ''}" data-testpos="simulheadus">${phone.simulheadus} W/kg</td> <td class="${data.type === 'Body SAR (Wi-Fi + Cellular)' ? 'highlight' : ''}" data-testpos="simulbodyus">${phone.simulbodyus} W/kg</td> <td class="${data.type === 'Hot Spot SAR (Wi-Fi + Cellular)' ? 'highlight' : ''}" data-testpos="hotspot">${phone.hotspot} W/kg</td> </tr> </tbody> </table> </div> `; document.getElementById('sar-ranking-container').innerHTML = rankingBoxHTML; attachClickHandlers(); } function attachClickHandlers() { const cells = document.querySelectorAll('.sar-table td'); cells.forEach(cell => { cell.addEventListener('click', function () { const testpos = this.getAttribute('data-testpos'); const index = testPositions.indexOf(testpos); if (index !== -1) { changeRanking(index - currentIndex); } }); }); } window.changeRanking = function (direction) { currentIndex = (currentIndex + direction + sarData.length) % sarData.length; updateRankingBox(currentIndex); }; updateRankingBox(currentIndex); } }); </script> <div class="specs-container"> <h1 id="phone-title">Phone Specifications</h1> <table class="specs-table" id="specs-table"> <tbody> </tbody> </table> </div> <script> function toggleMenu() { const navOverlay = document.getElementById('nav-overlay'); navOverlay.style.display = navOverlay.style.display === 'flex' ? 'none' : 'flex'; } document.addEventListener('DOMContentLoaded', function() { const phoneTitle = document.getElementById('phone-title'); const specsTableBody = document.getElementById('specs-table').querySelector('tbody'); // Extract the brand and model from the URL path const pathArray = window.location.pathname.split('/'); const phoneSlug = pathArray[pathArray.length - 2]; // Get the second last segment which is the phone folder name // Construct the JSON file path const jsonFilePath = `${phoneSlug}_cache.json`; // Fetch and display phone specs fetch(jsonFilePath) .then(response => response.json()) .then(data => { // Set the phone title const phoneName = phoneSlug.replace(/-/g, ' ').toUpperCase(); phoneTitle.textContent = phoneName + ' Specifications'; // Populate the table with specs for (const group in data) { if (group === "Phone") { continue; // Skip the Phone group } // Add group title row const groupRow = document.createElement('tr'); const groupCell = document.createElement('td'); groupCell.setAttribute('colspan', 2); groupCell.className = 'spec-group-title'; groupCell.innerHTML = `<h2>${group}</h2>`; groupRow.appendChild(groupCell); specsTableBody.appendChild(groupRow); // Add individual specs for (const spec in data[group]) { // Add spec label row const specLabelRow = document.createElement('tr'); const specLabelCell = document.createElement('th'); specLabelCell.setAttribute('colspan', 2); specLabelCell.textContent = spec; specLabelRow.appendChild(specLabelCell); specsTableBody.appendChild(specLabelRow); // Add spec value row const specValueRow = document.createElement('tr'); const specValueCell = document.createElement('td'); specValueCell.setAttribute('colspan', 2); let value = data[group][spec]; if (value.length > 500) { const shortValue = value.substring(0, 500) + '... '; const fullValue = value; const summary = document.createElement('div'); summary.className = 'review-summary'; summary.style.display = 'block'; summary.innerHTML = `<p>${shortValue.replace(/<br\s*\/?>/gi, '\n').replace(/\n/g, '<br>')}<a onclick="toggleReview(this)">Continue reading</a></p>`; const fullReview = document.createElement('div'); fullReview.className = 'review-summary'; fullReview.style.display = 'none'; fullReview.innerHTML = `<p>${fullValue.replace(/<br\s*\/?>/gi, '\n').replace(/\n/g, '<br>')}<a onclick="toggleReview(this)"> Show less</a></p>`; specValueCell.appendChild(summary); specValueCell.appendChild(fullReview); } else { specValueCell.innerHTML = value.replace(/<br\s*\/?>/gi, '\n').replace(/\n/g, '<br>'); } specValueRow.appendChild(specValueCell); specsTableBody.appendChild(specValueRow); } } }) .catch(error => { specsTableBody.innerHTML = '<tr><td colspan="2">Error loading specifications. Please try again later.</td></tr>'; }); }); function toggleReview(link) { const summary = link.parentElement.parentElement; const fullReview = summary.nextElementSibling; if (summary.style.display === 'block') { summary.style.display = 'none'; fullReview.style.display = 'block'; } else { summary.style.display = 'block'; fullReview.style.display = 'none'; } } </script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel