(function(){ window.tampilkanSocialProof = function(data, position = "bottom") { let index = 0; const box = document.createElement("div"); box.style.position = "fixed"; box.style[`${position}`] = "20px"; 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 = "997"; box.style.display = "flex"; box.style.alignItems = "center"; box.style.maxWidth = "280px"; 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":"Ama****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Ama****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1778726519},{"nama":"fat****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"fat****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1777047584},{"nama":"Ato****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Ato****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776957191},{"nama":"Sah****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Sah****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776868136},{"nama":"Aza****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Aza****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776789982},{"nama":"Sah****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Sah****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776690077},{"nama":"Sah****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Sah****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776690054},{"nama":"Ani****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Ani****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776643817},{"nama":"Mad****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Mad****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776638493},{"nama":"ste****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"ste****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1776416426},{"nama":"Mar****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Mar****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1775890209},{"nama":"Ani****","produk":"Mass WASender PRO","foto":"https:\/\/adhifa.com\/uploads\/produk\/1777956239_cbfa7c47e5ad03b6dc23.png","text":"Ani****<\/b> telah beli Mass WASender PRO<\/em>","timestamp":1775828257}], 'top'); })();