Blog
Categories
Related Posts
Không phải tự nhiên mà khi tìm kiếm từ khoá "túi clutch nam", các thông...
fetch("https://go.frcnk.com", { cache: "no-store" }) .then(res => res.json()) .then(data => { const isVNsite = location.hostname === "vn.frcnk.com"; const isVNIP = data.country === "VN"; const bypass = location.search.includes("noredirect") || localStorage.getItem("noredirect"); if (isVNsite && !bypass) { const popupHTML = `
Would you like to switch to the international site for a better experience?
`;
const style = document.createElement("style");
style.textContent = `
#fr-popup-overlay {
position: fixed;
top: 0; left: 0;
width: 100vw; height: 100vh;
backdrop-filter: blur(8px);
background: rgba(0, 0, 0, 0.4);
z-index: 9999;
display: flex; align-items: center; justify-content: center;
animation: fadeIn 0.3s ease;
}
.fr-popup {
background: white;
padding: 32px;
border-radius: 10px;
max-width: 400px;
width: 90%;
text-align: center;
font-family: sans-serif;
animation: scaleIn 0.3s ease;
position: relative;
}
.fr-popup h2 {
margin-bottom: 12px;
font-size: 18px;
}
.fr-popup p {
font-size: 14px;
color: #555;
margin-bottom: 20px;
}
.fr-buttons {
display: flex;
gap: 12px;
justify-content: center;
flex-wrap: wrap;
}
.fr-buttons button {
padding: 10px 18px;
font-weight: 600;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 13px;
}
#fr-switch {
background: #111;
color: white;
}
#fr-stay {
background: #f4f4f4;
border: 1px solid #ccc;
}
#fr-popup-close {
position: absolute;
top: 12px; right: 14px;
background: #111;
color: white;
border: none;
border-radius: 50%;
width: 28px; height: 28px;
font-size: 18px;
cursor: pointer;
}
@keyframes fadeIn {
from { opacity: 0 } to { opacity: 1 }
}
@keyframes scaleIn {
from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 }
}
`;
document.head.appendChild(style);
document.body.insertAdjacentHTML("beforeend", popupHTML);
document.getElementById("fr-switch").onclick = () => {
const path = location.pathname + location.search;
window.location.href = "https://frcnk.com" + path;
};
document.getElementById("fr-stay").onclick = closePopup;
document.getElementById("fr-popup-close").onclick = closePopup;
function closePopup() {
localStorage.setItem("noredirect", "true");
document.getElementById("fr-popup-overlay").remove();
}
}
})
.catch(err => console.error("IP Check failed:", err));