Spaces:
Running
Running
Manual changes saved
Browse files- index.html +195 -2
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
-
<title>BattleZone Royale-
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
<style>
|
|
@@ -24,6 +24,101 @@
|
|
| 24 |
.equipped { box-shadow: inset 0 -6px 14px rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.04); }
|
| 25 |
.medkit-count { position:absolute; right:4px; bottom:2px; font-size:10px; color:#ffd; }
|
| 26 |
.biome-selected { outline: 3px solid rgba(96,165,250,0.9); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
</style>
|
| 28 |
</head>
|
| 29 |
<body>
|
|
@@ -72,6 +167,33 @@
|
|
| 72 |
</div>
|
| 73 |
</div>
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
<!-- Game -->
|
| 76 |
<div id="gameScreen" class="hidden h-screen flex flex-col">
|
| 77 |
<header class="flex justify-between items-center border-b border-yellow-500 px-6 py-4" style="flex-shrink:0;">
|
|
@@ -159,6 +281,12 @@
|
|
| 159 |
const continueBtn = document.getElementById('continueBtn');
|
| 160 |
const biomeGrid = document.getElementById('biomeGrid');
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
// Minimap elements and cache
|
| 163 |
const minimapCanvas = document.getElementById('minimapCanvas');
|
| 164 |
const miniCtx = minimapCanvas.getContext('2d');
|
|
@@ -1765,13 +1893,78 @@
|
|
| 1765 |
goHomeBtn.addEventListener('click', ()=>{ victoryScreen.classList.add('hidden'); gameScreen.classList.add('hidden'); landingScreen.classList.remove('hidden'); });
|
| 1766 |
continueBtn.addEventListener('click', ()=>{ victoryScreen.classList.add('hidden'); startGame(selectedBiome); });
|
| 1767 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1768 |
document.querySelectorAll('.biome-selector').forEach(el => {
|
| 1769 |
el.addEventListener('click', (ev)=>{
|
| 1770 |
document.querySelectorAll('.biome-selector').forEach(x=>x.classList.remove('biome-selected'));
|
| 1771 |
el.classList.add('biome-selected');
|
| 1772 |
const biome = el.dataset.biome;
|
| 1773 |
selectedBiome = biome;
|
| 1774 |
-
|
|
|
|
| 1775 |
});
|
| 1776 |
});
|
| 1777 |
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
+
<title>BattleZone Royale - Minimap Added</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
<style>
|
|
|
|
| 24 |
.equipped { box-shadow: inset 0 -6px 14px rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.04); }
|
| 25 |
.medkit-count { position:absolute; right:4px; bottom:2px; font-size:10px; color:#ffd; }
|
| 26 |
.biome-selected { outline: 3px solid rgba(96,165,250,0.9); }
|
| 27 |
+
|
| 28 |
+
/* Loading screen */
|
| 29 |
+
#loadingScreen {
|
| 30 |
+
position: absolute;
|
| 31 |
+
inset: 0;
|
| 32 |
+
z-index: 80;
|
| 33 |
+
display: none;
|
| 34 |
+
align-items: center;
|
| 35 |
+
justify-content: center;
|
| 36 |
+
overflow: hidden;
|
| 37 |
+
color: #fff;
|
| 38 |
+
padding: 24px;
|
| 39 |
+
box-sizing: border-box;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/* animated gradient background */
|
| 43 |
+
.loading-bg {
|
| 44 |
+
position: absolute;
|
| 45 |
+
inset: -20%;
|
| 46 |
+
background: linear-gradient(120deg, #0b1220 0%, #123049 30%, #5b2a6a 60%, #2f4b2f 100%);
|
| 47 |
+
filter: blur(20px) saturate(1.1);
|
| 48 |
+
animation: bgShift 18s linear infinite;
|
| 49 |
+
transform: scale(1.1);
|
| 50 |
+
opacity: 0.85;
|
| 51 |
+
}
|
| 52 |
+
@keyframes bgShift {
|
| 53 |
+
0% { filter: hue-rotate(0deg) blur(20px); transform: scale(1.06) rotate(0.01deg); }
|
| 54 |
+
25% { filter: hue-rotate(45deg) blur(18px); transform: scale(1.08) rotate(0.02deg); }
|
| 55 |
+
50% { filter: hue-rotate(90deg) blur(22px); transform: scale(1.04) rotate(-0.01deg); }
|
| 56 |
+
75% { filter: hue-rotate(180deg) blur(20px); transform: scale(1.07) rotate(0.01deg); }
|
| 57 |
+
100% { filter: hue-rotate(360deg) blur(20px); transform: scale(1.06) rotate(-0.02deg); }
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.loading-card {
|
| 61 |
+
position: relative;
|
| 62 |
+
z-index: 2;
|
| 63 |
+
max-width: 880px;
|
| 64 |
+
width: calc(100% - 48px);
|
| 65 |
+
background: rgba(6,10,18,0.55);
|
| 66 |
+
border: 1px solid rgba(255,255,255,0.06);
|
| 67 |
+
box-shadow: 0 12px 40px rgba(0,0,0,0.7);
|
| 68 |
+
border-radius: 12px;
|
| 69 |
+
padding: 20px;
|
| 70 |
+
display:flex;
|
| 71 |
+
gap:18px;
|
| 72 |
+
align-items:center;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.loading-left {
|
| 76 |
+
flex: 1;
|
| 77 |
+
min-width: 260px;
|
| 78 |
+
display:flex; flex-direction:column; gap:10px;
|
| 79 |
+
}
|
| 80 |
+
.loading-right {
|
| 81 |
+
width: 260px;
|
| 82 |
+
display:flex; flex-direction:column; gap:12px; align-items:center;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.loader-spinner {
|
| 86 |
+
width: 84px; height:84px; border-radius:50%; position:relative;
|
| 87 |
+
display:flex; align-items:center; justify-content:center;
|
| 88 |
+
}
|
| 89 |
+
.ring {
|
| 90 |
+
position:absolute; inset:0; border-radius:50%; box-shadow: inset 0 0 24px rgba(255,255,255,0.02);
|
| 91 |
+
border: 6px solid rgba(255,255,255,0.06);
|
| 92 |
+
animation: ringRotate 1.8s linear infinite;
|
| 93 |
+
}
|
| 94 |
+
.ring::after {
|
| 95 |
+
content:'';
|
| 96 |
+
position:absolute; width:16px; height:16px; right:8px; top:50%; transform: translateY(-50%);
|
| 97 |
+
background: linear-gradient(90deg,#ffd86b,#8ef0ff);
|
| 98 |
+
border-radius:50%;
|
| 99 |
+
}
|
| 100 |
+
@keyframes ringRotate { to { transform: rotate(360deg); } }
|
| 101 |
+
.loader-dots { display:flex; gap:6px; }
|
| 102 |
+
.dot { width:10px; height:10px; border-radius:50%; background:#ffd86b; opacity:0.6; animation: dotPulse 1.2s infinite; }
|
| 103 |
+
.dot:nth-child(2){ animation-delay: 0.15s; background:#8ef0ff; }
|
| 104 |
+
.dot:nth-child(3){ animation-delay: 0.3s; background:#ff9fb8; }
|
| 105 |
+
@keyframes dotPulse { 0%{ transform: scale(.8); opacity:0.4 } 50%{ transform: scale(1.2); opacity:1 } 100%{ transform: scale(.8); opacity:0.4 } }
|
| 106 |
+
|
| 107 |
+
.tips { font-size:14px; color:#e8eef7; background: rgba(0,0,0,0.18); padding:10px; border-radius:8px; line-height:1.3; }
|
| 108 |
+
.loading-title { font-size:18px; font-weight:800; color:#ffd86b; display:flex; align-items:center; gap:8px; }
|
| 109 |
+
|
| 110 |
+
.progress-wrap { width:100%; background: rgba(255,255,255,0.04); height:14px; border-radius:8px; overflow:hidden; }
|
| 111 |
+
.progress-bar { height:100%; width:0%; background: linear-gradient(90deg,#ffd86b,#8ef0ff); transition: width 0.12s linear; }
|
| 112 |
+
|
| 113 |
+
.loading-count { font-size:12px; color:#dfe9f9; opacity:0.95; }
|
| 114 |
+
|
| 115 |
+
/* disable pointer events visually */
|
| 116 |
+
.disabled-pane { pointer-events: none; opacity: 0.6; filter: grayscale(12%); }
|
| 117 |
+
|
| 118 |
+
@media (max-width: 820px){
|
| 119 |
+
.loading-card { flex-direction:column; align-items:center; text-align:center; }
|
| 120 |
+
.loading-right { width:100%; }
|
| 121 |
+
}
|
| 122 |
</style>
|
| 123 |
</head>
|
| 124 |
<body>
|
|
|
|
| 167 |
</div>
|
| 168 |
</div>
|
| 169 |
|
| 170 |
+
<!-- Loading Overlay -->
|
| 171 |
+
<div id="loadingScreen" aria-hidden="true">
|
| 172 |
+
<div class="loading-bg" aria-hidden="true"></div>
|
| 173 |
+
<div class="loading-card" role="status" aria-live="polite">
|
| 174 |
+
<div class="loading-left">
|
| 175 |
+
<div class="loading-title"><i data-feather="download"></i> Preparing Drop Zone</div>
|
| 176 |
+
<div class="tips" id="loadingTip">Loading tips...</div>
|
| 177 |
+
<div class="loading-count" id="loadingTimerText">Landing in 20s</div>
|
| 178 |
+
<div style="height:8px"></div>
|
| 179 |
+
<div class="progress-wrap" aria-hidden="true">
|
| 180 |
+
<div id="loadingProgress" class="progress-bar"></div>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<div class="loading-right">
|
| 185 |
+
<div class="loader-spinner" aria-hidden="true">
|
| 186 |
+
<div class="ring"></div>
|
| 187 |
+
</div>
|
| 188 |
+
<div class="loader-dots" aria-hidden="true">
|
| 189 |
+
<div class="dot"></div><div class="dot"></div><div class="dot"></div>
|
| 190 |
+
</div>
|
| 191 |
+
<div style="height:6px"></div>
|
| 192 |
+
<div style="font-size:12px;color:#dbeafe;">Optimizing match assets...</div>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
<!-- Game -->
|
| 198 |
<div id="gameScreen" class="hidden h-screen flex flex-col">
|
| 199 |
<header class="flex justify-between items-center border-b border-yellow-500 px-6 py-4" style="flex-shrink:0;">
|
|
|
|
| 281 |
const continueBtn = document.getElementById('continueBtn');
|
| 282 |
const biomeGrid = document.getElementById('biomeGrid');
|
| 283 |
|
| 284 |
+
// Loading screen elements
|
| 285 |
+
const loadingScreen = document.getElementById('loadingScreen');
|
| 286 |
+
const loadingTipEl = document.getElementById('loadingTip');
|
| 287 |
+
const loadingProgressEl = document.getElementById('loadingProgress');
|
| 288 |
+
const loadingTimerText = document.getElementById('loadingTimerText');
|
| 289 |
+
|
| 290 |
// Minimap elements and cache
|
| 291 |
const minimapCanvas = document.getElementById('minimapCanvas');
|
| 292 |
const miniCtx = minimapCanvas.getContext('2d');
|
|
|
|
| 1893 |
goHomeBtn.addEventListener('click', ()=>{ victoryScreen.classList.add('hidden'); gameScreen.classList.add('hidden'); landingScreen.classList.remove('hidden'); });
|
| 1894 |
continueBtn.addEventListener('click', ()=>{ victoryScreen.classList.add('hidden'); startGame(selectedBiome); });
|
| 1895 |
|
| 1896 |
+
// ---- Loading screen logic ----
|
| 1897 |
+
const loadingTips = [
|
| 1898 |
+
"Stick to cover when approaching buildings — open areas get you killed.",
|
| 1899 |
+
"Loot chests quickly and move — enemies can hear opening animations.",
|
| 1900 |
+
"Use medkits only when safe; they take time and leave you vulnerable.",
|
| 1901 |
+
"Shotguns excel at close range; rifles win in open sightlines.",
|
| 1902 |
+
"Build walls to create temporary cover from enemy fire.",
|
| 1903 |
+
"Reload during lulls — don't wait until you're out in a fight.",
|
| 1904 |
+
"Watch the minimap for pickups and storm position.",
|
| 1905 |
+
"Materials stack up; farming early helps late-game survivability."
|
| 1906 |
+
];
|
| 1907 |
+
let loadingTimerId = null;
|
| 1908 |
+
let tipRotateId = null;
|
| 1909 |
+
let loadingStart = 0;
|
| 1910 |
+
const LOADING_DURATION = 20000; // 20 seconds
|
| 1911 |
+
|
| 1912 |
+
function showLoadingForBiome(biome){
|
| 1913 |
+
// disable selectors visually & functionally
|
| 1914 |
+
document.querySelectorAll('.biome-selector').forEach(x => { x.classList.add('disabled-pane'); x.style.pointerEvents = 'none'; });
|
| 1915 |
+
selectedBiome = biome;
|
| 1916 |
+
// pick initial tip
|
| 1917 |
+
loadingTipEl.textContent = loadingTips[Math.floor(Math.random()*loadingTips.length)];
|
| 1918 |
+
loadingProgressEl.style.width = '0%';
|
| 1919 |
+
loadingTimerText.textContent = `Landing in ${Math.ceil(LOADING_DURATION/1000)}s`;
|
| 1920 |
+
loadingScreen.style.display = 'flex';
|
| 1921 |
+
loadingScreen.setAttribute('aria-hidden', 'false');
|
| 1922 |
+
loadingStart = performance.now();
|
| 1923 |
+
|
| 1924 |
+
// rotate tips every 4 seconds
|
| 1925 |
+
let tipIndex = Math.floor(Math.random()*loadingTips.length);
|
| 1926 |
+
tipRotateId = setInterval(()=>{
|
| 1927 |
+
tipIndex = (tipIndex + 1) % loadingTips.length;
|
| 1928 |
+
loadingTipEl.style.opacity = '0';
|
| 1929 |
+
setTimeout(()=> {
|
| 1930 |
+
loadingTipEl.textContent = loadingTips[tipIndex];
|
| 1931 |
+
loadingTipEl.style.opacity = '1';
|
| 1932 |
+
}, 180);
|
| 1933 |
+
}, 4000);
|
| 1934 |
+
|
| 1935 |
+
// progress updater
|
| 1936 |
+
loadingTimerId = setInterval(() => {
|
| 1937 |
+
const elapsed = performance.now() - loadingStart;
|
| 1938 |
+
const pct = Math.min(1, elapsed / LOADING_DURATION);
|
| 1939 |
+
loadingProgressEl.style.width = `${Math.floor(pct*100)}%`;
|
| 1940 |
+
const remaining = Math.max(0, Math.ceil((LOADING_DURATION - elapsed)/1000));
|
| 1941 |
+
loadingTimerText.textContent = `Landing in ${remaining}s`;
|
| 1942 |
+
// subtle pulse to spinner ring speed based on pct (cosmetic)
|
| 1943 |
+
if (pct >= 1){
|
| 1944 |
+
clearInterval(loadingTimerId);
|
| 1945 |
+
clearInterval(tipRotateId);
|
| 1946 |
+
// hide overlay and begin game
|
| 1947 |
+
setTimeout(()=> {
|
| 1948 |
+
loadingScreen.style.display = 'none';
|
| 1949 |
+
loadingScreen.setAttribute('aria-hidden', 'true');
|
| 1950 |
+
// re-enable selectors
|
| 1951 |
+
document.querySelectorAll('.biome-selector').forEach(x => { x.classList.remove('disabled-pane'); x.style.pointerEvents = ''; });
|
| 1952 |
+
// actually start the game
|
| 1953 |
+
startGame(biome);
|
| 1954 |
+
}, 220); // brief fade window
|
| 1955 |
+
}
|
| 1956 |
+
}, 100);
|
| 1957 |
+
}
|
| 1958 |
+
|
| 1959 |
+
// Override biome clicks to use loading screen
|
| 1960 |
document.querySelectorAll('.biome-selector').forEach(el => {
|
| 1961 |
el.addEventListener('click', (ev)=>{
|
| 1962 |
document.querySelectorAll('.biome-selector').forEach(x=>x.classList.remove('biome-selected'));
|
| 1963 |
el.classList.add('biome-selected');
|
| 1964 |
const biome = el.dataset.biome;
|
| 1965 |
selectedBiome = biome;
|
| 1966 |
+
// Show the loading screen for 20s then start
|
| 1967 |
+
showLoadingForBiome(biome);
|
| 1968 |
});
|
| 1969 |
});
|
| 1970 |
|