<!DOCTYPE html> <html> <head> <title>逃走中タイマー</title> <script> let timerElement = document.createElement('div'); let bountyElement = document.createElement('div'); let totalBounty = 0; function startTimer() { timerElement.innerText = '00:00:00'; bountyElement.innerText = '¥0'; let startTime = Date.now(); let endTime = startTime + (60 * 60000); // 60 minutes let timerInterval = setInterval(function() { let currentTime = Date.now(); let timeRemaining = endTime - currentTime; if (timeRemaining <= 0) { clearInterval(timerInterval); alert('Time is up! Your total bounty is ¥' + totalBounty); } else { let minutes = Math.floor((timeRemaining % (1000 * 60 * 60)) / (1000 * 60)); let seconds = Math.floor((timeRemaining % (1000 * 60)) / 1000); timerElement.innerText = ('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2); let bountyPerSecond = timeRemaining >= 3000000 ? 300 : 800; let bounty = Math.ceil(timeRemaining / 1000) * bountyPerSecond; totalBounty += bounty; bountyElement.innerText = '¥' + totalBounty; } }, 1000); document.body.appendChild(timerElement); document.body.appendChild(bountyElement); } startTimer(); </script> </head> <body> </body> </html>