//Custom menu document.addEventListener("contextmenu", function (e) { e.preventDefault(); var contextMenu = document.getElementById("context-menu"); contextMenu.style.top = e.clientY + 3 + "px"; contextMenu.style.left = e.clientX + "px"; contextMenu.classList.remove("hide"); }); document.addEventListener("click", function (e) { var contextMenu = document.getElementById("context-menu"); contextMenu.classList.add("hide"); }); //Fullscreen function toggleFullScreen() { if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { // 各ブラウザのプレフィックスを考慮 if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen(); } else if (document.documentElement.mozRequestFullScreen) { document.documentElement.mozRequestFullScreen(); } else if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } else if (document.documentElement.msRequestFullscreen) { document.documentElement.msRequestFullscreen(); } } else { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } } } document.getElementById("fbtn").addEventListener("click", toggleFullScreen); //Inspect const classId = "insp"; function handleClick(event) { (function () { var r = _ => eruda.initDesktop(); if (!window.eruda) { var s = document.createElement("script"); s.src = "https://cdn.jsdelivr.net/gh/BinBashBanana/erudesktop@master/dist/eruda.js"; s.onload = r; s.onerror = _ => alert("Failed to load script"); document.body.appendChild(s) } else r() })(); } const element = document.getElementById(classId); element.addEventListener("click", handleClick); //Clock function clock() { var nowTime = new Date(); var nowHour = nowTime.getHours(); var nowMin = nowTime.getMinutes(); var msg = (nowHour < 10 ? "0" : "") + nowHour + ":" + (nowMin < 10 ? "0" : "") + nowMin; document.getElementById("RealtimeClockArea").innerHTML = msg; } setInterval('clock()', 1000); //Dark&Light theme function toggleColorMode() { const body = document.body; const currentMode = body.classList.contains('dark-mode') ? 'dark-mode' : 'light-mode'; const newMode = (currentMode === 'dark-mode') ? 'light-mode' : 'dark-mode'; body.classList.replace(currentMode, newMode); localStorage.setItem('colorMode', newMode); } const savedMode = localStorage.getItem('colorMode'); if (savedMode === 'light-mode') { document.body.classList.add('light-mode'); } else { document.body.classList.add('dark-mode'); } //Open a:b function ablaunch(url) { const now = new Date(); const hour = now.getHours(); if (hour >= 22 || hour < 6) { alert("⚠現在はインターネットオフモードの時間帯なので外部サイトの読み込みはできません"); }else{ var newTab = window.open('about:blank', '_blank'); newTab.document.write('