window.onload = function () { const coin = document.getElementById("coin"); const result = coin.dataset.result; // Delay so users see the flip setTimeout(() => { if (result === "H") { coin.style.transform = "rotateY(1080deg)"; } else { coin.style.transform = "rotateY(1260deg)"; } }, 300); };