Download Pi.html from Hosdroid/Aplood: direct link, hf CLI and curl.
- Browser
- Download file 11.5 kB
-
https://huggingface.co/spaces/Hosdroid/Aplood/resolve/main/Pi.html
- Command line
-
hf download hf://spaces/Hosdroid/Aplood/Pi.html
-
curl -L -o Pi.html https://huggingface.co/spaces/Hosdroid/Aplood/resolve/main/Pi.html
11.5 kB
| <html lang="fa" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>کنترلگر هوشمند بازی - Tank Stars</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" /> | |
| <style> | |
| body { | |
| font-family: 'Vazirmatn', sans-serif; | |
| background-color: #0f172a; | |
| color: white; | |
| overflow: hidden; /* جلوگیری از اسکرول */ | |
| } | |
| /* استایلهای مربوط به iframe و لایه مسدود کننده */ | |
| #game-container { | |
| position: relative; | |
| width: 100vw; | |
| height: 100vh; | |
| z-index: 1; | |
| } | |
| iframe { | |
| width: 100%; | |
| height: 100%; | |
| border: none; | |
| display: block; | |
| } | |
| /* لایه قفل (Overlay) */ | |
| #lock-overlay { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background: rgba(15, 23, 42, 0.95); | |
| backdrop-filter: blur(10px); | |
| z-index: 9999; | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: center; | |
| align-items: center; | |
| text-align: center; | |
| opacity: 0; | |
| pointer-events: none; /* وقتی مخفی است کلیک نشود */ | |
| transition: opacity 0.5s ease; | |
| } | |
| #lock-overlay.active { | |
| opacity: 1; | |
| pointer-events: all; | |
| } | |
| .emoji-large { | |
| font-size: 5rem; | |
| margin-bottom: 1rem; | |
| animation: bounce 2s infinite; | |
| } | |
| @keyframes bounce { | |
| 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} | |
| 40% {transform: translateY(-30px);} | |
| 60% {transform: translateY(-15px);} | |
| } | |
| /* دکمه تنظیمات مخفی */ | |
| #settings-trigger { | |
| position: fixed; | |
| bottom: 10px; | |
| right: 10px; | |
| width: 20px; | |
| height: 20px; | |
| background: transparent; | |
| z-index: 10000; | |
| cursor: default; | |
| } | |
| /* پنل تنظیمات */ | |
| #settings-panel { | |
| position: fixed; | |
| bottom: 20px; | |
| right: 20px; | |
| background: #1e293b; | |
| padding: 20px; | |
| border-radius: 12px; | |
| box-shadow: 0 10px 25px rgba(0,0,0,0.5); | |
| z-index: 10001; | |
| display: none; | |
| border: 1px solid #334155; | |
| } | |
| .timer-badge { | |
| position: fixed; | |
| top: 10px; | |
| left: 10px; | |
| background: rgba(0, 0, 0, 0.7); | |
| padding: 5px 15px; | |
| border-radius: 20px; | |
| font-weight: bold; | |
| z-index: 50; | |
| border: 1px solid #ef4444; | |
| color: #ef4444; | |
| pointer-events: none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- تایمر شمارش معکوس --> | |
| <div id="timer-display" class="timer-badge hidden">00:00:00</div> | |
| <!-- کانتینر اصلی بازی --> | |
| <div id="game-container"> | |
| <iframe id="game-frame" src="" allowfullscreen></iframe> | |
| <!-- لایه مسدود کننده بعد از اتمام زمان --> | |
| <div id="lock-overlay"> | |
| <div class="emoji-large">😁</div> | |
| <h1 class="text-4xl font-bold text-red-500 mb-4">دیگه زمان بازی بسه بچه جون!</h1> | |
| <p class="text-xl text-gray-300 mb-8">برو بعداً بیا !!</p> | |
| <div class="text-sm text-gray-500 mt-10">سیستم حفاظتی هوشمند فعال است</div> | |
| </div> | |
| </div> | |
| <!-- ناحیه مخفی برای باز کردن تنظیمات (3 بار کلیک در گوشه پایین راست) --> | |
| <div id="settings-trigger"></div> | |
| <!-- پنل تنظیمات مدیر --> | |
| <div id="settings-panel"> | |
| <h3 class="text-lg font-bold mb-4 text-yellow-400">⚙️ تنظیمات ادمین (فوق سری)</h3> | |
| <div class="mb-4"> | |
| <label class="block text-sm mb-1">مدت زمان مجاز (دقیقه):</label> | |
| <input type="number" id="time-input" value="60" class="bg-slate-800 border border-slate-600 rounded p-2 w-full text-white"> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm mb-1">رمز عبور:</label> | |
| <input type="password" id="admin-pass" placeholder="****" class="bg-slate-800 border border-slate-600 rounded p-2 w-full text-white"> | |
| </div> | |
| <div class="flex gap-2"> | |
| <button onclick="saveSettings()" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded text-sm flex-1">ذخیره و ریست</button> | |
| <button onclick="closeSettings()" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded text-sm">بستن</button> | |
| </div> | |
| <p class="text-xs text-gray-500 mt-2 text-center">نسخه الگوریتم: v2.4.0-AI</p> | |
| </div> | |
| <script> | |
| // --- تنظیمات اولیه و متغیرها --- | |
| const GAME_URL = "https://www.crazygames.com/game/tank-stars-online"; | |
| const STORAGE_KEY_START = 'tank_stars_session_start'; | |
| const STORAGE_KEY_DURATION = 'tank_stars_duration_min'; | |
| const ADMIN_PASSWORD = "1234"; // رمز پیشفرض | |
| let sessionStart = null; | |
| let allowedDurationMin = 60; | |
| let timerInterval = null; | |
| // المانهای DOM | |
| const gameFrame = document.getElementById('game-frame'); | |
| const lockOverlay = document.getElementById('lock-overlay'); | |
| const timerDisplay = document.getElementById('timer-display'); | |
| const settingsPanel = document.getElementById('settings-panel'); | |
| const settingsTrigger = document.getElementById('settings-trigger'); | |
| // --- منطق اصلی برنامه --- | |
| function init() { | |
| // بارگذاری تنظیمات از حافظه مرورگر | |
| const savedDuration = localStorage.getItem(STORAGE_KEY_DURATION); | |
| if (savedDuration) { | |
| allowedDurationMin = parseInt(savedDuration); | |
| } | |
| // بررسی شروع سشن | |
| sessionStart = localStorage.getItem(STORAGE_KEY_START); | |
| if (!sessionStart) { | |
| // اگر اولین بار است، زمان فعلی را ثبت کن | |
| sessionStart = new Date().getTime(); | |
| localStorage.setItem(STORAGE_KEY_START, sessionStart); | |
| } else { | |
| sessionStart = parseInt(sessionStart); | |
| } | |
| // بارگذاری بازی | |
| loadGame(); | |
| // شروع چرخه بررسی زمان | |
| startMonitoring(); | |
| } | |
| function loadGame() { | |
| // اضافه کردن پارامتر برای جلوگیری از کش یا صرفاً لود کردن لینک | |
| gameFrame.src = GAME_URL; | |
| } | |
| function startMonitoring() { | |
| timerInterval = setInterval(() => { | |
| const now = new Date().getTime(); | |
| const elapsedMs = now - sessionStart; | |
| const allowedMs = allowedDurationMin * 60 * 1000; | |
| const remainingMs = allowedMs - elapsedMs; | |
| if (remainingMs <= 0) { | |
| triggerLockout(); | |
| } else { | |
| updateTimerUI(remainingMs); | |
| } | |
| }, 1000); | |
| } | |
| function updateTimerUI(ms) { | |
| const totalSeconds = Math.floor(ms / 1000); | |
| const hours = Math.floor(totalSeconds / 3600); | |
| const minutes = Math.floor((totalSeconds % 3600) / 60); | |
| const seconds = totalSeconds % 60; | |
| timerDisplay.innerText = | |
| `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`; | |
| // تغییر رنگ در دقایق آخر | |
| if (minutes < 5) { | |
| timerDisplay.style.color = '#ff0000'; | |
| timerDisplay.style.borderColor = '#ff0000'; | |
| } | |
| } | |
| function triggerLockout() { | |
| clearInterval(timerInterval); | |
| // قطع اتصال بازی (تغییر سورس به بلنک برای اطمینان از قطع شدن سوکتها) | |
| gameFrame.src = "about:blank"; | |
| // نمایش پیام | |
| lockOverlay.classList.add('active'); | |
| timerDisplay.classList.add('hidden'); | |
| // پخش صدای بیپ (اختیاری - ممکن است توسط مرورگر بلاک شود اگر تعامل نباشد) | |
| // اینجا فقط ویژوال کار میکنیم | |
| } | |
| // --- سیستم تنظیمات مخفی (Admin) --- | |
| let clickCount = 0; | |
| let clickTimer = null; | |
| // رویداد کلیک مخفی در گوشه صفحه | |
| document.addEventListener('click', (e) => { | |
| // بررسی اینکه کلیک در 50 پیکسل پایین سمت راست باشد | |
| if (e.clientX > window.innerWidth - 50 && e.clientY > window.innerHeight - 50) { | |
| clickCount++; | |
| if (clickTimer) clearTimeout(clickTimer); | |
| clickTimer = setTimeout(() => { | |
| clickCount = 0; | |
| }, 1000); | |
| if (clickCount === 3) { | |
| openSettings(); | |
| clickCount = 0; | |
| } | |
| } | |
| }); | |
| function openSettings() { | |
| settingsPanel.style.display = 'block'; | |
| document.getElementById('time-input').value = allowedDurationMin; | |
| } | |
| function closeSettings() { | |
| settingsPanel.style.display = 'none'; | |
| document.getElementById('admin-pass').value = ''; | |
| } | |
| function saveSettings() { | |
| const pass = document.getElementById('admin-pass').value; | |
| const newTime = document.getElementById('time-input').value; | |
| if (pass === ADMIN_PASSWORD) { | |
| // ذخیره تنظیمات جدید | |
| localStorage.setItem(STORAGE_KEY_DURATION, newTime); | |
| // ریست کردن تایمر سشن برای تست مجدد | |
| localStorage.removeItem(STORAGE_KEY_START); | |
| alert('تنظیمات اعمال شد. صفحه ریلود میشود.'); | |
| location.reload(); | |
| } else { | |
| alert('رمز عبور اشتباه است! 🚫'); | |
| // افکت لرزش برای خطا | |
| settingsPanel.style.transform = "translateX(10px)"; | |
| setTimeout(() => settingsPanel.style.transform = "translateX(0)", 100); | |
| setTimeout(() => settingsPanel.style.transform = "translateX(-10px)", 200); | |
| setTimeout(() => settingsPanel.style.transform = "translateX(0)", 300); | |
| } | |
| } | |
| // راهاندازی | |
| window.onload = init; | |
| </script> | |
| </body> | |
| </html> | |