function loop() {
    var date = new Date()
    
    var hour = date.getHours();
    hour = (hour < 10 ? "0" : "") + hour;

    var min  = date.getMinutes();
    min = (min < 10 ? "0" : "") + min;

    var sec  = date.getSeconds();
    sec = (sec < 10 ? "0" : "") + sec;
    
    $("#time").text(hour + ":" + min)

    setTimeout(() => {
        loop()
    }, 1000)
}

document.addEventListener("DOMContentLoaded", function() {
    loop()
})

$(document).on('keypress',function(e) {
    if(e.which == 102) {
        if ($.fullscreen.isFullScreen()) {
            $.fullscreen.exit()
        } else {
            $("body").fullscreen()
        }
    }
});