(function(){
window.tampilkanSocialProof = function(data, position = "bottom") {
if (!Array.isArray(data) || data.length === 0) {
return;
}
let index = 0;
const box = document.createElement("div");
const getIsDarkMode = () => {
const rootTheme = (document.documentElement.getAttribute("data-theme") || "").toLowerCase();
if (rootTheme === "dark") return true;
if (rootTheme === "light") return false;
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
};
const applyThemeStyles = () => {
const isDark = getIsDarkMode();
box.style.background = isDark ? "rgba(15, 23, 28, 0.96)" : "#ffffff";
box.style.border = isDark ? "1px solid #2b3a42" : "1px solid #dddddd";
box.style.boxShadow = isDark ? "0 8px 24px rgba(0,0,0,0.45)" : "0 2px 8px rgba(0,0,0,0.2)";
box.style.color = isDark ? "#e8f1ee" : "#263238";
};
box.style.position = "fixed";
box.style[`${position}`] = "40px";
box.style.left = "20px";
box.style.padding = "10px";
box.style.borderRadius = "8px";
box.style.fontFamily = "Poppins, Arial, sans-serif";
box.style.fontSize = "14px";
box.style.zIndex = "9999";
box.style.display = "flex";
box.style.alignItems = "center";
box.style.maxWidth = "280px";
box.style.minWidth = "220px";
box.style.lineHeight = "1.35";
box.style.transition = "opacity 0.5s ease";
box.style.pointerEvents = "none";
box.style.wordBreak = "break-word";
applyThemeStyles();
document.body.appendChild(box);
function tampilkanBerikutnya() {
if (index >= data.length) index = 0;
const item = data[index++];
const waktu = formatTimeAgo(item.timestamp);
const isDark = getIsDarkMode();
const timeColor = isDark ? "#9bb0b3" : "#6b7280";
applyThemeStyles();
box.innerHTML = `
${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();
if (window.MutationObserver) {
const observer = new MutationObserver(() => applyThemeStyles());
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ["data-theme"],
});
}
};
window.tampilkanSocialProof([{"nama":"Teh Vini","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Teh Vini<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1785320430},{"nama":"Mas Hardian","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Mas Hardian<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1785306933},{"nama":"Bruri Berel Tumiwa ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Bruri Berel Tumiwa <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1783784380},{"nama":"Hasnidar","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Hasnidar<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1783494156},{"nama":"Lilis Juwita","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Lilis Juwita<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1782803351},{"nama":"Taswanto Heru","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Taswanto Heru<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1782735477},{"nama":"Dian Ferriswara","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Dian Ferriswara<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1782358291},{"nama":"Yani Hindiadi ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Yani Hindiadi <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1781966053},{"nama":"Iwan Aryana","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Iwan Aryana<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1781965846},{"nama":"Rusdi","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Rusdi<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1781100104},{"nama":"Supri Ediarto","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Supri Ediarto<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780673387},{"nama":"Nyono","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Nyono<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780665157},{"nama":"Jolin Manalang","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Jolin Manalang<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780569398},{"nama":"muhammad syam","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"muhammad syam<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780552601},{"nama":"Yuyun","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Yuyun<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780482177},{"nama":"Susanto","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Susanto<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780481234},{"nama":"Mas Hardian","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Mas Hardian<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780461160},{"nama":"Susiswo Karno","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Susiswo Karno<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780455060},{"nama":"Aris Mulyono ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Aris Mulyono <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780449483},{"nama":"Misbahul Munir","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Misbahul Munir<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780406589},{"nama":"Warda Alida","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Warda Alida<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780403257},{"nama":"Wasikin ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Wasikin <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780389846},{"nama":"Dadan Daud","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Dadan Daud<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780388989},{"nama":"Purwanto Djokolelono","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Purwanto Djokolelono<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780388773},{"nama":"Maz Yanto ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Maz Yanto <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780379080},{"nama":"Achmadi","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Achmadi<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780378686},{"nama":"satria","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"satria<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780377490},{"nama":"wahyu prasetya","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"wahyu prasetya<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780375992},{"nama":"M. Ghazali ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"M. Ghazali <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780374235},{"nama":"Jojo","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Jojo<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780373622},{"nama":"GANJAR PRABOWO MUKTI","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"GANJAR PRABOWO MUKTI<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780373298},{"nama":"julie rostina","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"julie rostina<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780372488},{"nama":"Usep Fauzi","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Usep Fauzi<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780370842},{"nama":"Septi","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Septi<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780370679},{"nama":"Muhamad Fathan","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Muhamad Fathan<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780353982},{"nama":"Ellen ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Ellen <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780305185},{"nama":"Wiwi wulandari","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Wiwi wulandari<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780305075},{"nama":"Nanding","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Nanding<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780295324},{"nama":"Ratna Alri","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Ratna Alri<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780295296},{"nama":"Aries Dwi Lestari ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Aries Dwi Lestari <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780292911},{"nama":"Danu Legowo","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Danu Legowo<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780282210},{"nama":"Ismail Marjuki ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Ismail Marjuki <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780280451},{"nama":"Nina","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Nina<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780280138},{"nama":"Den Bagus","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Den Bagus<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780279882},{"nama":"Nomo Satria ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Nomo Satria <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780279555},{"nama":"Viska Arestida ","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Viska Arestida <\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780279124},{"nama":"Evy Vabian","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Evy Vabian<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780278850},{"nama":"dominikus wawan","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"dominikus wawan<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780278580},{"nama":"erman effendi","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"erman effendi<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780278076},{"nama":"demarlampat","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"demarlampat<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780277936},{"nama":"Misol","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Misol<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780277892},{"nama":"Haris Naufalia","produk":"PROMPT VIRAL","foto":"https:\/\/pebisnis.digital\/uploads\/1781678144_8b673a8a6f65865c1321.png","text":"Haris Naufalia<\/b> telah order produk PROMPT VIRAL<\/em>","timestamp":1780200632}], 'bottom');
})();