30:00
💰0円
```html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>逃走中タイマー</title>
<style>
@keyframes buttonClick {
0% { background-color: #ffffff; }
50% { background-color: #ffebcd; }
100% { background-color: #ffffff; }
}
@keyframes coinFall {
0% { opacity: 1; transform: translateY(0); }
100% { opacity: 0; transform: translateY(200px); }
}
</style>
</head>
<body>
<div style="width: 400px; height: 400px; margin: auto; border: 2px solid #ccc; text-align: center; font-size: 2em;">
<div id="timer" style="width: 100%; padding: 20px; background-color: #00bfff;">30:00</div>
<div id="prize" style="width: 100%; padding: 20px; background-color: #ffcc00;">💰0円</div>
<div style="margin: 20px;">
<input type="button" value="▶️ スタート" onclick="startGame()"
style="font-size: 1em; padding: 10px; margin: 5px;"/>
<input type="button" value="⏸️ ストップ" onclick="stopGame()"
style="font-size: 1em; padding: 10px; margin: 5px;"/>
<input type="button" value="⏮️ 巻き戻し" onclick="rewindTime()"
style="font-size: 1em; padding: 10px; margin: 5px;" />
<input type="button" value="🔄 リスタート" onclick="restartGame()"
style="font-size: 1em; padding: 10px; margin: 5px;" />
<input type="button" value="💎 ボーナス" onclick="addBonus()"
style="font-size: 1em; padding: 10px; margin: 5px;" />
</div>
</div>
<script>
let timerDiv = document.getElementById("timer");
let prizeDiv = document.getElementById("prize");
let totalTime = 1800; // 30 minutes in seconds
let prizeAmount = 0;
let interval;
function updateDisplay() {
let minutes = Math.floor(totalTime / 60);
let seconds = totalTime % 60;
timerDiv.innerText = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
prizeDiv.innerText = `💰${prizeAmount}円`;
}
function startGame() {
if (!interval) {
interval = setInterval(() => {
if (totalTime > 0) {
totalTime--;
prizeAmount += 100;
updateDisplay();
} else {
clearInterval(interval);
}
}, 1000);
}
buttonAnimation("スタート");
}
function stopGame() {
clearInterval(interval);
interval = null;
buttonAnimation("ストップ");
}
function rewindTime() {
totalTime = 1800;
prizeAmount = 0;
updateDisplay();
buttonAnimation("巻き戻し");
}
function restartGame() {
totalTime = 1800;
prizeAmount = 0;
clearInterval(interval);
interval = null;
updateDisplay();
buttonAnimation("リスタート");
}
function addBonus() {
prizeAmount += 3000;
updateDisplay();
buttonAnimation("ボーナス");
coinAnimation();
}
function buttonAnimation(type) {
let buttons = document.querySelectorAll("input[type='button']");
buttons.forEach(button => {
if (button.value.includes(type)) {
button.style.animation = "buttonClick 0.5s";
setTimeout(() => button.style.animation = "", 500);
}
});
}
function coinAnimation() {
let coin = document.createElement("div");
coin.innerText = "💰";
coin.style.position = "absolute";
coin.style.left = (Math.random() * 380) + "px";
coin.style.top = "-20px";
coin.style.animation = "coinFall 2s";
document.body.appendChild(coin);
setTimeout(() => coin.remove(), 2000);
}
updateDisplay();
</script>
</body>
</html>
```