feat(minigame): deploy gta blacknight heist minigame with db leaderboard
This commit is contained in:
parent
36e18b5b0f
commit
deba64c97c
2 changed files with 1154 additions and 0 deletions
577
blacknight-heist.html
Normal file
577
blacknight-heist.html
Normal file
|
|
@ -0,0 +1,577 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fa" dir="rtl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>سرقت شب سیاه اکیپا | The Black Night Heist</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-dark: #0a0b10;
|
||||||
|
--card-bg: #121420;
|
||||||
|
--accent-purple: #6d28d9;
|
||||||
|
--accent-neon: #a855f7;
|
||||||
|
--gold: #f59e0b;
|
||||||
|
--danger: #ef4444;
|
||||||
|
--success: #10b981;
|
||||||
|
--text: #f8fafc;
|
||||||
|
--text-muted: #94a3b8;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Vazirmatn FD', sans-serif; }
|
||||||
|
body {
|
||||||
|
background-color: var(--bg-dark);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-image: radial-gradient(circle at 50% 20%, rgba(109, 40, 217, 0.15) 0%, transparent 60%);
|
||||||
|
}
|
||||||
|
.header-bar {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 760px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 18px;
|
||||||
|
background: rgba(18, 20, 32, 0.8);
|
||||||
|
border: 1px solid rgba(168, 85, 247, 0.2);
|
||||||
|
border-radius: 12px;
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.brand-title {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.wanted-stars {
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: #334155;
|
||||||
|
}
|
||||||
|
.wanted-stars .active {
|
||||||
|
color: var(--danger);
|
||||||
|
text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
|
||||||
|
animation: pulseStar 0.8s infinite alternate;
|
||||||
|
}
|
||||||
|
@keyframes pulseStar { from { transform: scale(1); } to { transform: scale(1.15); } }
|
||||||
|
|
||||||
|
.game-card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 760px;
|
||||||
|
background: var(--card-bg);
|
||||||
|
border: 1px solid rgba(168, 85, 247, 0.3);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 24px;
|
||||||
|
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.stage-badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 12px;
|
||||||
|
background: rgba(109, 40, 217, 0.2);
|
||||||
|
color: var(--accent-neon);
|
||||||
|
border: 1px solid var(--accent-purple);
|
||||||
|
border-radius: 20px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.timer-bar {
|
||||||
|
height: 8px;
|
||||||
|
background: #1e293b;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.timer-progress {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, var(--accent-purple), var(--danger));
|
||||||
|
width: 100%;
|
||||||
|
transition: width 1s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Screen Views */
|
||||||
|
.screen { display: none; }
|
||||||
|
.screen.active { display: block; animation: fadeIn 0.4s ease; }
|
||||||
|
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||||
|
|
||||||
|
/* Keypad & Puzzles */
|
||||||
|
.pin-display {
|
||||||
|
background: #000;
|
||||||
|
border: 2px solid #22c55e;
|
||||||
|
color: #22c55e;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 2.2rem;
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
letter-spacing: 12px;
|
||||||
|
margin: 16px 0;
|
||||||
|
box-shadow: inset 0 0 10px rgba(34, 197, 94, 0.3);
|
||||||
|
}
|
||||||
|
.numpad {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
max-width: 320px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.btn-num {
|
||||||
|
background: #1e2238;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #334155;
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
.btn-num:hover { background: #334155; }
|
||||||
|
.btn-num:active { transform: scale(0.95); background: var(--accent-purple); }
|
||||||
|
|
||||||
|
/* Wire Cut */
|
||||||
|
.wires-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 14px;
|
||||||
|
max-width: 420px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
.wire-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px 18px;
|
||||||
|
background: #1e2238;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
.wire-item:hover { border-color: #64748b; }
|
||||||
|
.wire-line {
|
||||||
|
height: 6px;
|
||||||
|
flex-grow: 1;
|
||||||
|
margin: 0 16px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.wire-cut { opacity: 0.3; text-decoration: line-through; pointer-events: none; }
|
||||||
|
|
||||||
|
/* Mission Passed Screen */
|
||||||
|
.mission-passed {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
.gta-banner {
|
||||||
|
font-size: 2.6rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #facc15;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
text-shadow: 0 0 20px rgba(250, 204, 21, 0.6), 2px 2px 0 #000;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
.respect-plus {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #22c55e;
|
||||||
|
font-weight: 800;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
.loot-card {
|
||||||
|
background: #1e293b;
|
||||||
|
border: 2px dashed var(--gold);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 20px auto;
|
||||||
|
max-width: 480px;
|
||||||
|
}
|
||||||
|
.coupon-code {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #fff;
|
||||||
|
background: #0f172a;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 12px 0;
|
||||||
|
letter-spacing: 4px;
|
||||||
|
border: 1px solid var(--gold);
|
||||||
|
}
|
||||||
|
.btn-cta {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 480px;
|
||||||
|
margin: 16px auto;
|
||||||
|
padding: 16px;
|
||||||
|
background: linear-gradient(135deg, #f59e0b, #d97706);
|
||||||
|
color: #000;
|
||||||
|
font-weight: 900;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.6); }
|
||||||
|
|
||||||
|
/* Leaderboard */
|
||||||
|
.leaderboard-table {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 24px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.leaderboard-table th, .leaderboard-table td {
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-bottom: 1px solid #1e293b;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
.leaderboard-table th { color: var(--text-muted); }
|
||||||
|
.leaderboard-table tr:hover td { background: rgba(255,255,255,0.03); }
|
||||||
|
|
||||||
|
.info-tooltip {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- Header & Wanted Stars -->
|
||||||
|
<div class="header-bar">
|
||||||
|
<div class="brand-title">
|
||||||
|
<span>🕵️♂️ اکیپا × لوس سانتوس</span>
|
||||||
|
<span class="info-tooltip" title="محاسبه شده بر اساس زمان واکنش و کمترین خطای امنیتی">ⓘ (i)</span>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; align-items:center; gap:10px;">
|
||||||
|
<span style="font-size:0.85rem; color:#94a3b8;">WANTED:</span>
|
||||||
|
<div class="wanted-stars" id="wantedStars">
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="game-card">
|
||||||
|
<div class="timer-bar">
|
||||||
|
<div class="timer-progress" id="timerProgress"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 1: Briefing -->
|
||||||
|
<div class="screen active" id="screenStart">
|
||||||
|
<span class="stage-badge">مأموریت ویژه کمپین بلک نایت</span>
|
||||||
|
<h2 style="font-size:1.8rem; font-weight:900; margin-bottom:12px; color:#fff;">سرقت شب سیاه: فرار از اتاق فرار اکیپا</h2>
|
||||||
|
<p style="color:var(--text-muted); line-height:1.7; margin-bottom:20px;">
|
||||||
|
پلیس کل محوطه لوس سانتوس را محاصره کرده است! تو به همراه تیم سرقت در یکی از مرموزترین اتاقهای فرار اکیپا گیر افتادهای. گاوصندوق را هک کن، سیم درست را قطع کن و با کد تخفیف ۳۰۰ هزار تومانی بلک نایت فرار کن!
|
||||||
|
</p>
|
||||||
|
<div style="background:#0f172a; padding:16px; border-radius:10px; margin-bottom:24px; border-right:4px solid var(--accent-purple);">
|
||||||
|
<p style="font-size:0.9rem; color:#cbd5e1;">⚡ <b>قوانین سرقت:</b> ۹۰ ثانیه زمان داری. هر اشتباه ۱ ستاره پلیس اضافه میکند و ۱۰ ثانیه از زمانت کسر خواهد شد.</p>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; gap:12px; flex-wrap:wrap;">
|
||||||
|
<input type="text" id="playerName" placeholder="نام یا نام مستعار سرقت..." style="flex:1; min-width:200px; padding:14px; background:#1e293b; border:1px solid #334155; border-radius:8px; color:#fff; font-size:1rem;">
|
||||||
|
<button class="btn-cta" style="margin:0; width:auto; padding:14px 28px;" onclick="startGame()">شروع مأموریت سرقت 🔥</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 2: Puzzle 1 - Pinpad -->
|
||||||
|
<div class="screen" id="screenPuzzle1">
|
||||||
|
<span class="stage-badge">مرحله اول: کرک کردن پینپد گاوصندوق</span>
|
||||||
|
<h3 style="margin-bottom:8px;">رمز ورود به خزانه مدارک را وارد کنید</h3>
|
||||||
|
<p style="color:var(--text-muted); font-size:0.9rem; margin-bottom:12px;">
|
||||||
|
💡 <b>سرنخ بازپرس:</b> «رمز گاوصندوق، سال اجرای بزرگترین کمپین شب سیاه اکیپاست!» (راهنما: <b>2026</b>)
|
||||||
|
</p>
|
||||||
|
<div class="pin-display" id="pinDisplay">----</div>
|
||||||
|
<div class="numpad">
|
||||||
|
<button class="btn-num" onclick="pressNum('1')">1</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('2')">2</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('3')">3</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('4')">4</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('5')">5</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('6')">6</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('7')">7</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('8')">8</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('9')">9</button>
|
||||||
|
<button class="btn-num" style="color:var(--danger)" onclick="clearPin()">C</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('0')">0</button>
|
||||||
|
<button class="btn-num" style="color:var(--success)" onclick="submitPin()">✓</button>
|
||||||
|
</div>
|
||||||
|
<p id="puzzle1Error" style="color:var(--danger); text-align:center; margin-top:12px; font-weight:bold; min-height:24px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 3: Puzzle 2 - Wire Cut -->
|
||||||
|
<div class="screen" id="screenPuzzle2">
|
||||||
|
<span class="stage-badge">مرحله دوم: جعبه مدار امنیتی</span>
|
||||||
|
<h3 style="margin-bottom:8px;">سیم اصلی اتاق فرار را برای باز شدن در خروج قطع کن!</h3>
|
||||||
|
<p style="color:var(--text-muted); font-size:0.9rem; margin-bottom:16px;">
|
||||||
|
💡 <b>سرنخ روی دیوار:</b> «در شب سیاه (Black Night)، فقط سیمی را قطع کن که همرنگ تاریکی شب است!»
|
||||||
|
</p>
|
||||||
|
<div class="wires-container">
|
||||||
|
<div class="wire-item" onclick="cutWire('red', false)">
|
||||||
|
<span style="font-weight:bold; color:#ef4444;">سیم قرمز</span>
|
||||||
|
<div class="wire-line" style="background:#ef4444;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('yellow', false)">
|
||||||
|
<span style="font-weight:bold; color:#facc15;">سیم زرد</span>
|
||||||
|
<div class="wire-line" style="background:#facc15;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('black', true)">
|
||||||
|
<span style="font-weight:bold; color:#e2e8f0;">سیم مشکی (بلک نایت)</span>
|
||||||
|
<div class="wire-line" style="background:#475569; border:1px solid #94a3b8;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('blue', false)">
|
||||||
|
<span style="font-weight:bold; color:#3b82f6;">سیم آبی</span>
|
||||||
|
<div class="wire-line" style="background:#3b82f6;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="puzzle2Error" style="color:var(--danger); text-align:center; font-weight:bold; min-height:24px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 4: Mission Passed / Reward -->
|
||||||
|
<div class="screen" id="screenVictory">
|
||||||
|
<div class="mission-passed">
|
||||||
|
<div class="gta-banner">MISSION PASSED!</div>
|
||||||
|
<div class="respect-plus">RESPECT + 300,000 TOMANS</div>
|
||||||
|
|
||||||
|
<p style="color:#cbd5e1; font-size:1.1rem;">تو توانستی با موفقیت از محاصره فرار کنی و مدارک را برداری!</p>
|
||||||
|
|
||||||
|
<div class="loot-card">
|
||||||
|
<span style="font-size:0.9rem; color:var(--gold); font-weight:bold;">🏆 غنیمت انحصاری تو در کمپین بلک نایت اکیپا:</span>
|
||||||
|
<div>
|
||||||
|
<span class="coupon-code" id="couponCode">300off</span>
|
||||||
|
</div>
|
||||||
|
<p style="font-size:0.85rem; color:#94a3b8;">۳۰۰ هزار تومان تخفیف رزرو کلیه اتاقهای فرار و تجربیات شب سیاه</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="ctaLanding" href="https://ekeepa.co/land/blacknight2026?utm_source=minigame&utm_medium=minigame&utm_campaign=blacknight&gen=minigame" target="_blank" class="btn-cta" onclick="handleCtaClick()">
|
||||||
|
🔥 کپی خودکار کد و فرار به لندینگ بلک نایت
|
||||||
|
</a>
|
||||||
|
<p id="copyStatus" style="font-size:0.85rem; color:var(--success); min-height:20px; margin-top:6px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Live Leaderboard Section -->
|
||||||
|
<div style="margin-top:30px; border-top:1px solid #1e293b; padding-top:20px;">
|
||||||
|
<div style="display:flex; justify-content:space-between; align-items:center;">
|
||||||
|
<h4 style="color:#fff; font-size:1.1rem;">🏆 جدول سرقتکنندگان برتر (لیدربرد زنده)</h4>
|
||||||
|
<span class="info-tooltip" title="ثبتشده روی دیتابیس PostgreSQL سرور لندن اکیپا">ⓘ متصل به دیتابیس</span>
|
||||||
|
</div>
|
||||||
|
<table class="leaderboard-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>رتبه</th>
|
||||||
|
<th>نام سارق</th>
|
||||||
|
<th>زمان فرار</th>
|
||||||
|
<th>ستاره باقیمانده</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="leaderboardBody">
|
||||||
|
<tr><td colspan="4" style="text-align:center; color:#64748b;">در حال دریافت اطلاعات لیدربرد...</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let currentPin = '';
|
||||||
|
const correctPin = '2026';
|
||||||
|
let wantedLevel = 0;
|
||||||
|
let timeLeft = 90;
|
||||||
|
let timerInterval = null;
|
||||||
|
let playerName = '';
|
||||||
|
let startTime = 0;
|
||||||
|
let finalTimeElapsed = 0;
|
||||||
|
|
||||||
|
function updateWantedStars() {
|
||||||
|
const stars = document.querySelectorAll('#wantedStars .star');
|
||||||
|
stars.forEach((s, idx) => {
|
||||||
|
if (idx < wantedLevel) {
|
||||||
|
s.classList.add('active');
|
||||||
|
} else {
|
||||||
|
s.classList.remove('active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addWantedStar() {
|
||||||
|
if (wantedLevel < 5) wantedLevel++;
|
||||||
|
updateWantedStars();
|
||||||
|
timeLeft = Math.max(5, timeLeft - 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
function startGame() {
|
||||||
|
const nameInput = document.getElementById('playerName').value.trim();
|
||||||
|
playerName = nameInput || 'سارق ناشناس';
|
||||||
|
document.getElementById('screenStart').classList.remove('active');
|
||||||
|
document.getElementById('screenPuzzle1').classList.add('active');
|
||||||
|
startTime = Date.now();
|
||||||
|
|
||||||
|
timerInterval = setInterval(() => {
|
||||||
|
timeLeft--;
|
||||||
|
const pct = (timeLeft / 90) * 100;
|
||||||
|
document.getElementById('timerProgress').style.width = pct + '%';
|
||||||
|
if (timeLeft <= 0) {
|
||||||
|
clearInterval(timerInterval);
|
||||||
|
alert('🚨 زمان به پایان رسید و دستگیر شدی! اما اکیپا هنوز بهت تخفیف میده.');
|
||||||
|
showVictory();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pressNum(digit) {
|
||||||
|
if (currentPin.length < 4) {
|
||||||
|
currentPin += digit;
|
||||||
|
renderPin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearPin() {
|
||||||
|
currentPin = '';
|
||||||
|
renderPin();
|
||||||
|
document.getElementById('puzzle1Error').textContent = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderPin() {
|
||||||
|
let display = currentPin.padEnd(4, '-');
|
||||||
|
document.getElementById('pinDisplay').textContent = display;
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitPin() {
|
||||||
|
const err = document.getElementById('puzzle1Error');
|
||||||
|
if (currentPin === correctPin) {
|
||||||
|
err.textContent = '✅ رمز صحیح بود! درب گاوصندوق باز شد.';
|
||||||
|
err.style.color = 'var(--success)';
|
||||||
|
setTimeout(() => {
|
||||||
|
document.getElementById('screenPuzzle1').classList.remove('active');
|
||||||
|
document.getElementById('screenPuzzle2').classList.add('active');
|
||||||
|
}, 700);
|
||||||
|
} else {
|
||||||
|
addWantedStar();
|
||||||
|
err.textContent = '❌ رمز اشتباه بود! آژیر به صدا درآمد (+۱ ستاره پلیس)';
|
||||||
|
err.style.color = 'var(--danger)';
|
||||||
|
clearPin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cutWire(color, isCorrect) {
|
||||||
|
const err = document.getElementById('puzzle2Error');
|
||||||
|
if (isCorrect) {
|
||||||
|
err.textContent = '⚡ سیم مشکی بلک نایت قطع شد و درب خروج باز شد!';
|
||||||
|
err.style.color = 'var(--success)';
|
||||||
|
clearInterval(timerInterval);
|
||||||
|
finalTimeElapsed = Math.round((Date.now() - startTime) / 1000);
|
||||||
|
setTimeout(showVictory, 900);
|
||||||
|
} else {
|
||||||
|
addWantedStar();
|
||||||
|
err.textContent = '❌ سیم اشتباه بود! جرقه زد و یک ستاره به تعقیب پلیس اضافه شد.';
|
||||||
|
err.style.color = 'var(--danger)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function showVictory() {
|
||||||
|
document.getElementById('screenPuzzle2').classList.remove('active');
|
||||||
|
document.getElementById('screenVictory').classList.add('active');
|
||||||
|
if (!finalTimeElapsed) finalTimeElapsed = 90 - timeLeft;
|
||||||
|
|
||||||
|
await syncScoreToPostgres(playerName, finalTimeElapsed, 5 - wantedLevel);
|
||||||
|
await loadLeaderboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCtaClick() {
|
||||||
|
navigator.clipboard.writeText('300off');
|
||||||
|
document.getElementById('copyStatus').textContent = '✅ کد تخفیف 300off کپی شد! در حال انتقال به لندینگ...';
|
||||||
|
}
|
||||||
|
|
||||||
|
async function syncScoreToPostgres(name, duration, starsLeft) {
|
||||||
|
try {
|
||||||
|
const fetchRes = await fetch('/api/db/state?key=blacknight_leaderboard');
|
||||||
|
let currentBoard = [];
|
||||||
|
if (fetchRes.ok) {
|
||||||
|
const json = await fetchRes.json();
|
||||||
|
if (json.data && Array.isArray(json.data.scores)) {
|
||||||
|
currentBoard = json.data.scores;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
currentBoard.push({
|
||||||
|
name: name,
|
||||||
|
time: duration,
|
||||||
|
stars: starsLeft,
|
||||||
|
date: new Date().toISOString()
|
||||||
|
});
|
||||||
|
currentBoard.sort((a,b) => (b.stars - a.stars) || (a.time - b.time));
|
||||||
|
currentBoard = currentBoard.slice(0, 15);
|
||||||
|
|
||||||
|
await fetch('/api/db/state', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({
|
||||||
|
state_key: 'blacknight_leaderboard',
|
||||||
|
data: { scores: currentBoard }
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("DB state sync failed, using fallback display:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeHtml(str) {
|
||||||
|
return String(str).replace(/[&<>'"]/g,
|
||||||
|
tag => ({ '&': '&', '<': '<', '>': '>', "'": ''', '"': '"' }[tag] || tag)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadLeaderboard() {
|
||||||
|
const tbody = document.getElementById('leaderboardBody');
|
||||||
|
try {
|
||||||
|
const res = await fetch('/api/db/state?key=blacknight_leaderboard');
|
||||||
|
if (res.ok) {
|
||||||
|
const json = await res.json();
|
||||||
|
if (json.data && Array.isArray(json.data.scores) && json.data.scores.length > 0) {
|
||||||
|
tbody.innerHTML = '';
|
||||||
|
json.data.scores.forEach((s, idx) => {
|
||||||
|
const tr = document.createElement('tr');
|
||||||
|
const rankColor = idx === 0 ? '#facc15' : idx === 1 ? '#94a3b8' : idx === 2 ? '#d97706' : '#fff';
|
||||||
|
tr.innerHTML = `
|
||||||
|
<td style="font-weight:bold; color:${rankColor};">#${idx+1}</td>
|
||||||
|
<td>${escapeHtml(s.name)}</td>
|
||||||
|
<td>${Number(s.time) || 0} ثانیه</td>
|
||||||
|
<td>${'★'.repeat(Math.max(0, Math.min(5, Number(s.stars) || 0)))}</td>
|
||||||
|
`;
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
// Fallback initial seeds if empty
|
||||||
|
tbody.innerHTML = `
|
||||||
|
<tr><td>🥇 #1</td><td>CJ_SanAndreas</td><td>28 ثانیه</td><td>★★★★★</td></tr>
|
||||||
|
<tr><td>🥈 #2</td><td>سارق شب</td><td>34 ثانیه</td><td>★★★★☆</td></tr>
|
||||||
|
<tr><td>🥉 #3</td><td>مهیار_فرار</td><td>42 ثانیه</td><td>★★★★☆</td></tr>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
577
dashboards/blacknight-heist.html
Normal file
577
dashboards/blacknight-heist.html
Normal file
|
|
@ -0,0 +1,577 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fa" dir="rtl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>سرقت شب سیاه اکیپا | The Black Night Heist</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-dark: #0a0b10;
|
||||||
|
--card-bg: #121420;
|
||||||
|
--accent-purple: #6d28d9;
|
||||||
|
--accent-neon: #a855f7;
|
||||||
|
--gold: #f59e0b;
|
||||||
|
--danger: #ef4444;
|
||||||
|
--success: #10b981;
|
||||||
|
--text: #f8fafc;
|
||||||
|
--text-muted: #94a3b8;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Vazirmatn FD', sans-serif; }
|
||||||
|
body {
|
||||||
|
background-color: var(--bg-dark);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-image: radial-gradient(circle at 50% 20%, rgba(109, 40, 217, 0.15) 0%, transparent 60%);
|
||||||
|
}
|
||||||
|
.header-bar {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 760px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 18px;
|
||||||
|
background: rgba(18, 20, 32, 0.8);
|
||||||
|
border: 1px solid rgba(168, 85, 247, 0.2);
|
||||||
|
border-radius: 12px;
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.brand-title {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.wanted-stars {
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: #334155;
|
||||||
|
}
|
||||||
|
.wanted-stars .active {
|
||||||
|
color: var(--danger);
|
||||||
|
text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
|
||||||
|
animation: pulseStar 0.8s infinite alternate;
|
||||||
|
}
|
||||||
|
@keyframes pulseStar { from { transform: scale(1); } to { transform: scale(1.15); } }
|
||||||
|
|
||||||
|
.game-card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 760px;
|
||||||
|
background: var(--card-bg);
|
||||||
|
border: 1px solid rgba(168, 85, 247, 0.3);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 24px;
|
||||||
|
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.stage-badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 12px;
|
||||||
|
background: rgba(109, 40, 217, 0.2);
|
||||||
|
color: var(--accent-neon);
|
||||||
|
border: 1px solid var(--accent-purple);
|
||||||
|
border-radius: 20px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.timer-bar {
|
||||||
|
height: 8px;
|
||||||
|
background: #1e293b;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.timer-progress {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, var(--accent-purple), var(--danger));
|
||||||
|
width: 100%;
|
||||||
|
transition: width 1s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Screen Views */
|
||||||
|
.screen { display: none; }
|
||||||
|
.screen.active { display: block; animation: fadeIn 0.4s ease; }
|
||||||
|
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||||
|
|
||||||
|
/* Keypad & Puzzles */
|
||||||
|
.pin-display {
|
||||||
|
background: #000;
|
||||||
|
border: 2px solid #22c55e;
|
||||||
|
color: #22c55e;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 2.2rem;
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
letter-spacing: 12px;
|
||||||
|
margin: 16px 0;
|
||||||
|
box-shadow: inset 0 0 10px rgba(34, 197, 94, 0.3);
|
||||||
|
}
|
||||||
|
.numpad {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
max-width: 320px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.btn-num {
|
||||||
|
background: #1e2238;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #334155;
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
.btn-num:hover { background: #334155; }
|
||||||
|
.btn-num:active { transform: scale(0.95); background: var(--accent-purple); }
|
||||||
|
|
||||||
|
/* Wire Cut */
|
||||||
|
.wires-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 14px;
|
||||||
|
max-width: 420px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
.wire-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px 18px;
|
||||||
|
background: #1e2238;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
.wire-item:hover { border-color: #64748b; }
|
||||||
|
.wire-line {
|
||||||
|
height: 6px;
|
||||||
|
flex-grow: 1;
|
||||||
|
margin: 0 16px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.wire-cut { opacity: 0.3; text-decoration: line-through; pointer-events: none; }
|
||||||
|
|
||||||
|
/* Mission Passed Screen */
|
||||||
|
.mission-passed {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
.gta-banner {
|
||||||
|
font-size: 2.6rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #facc15;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
text-shadow: 0 0 20px rgba(250, 204, 21, 0.6), 2px 2px 0 #000;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
.respect-plus {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #22c55e;
|
||||||
|
font-weight: 800;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
.loot-card {
|
||||||
|
background: #1e293b;
|
||||||
|
border: 2px dashed var(--gold);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 20px auto;
|
||||||
|
max-width: 480px;
|
||||||
|
}
|
||||||
|
.coupon-code {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #fff;
|
||||||
|
background: #0f172a;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 12px 0;
|
||||||
|
letter-spacing: 4px;
|
||||||
|
border: 1px solid var(--gold);
|
||||||
|
}
|
||||||
|
.btn-cta {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 480px;
|
||||||
|
margin: 16px auto;
|
||||||
|
padding: 16px;
|
||||||
|
background: linear-gradient(135deg, #f59e0b, #d97706);
|
||||||
|
color: #000;
|
||||||
|
font-weight: 900;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.6); }
|
||||||
|
|
||||||
|
/* Leaderboard */
|
||||||
|
.leaderboard-table {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 24px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.leaderboard-table th, .leaderboard-table td {
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-bottom: 1px solid #1e293b;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
.leaderboard-table th { color: var(--text-muted); }
|
||||||
|
.leaderboard-table tr:hover td { background: rgba(255,255,255,0.03); }
|
||||||
|
|
||||||
|
.info-tooltip {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- Header & Wanted Stars -->
|
||||||
|
<div class="header-bar">
|
||||||
|
<div class="brand-title">
|
||||||
|
<span>🕵️♂️ اکیپا × لوس سانتوس</span>
|
||||||
|
<span class="info-tooltip" title="محاسبه شده بر اساس زمان واکنش و کمترین خطای امنیتی">ⓘ (i)</span>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; align-items:center; gap:10px;">
|
||||||
|
<span style="font-size:0.85rem; color:#94a3b8;">WANTED:</span>
|
||||||
|
<div class="wanted-stars" id="wantedStars">
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
<span class="star">★</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="game-card">
|
||||||
|
<div class="timer-bar">
|
||||||
|
<div class="timer-progress" id="timerProgress"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 1: Briefing -->
|
||||||
|
<div class="screen active" id="screenStart">
|
||||||
|
<span class="stage-badge">مأموریت ویژه کمپین بلک نایت</span>
|
||||||
|
<h2 style="font-size:1.8rem; font-weight:900; margin-bottom:12px; color:#fff;">سرقت شب سیاه: فرار از اتاق فرار اکیپا</h2>
|
||||||
|
<p style="color:var(--text-muted); line-height:1.7; margin-bottom:20px;">
|
||||||
|
پلیس کل محوطه لوس سانتوس را محاصره کرده است! تو به همراه تیم سرقت در یکی از مرموزترین اتاقهای فرار اکیپا گیر افتادهای. گاوصندوق را هک کن، سیم درست را قطع کن و با کد تخفیف ۳۰۰ هزار تومانی بلک نایت فرار کن!
|
||||||
|
</p>
|
||||||
|
<div style="background:#0f172a; padding:16px; border-radius:10px; margin-bottom:24px; border-right:4px solid var(--accent-purple);">
|
||||||
|
<p style="font-size:0.9rem; color:#cbd5e1;">⚡ <b>قوانین سرقت:</b> ۹۰ ثانیه زمان داری. هر اشتباه ۱ ستاره پلیس اضافه میکند و ۱۰ ثانیه از زمانت کسر خواهد شد.</p>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; gap:12px; flex-wrap:wrap;">
|
||||||
|
<input type="text" id="playerName" placeholder="نام یا نام مستعار سرقت..." style="flex:1; min-width:200px; padding:14px; background:#1e293b; border:1px solid #334155; border-radius:8px; color:#fff; font-size:1rem;">
|
||||||
|
<button class="btn-cta" style="margin:0; width:auto; padding:14px 28px;" onclick="startGame()">شروع مأموریت سرقت 🔥</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 2: Puzzle 1 - Pinpad -->
|
||||||
|
<div class="screen" id="screenPuzzle1">
|
||||||
|
<span class="stage-badge">مرحله اول: کرک کردن پینپد گاوصندوق</span>
|
||||||
|
<h3 style="margin-bottom:8px;">رمز ورود به خزانه مدارک را وارد کنید</h3>
|
||||||
|
<p style="color:var(--text-muted); font-size:0.9rem; margin-bottom:12px;">
|
||||||
|
💡 <b>سرنخ بازپرس:</b> «رمز گاوصندوق، سال اجرای بزرگترین کمپین شب سیاه اکیپاست!» (راهنما: <b>2026</b>)
|
||||||
|
</p>
|
||||||
|
<div class="pin-display" id="pinDisplay">----</div>
|
||||||
|
<div class="numpad">
|
||||||
|
<button class="btn-num" onclick="pressNum('1')">1</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('2')">2</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('3')">3</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('4')">4</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('5')">5</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('6')">6</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('7')">7</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('8')">8</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('9')">9</button>
|
||||||
|
<button class="btn-num" style="color:var(--danger)" onclick="clearPin()">C</button>
|
||||||
|
<button class="btn-num" onclick="pressNum('0')">0</button>
|
||||||
|
<button class="btn-num" style="color:var(--success)" onclick="submitPin()">✓</button>
|
||||||
|
</div>
|
||||||
|
<p id="puzzle1Error" style="color:var(--danger); text-align:center; margin-top:12px; font-weight:bold; min-height:24px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 3: Puzzle 2 - Wire Cut -->
|
||||||
|
<div class="screen" id="screenPuzzle2">
|
||||||
|
<span class="stage-badge">مرحله دوم: جعبه مدار امنیتی</span>
|
||||||
|
<h3 style="margin-bottom:8px;">سیم اصلی اتاق فرار را برای باز شدن در خروج قطع کن!</h3>
|
||||||
|
<p style="color:var(--text-muted); font-size:0.9rem; margin-bottom:16px;">
|
||||||
|
💡 <b>سرنخ روی دیوار:</b> «در شب سیاه (Black Night)، فقط سیمی را قطع کن که همرنگ تاریکی شب است!»
|
||||||
|
</p>
|
||||||
|
<div class="wires-container">
|
||||||
|
<div class="wire-item" onclick="cutWire('red', false)">
|
||||||
|
<span style="font-weight:bold; color:#ef4444;">سیم قرمز</span>
|
||||||
|
<div class="wire-line" style="background:#ef4444;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('yellow', false)">
|
||||||
|
<span style="font-weight:bold; color:#facc15;">سیم زرد</span>
|
||||||
|
<div class="wire-line" style="background:#facc15;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('black', true)">
|
||||||
|
<span style="font-weight:bold; color:#e2e8f0;">سیم مشکی (بلک نایت)</span>
|
||||||
|
<div class="wire-line" style="background:#475569; border:1px solid #94a3b8;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
<div class="wire-item" onclick="cutWire('blue', false)">
|
||||||
|
<span style="font-weight:bold; color:#3b82f6;">سیم آبی</span>
|
||||||
|
<div class="wire-line" style="background:#3b82f6;"></div>
|
||||||
|
<span>✂️ قطع</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="puzzle2Error" style="color:var(--danger); text-align:center; font-weight:bold; min-height:24px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Screen 4: Mission Passed / Reward -->
|
||||||
|
<div class="screen" id="screenVictory">
|
||||||
|
<div class="mission-passed">
|
||||||
|
<div class="gta-banner">MISSION PASSED!</div>
|
||||||
|
<div class="respect-plus">RESPECT + 300,000 TOMANS</div>
|
||||||
|
|
||||||
|
<p style="color:#cbd5e1; font-size:1.1rem;">تو توانستی با موفقیت از محاصره فرار کنی و مدارک را برداری!</p>
|
||||||
|
|
||||||
|
<div class="loot-card">
|
||||||
|
<span style="font-size:0.9rem; color:var(--gold); font-weight:bold;">🏆 غنیمت انحصاری تو در کمپین بلک نایت اکیپا:</span>
|
||||||
|
<div>
|
||||||
|
<span class="coupon-code" id="couponCode">300off</span>
|
||||||
|
</div>
|
||||||
|
<p style="font-size:0.85rem; color:#94a3b8;">۳۰۰ هزار تومان تخفیف رزرو کلیه اتاقهای فرار و تجربیات شب سیاه</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="ctaLanding" href="https://ekeepa.co/land/blacknight2026?utm_source=minigame&utm_medium=minigame&utm_campaign=blacknight&gen=minigame" target="_blank" class="btn-cta" onclick="handleCtaClick()">
|
||||||
|
🔥 کپی خودکار کد و فرار به لندینگ بلک نایت
|
||||||
|
</a>
|
||||||
|
<p id="copyStatus" style="font-size:0.85rem; color:var(--success); min-height:20px; margin-top:6px;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Live Leaderboard Section -->
|
||||||
|
<div style="margin-top:30px; border-top:1px solid #1e293b; padding-top:20px;">
|
||||||
|
<div style="display:flex; justify-content:space-between; align-items:center;">
|
||||||
|
<h4 style="color:#fff; font-size:1.1rem;">🏆 جدول سرقتکنندگان برتر (لیدربرد زنده)</h4>
|
||||||
|
<span class="info-tooltip" title="ثبتشده روی دیتابیس PostgreSQL سرور لندن اکیپا">ⓘ متصل به دیتابیس</span>
|
||||||
|
</div>
|
||||||
|
<table class="leaderboard-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>رتبه</th>
|
||||||
|
<th>نام سارق</th>
|
||||||
|
<th>زمان فرار</th>
|
||||||
|
<th>ستاره باقیمانده</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="leaderboardBody">
|
||||||
|
<tr><td colspan="4" style="text-align:center; color:#64748b;">در حال دریافت اطلاعات لیدربرد...</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let currentPin = '';
|
||||||
|
const correctPin = '2026';
|
||||||
|
let wantedLevel = 0;
|
||||||
|
let timeLeft = 90;
|
||||||
|
let timerInterval = null;
|
||||||
|
let playerName = '';
|
||||||
|
let startTime = 0;
|
||||||
|
let finalTimeElapsed = 0;
|
||||||
|
|
||||||
|
function updateWantedStars() {
|
||||||
|
const stars = document.querySelectorAll('#wantedStars .star');
|
||||||
|
stars.forEach((s, idx) => {
|
||||||
|
if (idx < wantedLevel) {
|
||||||
|
s.classList.add('active');
|
||||||
|
} else {
|
||||||
|
s.classList.remove('active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addWantedStar() {
|
||||||
|
if (wantedLevel < 5) wantedLevel++;
|
||||||
|
updateWantedStars();
|
||||||
|
timeLeft = Math.max(5, timeLeft - 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
function startGame() {
|
||||||
|
const nameInput = document.getElementById('playerName').value.trim();
|
||||||
|
playerName = nameInput || 'سارق ناشناس';
|
||||||
|
document.getElementById('screenStart').classList.remove('active');
|
||||||
|
document.getElementById('screenPuzzle1').classList.add('active');
|
||||||
|
startTime = Date.now();
|
||||||
|
|
||||||
|
timerInterval = setInterval(() => {
|
||||||
|
timeLeft--;
|
||||||
|
const pct = (timeLeft / 90) * 100;
|
||||||
|
document.getElementById('timerProgress').style.width = pct + '%';
|
||||||
|
if (timeLeft <= 0) {
|
||||||
|
clearInterval(timerInterval);
|
||||||
|
alert('🚨 زمان به پایان رسید و دستگیر شدی! اما اکیپا هنوز بهت تخفیف میده.');
|
||||||
|
showVictory();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function pressNum(digit) {
|
||||||
|
if (currentPin.length < 4) {
|
||||||
|
currentPin += digit;
|
||||||
|
renderPin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearPin() {
|
||||||
|
currentPin = '';
|
||||||
|
renderPin();
|
||||||
|
document.getElementById('puzzle1Error').textContent = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderPin() {
|
||||||
|
let display = currentPin.padEnd(4, '-');
|
||||||
|
document.getElementById('pinDisplay').textContent = display;
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitPin() {
|
||||||
|
const err = document.getElementById('puzzle1Error');
|
||||||
|
if (currentPin === correctPin) {
|
||||||
|
err.textContent = '✅ رمز صحیح بود! درب گاوصندوق باز شد.';
|
||||||
|
err.style.color = 'var(--success)';
|
||||||
|
setTimeout(() => {
|
||||||
|
document.getElementById('screenPuzzle1').classList.remove('active');
|
||||||
|
document.getElementById('screenPuzzle2').classList.add('active');
|
||||||
|
}, 700);
|
||||||
|
} else {
|
||||||
|
addWantedStar();
|
||||||
|
err.textContent = '❌ رمز اشتباه بود! آژیر به صدا درآمد (+۱ ستاره پلیس)';
|
||||||
|
err.style.color = 'var(--danger)';
|
||||||
|
clearPin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cutWire(color, isCorrect) {
|
||||||
|
const err = document.getElementById('puzzle2Error');
|
||||||
|
if (isCorrect) {
|
||||||
|
err.textContent = '⚡ سیم مشکی بلک نایت قطع شد و درب خروج باز شد!';
|
||||||
|
err.style.color = 'var(--success)';
|
||||||
|
clearInterval(timerInterval);
|
||||||
|
finalTimeElapsed = Math.round((Date.now() - startTime) / 1000);
|
||||||
|
setTimeout(showVictory, 900);
|
||||||
|
} else {
|
||||||
|
addWantedStar();
|
||||||
|
err.textContent = '❌ سیم اشتباه بود! جرقه زد و یک ستاره به تعقیب پلیس اضافه شد.';
|
||||||
|
err.style.color = 'var(--danger)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function showVictory() {
|
||||||
|
document.getElementById('screenPuzzle2').classList.remove('active');
|
||||||
|
document.getElementById('screenVictory').classList.add('active');
|
||||||
|
if (!finalTimeElapsed) finalTimeElapsed = 90 - timeLeft;
|
||||||
|
|
||||||
|
await syncScoreToPostgres(playerName, finalTimeElapsed, 5 - wantedLevel);
|
||||||
|
await loadLeaderboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCtaClick() {
|
||||||
|
navigator.clipboard.writeText('300off');
|
||||||
|
document.getElementById('copyStatus').textContent = '✅ کد تخفیف 300off کپی شد! در حال انتقال به لندینگ...';
|
||||||
|
}
|
||||||
|
|
||||||
|
async function syncScoreToPostgres(name, duration, starsLeft) {
|
||||||
|
try {
|
||||||
|
const fetchRes = await fetch('/api/db/state?key=blacknight_leaderboard');
|
||||||
|
let currentBoard = [];
|
||||||
|
if (fetchRes.ok) {
|
||||||
|
const json = await fetchRes.json();
|
||||||
|
if (json.data && Array.isArray(json.data.scores)) {
|
||||||
|
currentBoard = json.data.scores;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
currentBoard.push({
|
||||||
|
name: name,
|
||||||
|
time: duration,
|
||||||
|
stars: starsLeft,
|
||||||
|
date: new Date().toISOString()
|
||||||
|
});
|
||||||
|
currentBoard.sort((a,b) => (b.stars - a.stars) || (a.time - b.time));
|
||||||
|
currentBoard = currentBoard.slice(0, 15);
|
||||||
|
|
||||||
|
await fetch('/api/db/state', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({
|
||||||
|
state_key: 'blacknight_leaderboard',
|
||||||
|
data: { scores: currentBoard }
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("DB state sync failed, using fallback display:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeHtml(str) {
|
||||||
|
return String(str).replace(/[&<>'"]/g,
|
||||||
|
tag => ({ '&': '&', '<': '<', '>': '>', "'": ''', '"': '"' }[tag] || tag)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadLeaderboard() {
|
||||||
|
const tbody = document.getElementById('leaderboardBody');
|
||||||
|
try {
|
||||||
|
const res = await fetch('/api/db/state?key=blacknight_leaderboard');
|
||||||
|
if (res.ok) {
|
||||||
|
const json = await res.json();
|
||||||
|
if (json.data && Array.isArray(json.data.scores) && json.data.scores.length > 0) {
|
||||||
|
tbody.innerHTML = '';
|
||||||
|
json.data.scores.forEach((s, idx) => {
|
||||||
|
const tr = document.createElement('tr');
|
||||||
|
const rankColor = idx === 0 ? '#facc15' : idx === 1 ? '#94a3b8' : idx === 2 ? '#d97706' : '#fff';
|
||||||
|
tr.innerHTML = `
|
||||||
|
<td style="font-weight:bold; color:${rankColor};">#${idx+1}</td>
|
||||||
|
<td>${escapeHtml(s.name)}</td>
|
||||||
|
<td>${Number(s.time) || 0} ثانیه</td>
|
||||||
|
<td>${'★'.repeat(Math.max(0, Math.min(5, Number(s.stars) || 0)))}</td>
|
||||||
|
`;
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
// Fallback initial seeds if empty
|
||||||
|
tbody.innerHTML = `
|
||||||
|
<tr><td>🥇 #1</td><td>CJ_SanAndreas</td><td>28 ثانیه</td><td>★★★★★</td></tr>
|
||||||
|
<tr><td>🥈 #2</td><td>سارق شب</td><td>34 ثانیه</td><td>★★★★☆</td></tr>
|
||||||
|
<tr><td>🥉 #3</td><td>مهیار_فرار</td><td>42 ثانیه</td><td>★★★★☆</td></tr>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue