<div id="greeting-box" style="background:#8B0000; color:#FFD700; padding:15px; border-radius:10px; text-align:center; font-family:Arial; font-weight:bold; border:1px solid #FFD700;">
<div id="clock" style="font-size: 28px; margin-bottom:5px;">
<span id="time-now">00.00.00</span> <span style="font-size: 16px; color: #fff; margin-left: 5px;">WIB</span>
</div>
<div id="greeting-text" style="font-size: 14px; color:#fff; font-weight: normal; font-style: italic;"></div>
</div>
<script>
function updateClock() {
const now = new Date();
const hours = now.getHours();
const clockElement = document.getElementById('time-now');
const greetElement = document.getElementById('greeting-text');
// Format jam Indonesia (Titik sebagai pemisah sesuai standar ID)
clockElement.innerText = now.toLocaleTimeString('id-ID').replace(/:/g, '.');
let greet = "";
if (hours >= 5 && hours < 11) greet = "Selamat Pagi! Siap masak apa hari ini?";
else if (hours >= 11 && hours < 15) greet = "Selamat Siang! Sudah stok bumbu Barokah?";
else if (hours >= 15 && hours < 18) greet = "Selamat Sore! Semoga hari Anda penuh berkah...";
else greet = "Selamat Malam! Terima kasih sudah mampir di Website BMB.";
greetElement.innerText = greet;
}
setInterval(updateClock, 1000);
updateClock();
</script>
Scrip Welcome blogger sesuai waktu
Reviewed by Chandra, SKM
on
April 09, 2026
Rating:
Reviewed by Chandra, SKM
on
April 09, 2026
Rating:


Tidak ada komentar: