(function(){ window.tampilkanSocialProof = function(data, position = "bottom") { let index = 0; const box = document.createElement("div"); box.style.position = "fixed"; box.style[`${position}`] = "40px"; box.style.left = "20px"; box.style.background = "#fff"; box.style.border = "1px solid #ddd"; box.style.padding = "10px"; box.style.borderRadius = "8px"; box.style.boxShadow = "0 2px 8px rgba(0,0,0,0.2)"; box.style.fontFamily = "Arial, sans-serif"; box.style.fontSize = "14px"; box.style.zIndex = "9999"; box.style.display = "flex"; box.style.alignItems = "center"; box.style.maxWidth = "300px"; box.style.transition = "opacity 0.5s ease"; document.body.appendChild(box); function tampilkanBerikutnya() { if (index >= data.length) index = 0; const item = data[index++]; const waktu = formatTimeAgo(item.timestamp); box.innerHTML = ` produk
${item.text}
${waktu}
`; box.style.opacity = "1"; setTimeout(() => box.style.opacity = "0", 6000); setTimeout(tampilkanBerikutnya, 8000); } function maskNama(nama) { return nama.length > 3 ? nama.substring(0, 3) + '****' : nama; } function formatTimeAgo(timestamp) { const now = Math.floor(Date.now() / 1000); const diff = now - timestamp; if (diff < 60) return "baru saja"; if (diff < 3600) return `${Math.floor(diff / 60)} menit lalu`; if (diff < 86400) return `${Math.floor(diff / 3600)} jam lalu`; return `${Math.floor(diff / 86400)} hari lalu`; } tampilkanBerikutnya(); }; window.tampilkanSocialProof([{"nama":"Sam****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Sam****<\/b> telah order produk InstanApp - Trial","timestamp":1751347583},{"nama":"Ind****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Ind****<\/b> telah order produk InstanApp - Trial","timestamp":1751329657},{"nama":"Arf****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Arf****<\/b> telah order produk InstanApp - Trial","timestamp":1751277460},{"nama":"Alb****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Alb****<\/b> telah order produk InstanApp - Trial","timestamp":1751243159},{"nama":"zel****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"zel****<\/b> telah order produk InstanApp - Trial","timestamp":1751190004},{"nama":"Mau****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Mau****<\/b> telah order produk InstanApp - Trial","timestamp":1751187077},{"nama":"Muh****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Muh****<\/b> telah order produk InstanApp - Trial","timestamp":1751177172},{"nama":"Aer****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Aer****<\/b> telah order produk InstanApp - Trial","timestamp":1751175500},{"nama":"Asr****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Asr****<\/b> telah order produk InstanApp - Trial","timestamp":1751173322},{"nama":"And****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"And****<\/b> telah order produk InstanApp - Trial","timestamp":1751152805},{"nama":"Sag****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Sag****<\/b> telah order produk InstanApp - Trial","timestamp":1751116197},{"nama":"Fer****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"Fer****<\/b> telah order produk InstanApp - Trial","timestamp":1751109923},{"nama":"ago****","produk":"InstanApp - Trial","foto":"https:\/\/adhifa.com\/uploads\/instanapp.png","text":"ago****<\/b> telah order produk InstanApp - Trial","timestamp":1751109922}], 'top'); })();