const form = document.querySelector('form');
const input = document.querySelector('input');
form.addEventListener('submit', async event => {
event.preventDefault();
window.navigator.serviceWorker.register('./sw.js', {
scope: __uv$config.prefix
}).then(() => {
let url = input.value.trim();
if (!isUrl(url)) url = 'https://www.google.com/search?q=' + url;
else if (!(url.startsWith('https://') || url.startsWith('http://'))) url = 'http://' + url;
window.location.href = __uv$config.prefix + __uv$config.encodeUrl(url);
});
});
function isUrl(val = '') {
if (/^http(s?):\/\//.test(val) || val.includes('.') && val.substr(0, 1) !== ' ') return true;
return false;
};
function loadMario() {
window.location.replace('g4mescreen/supermario64.html');
}
function loadFireboyWatergirl() {
window.location.replace('g4mescreen/fbwg.html');
}
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
function showTime(){
var date = new Date();
var h = date.getHours();
var m = date.getMinutes();
var s = date.getSeconds();
var session = "AM";
if(h == 0){
h = 12;
}
if(h > 12){
h = h - 12;
session = "PM";
}
h = (h < 10) ? "0" + h : h;
m = (m < 10) ? "0" + m : m;
s = (s < 10) ? "0" + s : s;
var time = h + ":" + m + ":" + s + " " + session;
document.getElementById("MyClockDisplay").innerText = time;
document.getElementById("MyClockDisplay").textContent = time;
setTimeout(showTime, 1000);
}
showTime();