<div id="notif" class="notif"></div>

<style>
.notif {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #b2db0e1c;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: yellow;
    padding: 12px 18px;
    width: 300px;
    height: 25px;
    font-size: 20px;
    border: 1px solid yellow;
    border-radius: 8px;
    opacity: 0;
    transition: .3s;
    z-index: 9999;
}
.notif.show {
    opacity: 1;
}
</style>

<script>
function showNotif(msg) {
    const n = document.getElementById("notif");
    n.textContent = msg;
    n.classList.add("show");

    setTimeout(() => {
        n.classList.remove("show");
    }, 3000);
}
</script>
