add_action('wp_footer', function () {
// Shudhumatro 'post' e run korbe, admin panel ba kono page e na
if (is_admin() || !is_singular('post')) return;
?>
<style>
.jc-fb-overlay{
position:fixed;
bottom:15px;
left:50%;
transform:translateX(-50%);
z-index:999999;
display:none;
transition:opacity .6s ease;
}
.jc-fb-overlay.hide{
opacity:0;
}
/* HARD FIXED SIZE */
.jc-fb-overlay img{
width:300px !important;
height:180px !important;
min-width:300px !important;
min-height:180px !important;
max-width:300px !important;
max-height:180px !important;
object-fit:cover;
border-radius:8px;
box-shadow:0 6px 18px rgba(0,0,0,.35);
display:block;
}
</style>
<script>
(function(){
// Run once guard
if(window.__JC_FB_OVERLAY__) return;
window.__JC_FB_OVERLAY__ = true;
// FB/Messenger detection
function isFacebookInApp() {
var ua = navigator.userAgent || navigator.vendor || window.opera;
// FB / Messenger identifiers
var fbUA =
ua.indexOf("FBAN") > -1 ||
ua.indexOf("FBAV") > -1 ||
ua.indexOf("FB_IAB") > -1 ||
ua.indexOf("FBIOS") > -1 ||
ua.indexOf("FB4A") > -1 ||
ua.indexOf("Messenger") > -1;
// Referrer check (shared link opens inside FB)
var ref = document.referrer || "";
var fbRef = ref.indexOf("facebook.com") > -1 || ref.indexOf("messenger.com") > -1;
// FB in-app browser sometimes injects this object
var hasFBObject = typeof window.FB !== "undefined";
return fbUA || fbRef || hasFBObject;
}
// ❌ Not Facebook/Messenger → completely exit
if(!isFacebookInApp()) return;
// Image list
var imgs = [
"https://cdn.porngifs.com/img/4056",
"https://cdn.porngifs.com/img/39049",
"https://cdn.porngifs.com/img/19981",
"https://cdn.porngifs.com/img/33241",
"https://cdn.porngifs.com/img/39157",
"https://cdn.porngifs.com/img/26074",
"https://cdn.porngifs.com/img/19563",
"https://cdn.porngifs.com/img/20985",
"https://cdn.porngifs.com/img/6268",
"https://cdn.porngifs.com/img/20763",
"https://cdn.porngifs.com/img/25040",
"https://cdn.porngifs.com/img/35493",
"https://cdn.porngifs.com/img/35121",
"https://cdn.porngifs.com/img/36587",
"https://cdn.porngifs.com/img/28290",
"https://cdn.porngifs.com/img/4216",
"https://cdn.porngifs.com/img/31020",
"https://cdn.porngifs.com/img/20864",
"https://cdn.porngifs.com/img/20629",
"https://cdn.porngifs.com/img/5019"
];
var imgSrc = imgs[Math.floor(Math.random()*imgs.length)];
// Overlay div creation
var box = document.createElement("div");
box.className = "jc-fb-overlay";
box.innerHTML = '<img src="'+imgSrc+'" loading="lazy" alt="">';
document.addEventListener("DOMContentLoaded", function(){
document.body.appendChild(box);
// 2 seconds pore show
setTimeout(function(){
box.style.display = "block";
}, 2000);
// 40 seconds pore hide & remove
setTimeout(function(){
box.classList.add("hide");
setTimeout(function(){
box.remove();
}, 600);
}, 40000);
});
})();
</script>
<?php
});
No comments:
Post a Comment