✨空き確認アプリ✨
🔍🔔🎈🎉🛎️
🕒待機中...
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>🎉予約チェッカー🎉</title>
<style>
@keyframes bounce {
0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-30px); }
60% { transform: translateY(-15px); }
}
@keyframes sparkle {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.bounce {
animation: bounce 2s infinite;
}
.sparkle {
animation: sparkle 1.5s infinite;
}
</style>
</head>
<body>
<div style="text-align:center; padding:10px;">
<h1 style="font-size:24px;">✨空き確認アプリ✨</h1>
<div style="font-size:50px;">🔍🔔🎈🎉🛎️</div>
<input type="text" id="username" placeholder="ユーザー名" style="padding:10px; font-size:16px; margin-top:20px; width:80%;">
<div>
<button id="startBtn" style="padding:10px 20px; font-size:16px; margin-top:20px; cursor:pointer;">🚀スタート🚀</button>
</div>
<div id="status" style="margin-top:20px; font-size:18px;">🕒待機中...</div>
<div style="margin-top:20px;">
<button class="bounce" onclick="startMonitoring();" style="padding:10px 15px; font-size:16px; margin:5px; cursor:pointer;">✅チェック✅</button>
<button class="sparkle" onclick="stopMonitoring();" style="padding:10px 15px; font-size:16px; margin:5px; cursor:pointer;">❌停止❌</button>
</div>
</div>
<script>
const targetURL = 'https://www.reserve.naltec.go.jp/web/ap-entry?slinky___page=forward:A1001_01';
let intervalId = null;
document.getElementById('startBtn').addEventListener('click', () => {
const username = document.getElementById('username').value;
if(username.trim() === ''){
alert('ユーザー名を入力してください!🎯');
return;
}
startMonitoring();
});
function startMonitoring() {
if(intervalId) return;
document.getElementById('status').innerHTML = '🔄監視中…';
intervalId = setInterval(checkAvailability, 5000);
checkAvailability();
}
function stopMonitoring() {
if(intervalId){
clearInterval(intervalId);
intervalId = null;
document.getElementById('status').innerHTML = '🛑停止中';
}
}
async function checkAvailability() {
try {
let response = await fetch(targetURL, {mode: 'cors'});
if(response.ok){
let text = await response.text();
// 簡易的な空き確認(例として「空きあり」というフレーズを探す)
if(text.includes('空きあり')){
document.getElementById('status').innerHTML = '🎉 空きが見つかりました!登録中… 🎉';
alert("ウィンドウを開く処理がブロックされました");
stopMonitoring();
} else {
document.getElementById('status').innerHTML = '🕒 まだ空きなし…';
}
} else {
document.getElementById('status').innerHTML = '⚠️ エラー発生!';
}
} catch (error) {
document.getElementById('status').innerHTML = '💥 エラー: ' + error.message;
}
}
</script>
</body>
</html>
```