Spaces:
Running
Running
Update index.html
Browse files- index.html +254 -319
index.html
CHANGED
|
@@ -1,99 +1,55 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>AI Pro Suite - Dashboard</title>
|
| 7 |
-
|
| 8 |
-
<
|
| 9 |
-
<
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
<link rel="stylesheet" href="style.css">
|
| 13 |
-
|
| 14 |
-
<style>
|
| 15 |
-
/*
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
}
|
| 31 |
-
.
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
border-radius: 18px;
|
| 51 |
-
backdrop-filter: blur(10px);
|
| 52 |
-
flex-shrink: 0;
|
| 53 |
-
}
|
| 54 |
-
.hero-text h2 {
|
| 55 |
-
margin: 0 0 4px 0;
|
| 56 |
-
font-size: 22px;
|
| 57 |
-
font-weight: 700;
|
| 58 |
-
letter-spacing: 0.5px;
|
| 59 |
-
}
|
| 60 |
-
.hero-text p {
|
| 61 |
-
margin: 0;
|
| 62 |
-
font-size: 14px;
|
| 63 |
-
opacity: 0.9;
|
| 64 |
-
font-weight: 400;
|
| 65 |
-
}
|
| 66 |
-
.pin-badge {
|
| 67 |
-
position: absolute;
|
| 68 |
-
top: 12px; right: 15px;
|
| 69 |
-
background: rgba(255,255,255,0.25);
|
| 70 |
-
padding: 4px 10px;
|
| 71 |
-
border-radius: 12px;
|
| 72 |
-
font-size: 11px;
|
| 73 |
-
font-weight: 700;
|
| 74 |
-
text-transform: uppercase;
|
| 75 |
-
backdrop-filter: blur(5px);
|
| 76 |
-
}
|
| 77 |
-
</style>
|
| 78 |
-
</head>
|
| 79 |
-
<body>
|
| 80 |
-
<div id="appLoader">
|
| 81 |
-
<div class="loader-logo">AI Pro Suite</div>
|
| 82 |
-
<div class="loader-bar-container">
|
| 83 |
-
<div class="loader-bar" id="loaderBar"></div>
|
| 84 |
-
</div>
|
| 85 |
-
<div class="loader-text" id="loaderText">Initializing Engine...</div>
|
| 86 |
-
</div>
|
| 87 |
-
<div class="overlay" id="overlay"></div>
|
| 88 |
-
|
| 89 |
-
<div class="topbar">
|
| 90 |
-
<div class="menuBtn" onclick="toggleSidebar()">☰</div>
|
| 91 |
-
<div class="appTitle">AI Pro Suite</div>
|
| 92 |
-
</div>
|
| 93 |
-
|
| 94 |
<div class="sidebar" id="sidebar">
|
| 95 |
<button class="sidebar-close-btn" onclick="toggleSidebar()">✖ Close Menu</button>
|
| 96 |
-
<button onclick="window.location.href='index.html'" style="border-left: 4px solid
|
| 97 |
<button onclick="window.location.href='lens.html'">✨ Lens Studio</button>
|
| 98 |
<button onclick="window.location.href='books.html'">📚 Book Deep Study</button>
|
| 99 |
<button onclick="window.location.href='maths.html'">🧮 Math Solver</button>
|
|
@@ -112,229 +68,208 @@
|
|
| 112 |
<button onclick="window.location.href='history.html'">🕒 History & Downloads</button>
|
| 113 |
</div>
|
| 114 |
|
| 115 |
-
<div class="page active" id="homePage" style="top: 70px;">
|
| 116 |
-
<div style="text-align: center; margin-bottom: 30px; margin-top: 20px;">
|
| 117 |
-
<h1 style="font-size: 28px; background: linear-gradient(90deg, #3b82f6, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Welcome to AI Pro Suite</h1>
|
| 118 |
-
<p style="color:
|
| 119 |
-
</div>
|
| 120 |
-
|
| 121 |
-
<div class="card" style="margin-bottom: 25px; border-top: 3px solid #3b82f6;">
|
| 122 |
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
| 123 |
-
<div>
|
| 124 |
-
<div class="cardTitle" style="margin: 0;">📊 Live API Usage</div>
|
| 125 |
-
<div id="apiResetTimer" style="font-size: 13px; color: #f59e0b; font-weight: 600; margin-top: 4px; letter-spacing: 0.5px;">
|
| 126 |
-
⏳ Quota Reset: Calculating...
|
| 127 |
-
</div>
|
| 128 |
-
</div>
|
| 129 |
-
<button class="actionBtnSmall blue" onclick="fetchApiUsage()" title="Refresh Stats">🔄</button>
|
| 130 |
-
</div>
|
| 131 |
-
|
| 132 |
-
<div id="apiUsageContainer" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
| 133 |
-
<div style="color:
|
| 134 |
-
</div>
|
| 135 |
-
</div>
|
| 136 |
-
|
| 137 |
-
<div class="featured-hero" onclick="window.location.href='lens.html'">
|
| 138 |
-
<div class="pin-badge">📌 Top Tool</div>
|
| 139 |
-
<div class="hero-icon">✨</div>
|
| 140 |
-
<div class="hero-text">
|
| 141 |
-
<h2>Lens Studio</h2>
|
| 142 |
-
<p>Advanced AI Vision, OCR Text Selection & Translation.</p>
|
| 143 |
-
</div>
|
| 144 |
-
</div>
|
| 145 |
-
|
| 146 |
-
<div class="dashboard-grid">
|
| 147 |
-
<div class="dash-card" onclick="window.location.href='books.html'">
|
| 148 |
-
<div class="dash-icon">📚</div>
|
| 149 |
-
<div class="dash-title">Book Deep Study</div>
|
| 150 |
-
</div>
|
| 151 |
-
<div class="dash-card" onclick="window.location.href='search.html'">
|
| 152 |
-
<div class="dash-icon">🔎</div>
|
| 153 |
-
<div class="dash-title">Deep Search</div>
|
| 154 |
-
</div>
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
<div class="dash-
|
| 158 |
-
|
| 159 |
-
<
|
| 160 |
-
|
| 161 |
-
<div class="dash-
|
| 162 |
-
|
| 163 |
-
<
|
| 164 |
-
|
| 165 |
-
<div class="dash-
|
| 166 |
-
|
| 167 |
-
<
|
| 168 |
-
|
| 169 |
-
<div class="dash-
|
| 170 |
-
|
| 171 |
-
<
|
| 172 |
-
<div class="dash-
|
| 173 |
-
<div class="dash-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
<div class="dash-
|
| 182 |
-
|
| 183 |
-
<
|
| 184 |
-
|
| 185 |
-
<div class="dash-
|
| 186 |
-
|
| 187 |
-
<
|
| 188 |
-
|
| 189 |
-
<div class="dash-
|
| 190 |
-
|
| 191 |
-
<
|
| 192 |
-
|
| 193 |
-
<div class="dash-
|
| 194 |
-
|
| 195 |
-
<
|
| 196 |
-
|
| 197 |
-
<div class="dash-
|
| 198 |
-
|
| 199 |
-
<
|
| 200 |
-
|
| 201 |
-
<div class="dash-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
const
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
}
|
| 223 |
-
|
| 224 |
-
//
|
| 225 |
-
function updateResetTimer() {
|
| 226 |
-
const now = new Date();
|
| 227 |
-
const laTimeStr = now.toLocaleString("en-US", { timeZone: "America/Los_Angeles" });
|
| 228 |
-
const laTime = new Date(laTimeStr);
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
const
|
| 234 |
-
|
| 235 |
-
const
|
| 236 |
-
const
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
<div style="font-size:
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
const
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
const remainingDelay = Math.max(0, minLoadTime - timeElapsed);
|
| 320 |
-
|
| 321 |
-
setTimeout(() => {
|
| 322 |
-
clearInterval(textInterval);
|
| 323 |
-
clearInterval(progressInterval);
|
| 324 |
-
|
| 325 |
-
// Snap progress to 100% and say Ready
|
| 326 |
-
loaderBar.style.width = "100%";
|
| 327 |
-
loaderText.innerText = "system ready.";
|
| 328 |
-
|
| 329 |
-
// Wait 0.4s for the user to see 100%, then fade it out smoothly
|
| 330 |
-
setTimeout(() => {
|
| 331 |
-
appLoader.classList.add("hidden");
|
| 332 |
-
}, 400);
|
| 333 |
-
|
| 334 |
-
}, remainingDelay);
|
| 335 |
-
});
|
| 336 |
-
});
|
| 337 |
-
</script>
|
| 338 |
-
<script src="ui-controls.js" defer></script>
|
| 339 |
-
</body>
|
| 340 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AI Pro Suite - Dashboard</title>
|
| 7 |
+
|
| 8 |
+
<meta name="theme-color" content="#0f172a">
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
|
| 10 |
+
|
| 11 |
+
<!-- We keep your main style sheet, but inject emergency loader styles below -->
|
| 12 |
+
<link rel="stylesheet" href="style.css">
|
| 13 |
+
|
| 14 |
+
<style>
|
| 15 |
+
/* EMERGENCY INLINE STYLES: Prevents the White Screen of Death instantly */
|
| 16 |
+
body { background-color: #0f172a; color: white; margin: 0; font-family: 'Poppins', sans-serif; }
|
| 17 |
+
|
| 18 |
+
#appLoader { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0f172a; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.4s ease; }
|
| 19 |
+
#appLoader.hidden { opacity: 0; pointer-events: none; }
|
| 20 |
+
.loader-logo { font-size: 28px; font-weight: 800; background: linear-gradient(90deg, #3b82f6, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 15px; }
|
| 21 |
+
.loader-bar-container { width: 220px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; margin-bottom: 15px; }
|
| 22 |
+
.loader-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #a855f7); width: 0%; transition: width 0.2s ease; }
|
| 23 |
+
.loader-text { font-size: 13px; color: #94a3b8; font-weight: 500; letter-spacing: 1px; }
|
| 24 |
+
|
| 25 |
+
/* Featured Hero Card for Lens Studio */
|
| 26 |
+
.featured-hero { background: linear-gradient(135deg, #007aff, #a855f7); border-radius: 20px; padding: 24px; margin-bottom: 25px; display: flex; align-items: center; gap: 20px; cursor: pointer; box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3); transition: transform 0.3s ease, box-shadow 0.3s ease; color: white; position: relative; overflow: hidden; }
|
| 27 |
+
.featured-hero:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(168, 85, 247, 0.4); }
|
| 28 |
+
.featured-hero::after { content: ''; position: absolute; top: -50%; right: -20%; width: 150px; height: 150px; background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%); border-radius: 50%; }
|
| 29 |
+
.hero-icon { font-size: 42px; background: rgba(255, 255, 255, 0.2); width: 70px; height: 70px; display: flex; justify-content: center; align-items: center; border-radius: 18px; backdrop-filter: blur(10px); flex-shrink: 0; }
|
| 30 |
+
.hero-text h2 { margin: 0 0 4px 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
|
| 31 |
+
.hero-text p { margin: 0; font-size: 14px; opacity: 0.9; font-weight: 400; }
|
| 32 |
+
.pin-badge { position: absolute; top: 12px; right: 15px; background: rgba(255,255,255,0.25); padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; backdrop-filter: blur(5px); }
|
| 33 |
+
</style>
|
| 34 |
+
</head>
|
| 35 |
+
<body>
|
| 36 |
+
<div id="appLoader">
|
| 37 |
+
<div class="loader-logo">AI Pro Suite</div>
|
| 38 |
+
<div class="loader-bar-container">
|
| 39 |
+
<div class="loader-bar" id="loaderBar"></div>
|
| 40 |
+
</div>
|
| 41 |
+
<div class="loader-text" id="loaderText">Initializing Engine...</div>
|
| 42 |
+
</div>
|
| 43 |
+
<div class="overlay" id="overlay"></div>
|
| 44 |
+
|
| 45 |
+
<div class="topbar">
|
| 46 |
+
<div class="menuBtn" onclick="toggleSidebar()">☰</div>
|
| 47 |
+
<div class="appTitle">AI Pro Suite</div>
|
| 48 |
+
</div>
|
| 49 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
<div class="sidebar" id="sidebar">
|
| 51 |
<button class="sidebar-close-btn" onclick="toggleSidebar()">✖ Close Menu</button>
|
| 52 |
+
<button onclick="window.location.href='index.html'" style="border-left: 4px solid #3b82f6; color: #3b82f6; background: rgba(255,255,255,0.05);">🏠 Dashboard</button>
|
| 53 |
<button onclick="window.location.href='lens.html'">✨ Lens Studio</button>
|
| 54 |
<button onclick="window.location.href='books.html'">📚 Book Deep Study</button>
|
| 55 |
<button onclick="window.location.href='maths.html'">🧮 Math Solver</button>
|
|
|
|
| 68 |
<button onclick="window.location.href='history.html'">🕒 History & Downloads</button>
|
| 69 |
</div>
|
| 70 |
|
| 71 |
+
<div class="page active" id="homePage" style="top: 70px;">
|
| 72 |
+
<div style="text-align: center; margin-bottom: 30px; margin-top: 20px;">
|
| 73 |
+
<h1 style="font-size: 28px; background: linear-gradient(90deg, #3b82f6, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Welcome to AI Pro Suite</h1>
|
| 74 |
+
<p style="color: #94a3b8; margin-top: 10px;">Select a tool below to get started</p>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div class="card" style="margin-bottom: 25px; border-top: 3px solid #3b82f6;">
|
| 78 |
+
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
| 79 |
+
<div>
|
| 80 |
+
<div class="cardTitle" style="margin: 0; font-weight: 700;">📊 Live API Usage</div>
|
| 81 |
+
<div id="apiResetTimer" style="font-size: 13px; color: #f59e0b; font-weight: 600; margin-top: 4px; letter-spacing: 0.5px;">
|
| 82 |
+
⏳ Quota Reset: Calculating...
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<button class="actionBtnSmall blue" onclick="fetchApiUsage()" title="Refresh Stats" style="background:#3b82f6; border:none; padding:8px 12px; border-radius:8px; color:white; cursor:pointer;">🔄</button>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<div id="apiUsageContainer" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
| 89 |
+
<div style="color: #94a3b8; font-size: 14px;">Loading server stats...</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
|
| 93 |
+
<div class="featured-hero" onclick="window.location.href='lens.html'">
|
| 94 |
+
<div class="pin-badge">📌 Top Tool</div>
|
| 95 |
+
<div class="hero-icon">✨</div>
|
| 96 |
+
<div class="hero-text">
|
| 97 |
+
<h2>Lens Studio</h2>
|
| 98 |
+
<p>Advanced AI Vision, OCR Text Selection & Translation.</p>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<div class="dashboard-grid">
|
| 103 |
+
<div class="dash-card" onclick="window.location.href='books.html'">
|
| 104 |
+
<div class="dash-icon">📚</div>
|
| 105 |
+
<div class="dash-title">Book Deep Study</div>
|
| 106 |
+
</div>
|
| 107 |
+
<div class="dash-card" onclick="window.location.href='search.html'">
|
| 108 |
+
<div class="dash-icon">🔎</div>
|
| 109 |
+
<div class="dash-title">Deep Search</div>
|
| 110 |
+
</div>
|
| 111 |
+
<div class="dash-card" onclick="window.location.href='board.html'">
|
| 112 |
+
<div class="dash-icon">📋</div>
|
| 113 |
+
<div class="dash-title">Whiteboard</div>
|
| 114 |
+
</div>
|
| 115 |
+
<div class="dash-card" onclick="window.location.href='runhtml.html'">
|
| 116 |
+
<div class="dash-icon">🌐</div>
|
| 117 |
+
<div class="dash-title">Write HTML</div>
|
| 118 |
+
</div>
|
| 119 |
+
<div class="dash-card" onclick="window.location.href='youtube.html'">
|
| 120 |
+
<div class="dash-icon">▶️</div>
|
| 121 |
+
<div class="dash-title">YouTube Search</div>
|
| 122 |
+
</div>
|
| 123 |
+
<div class="dash-card" onclick="window.location.href='quiz.html'">
|
| 124 |
+
<div class="dash-icon">📝</div>
|
| 125 |
+
<div class="dash-title">Take a Quiz!</div>
|
| 126 |
+
</div>
|
| 127 |
+
<div class="dash-card" onclick="window.location.href='book_quiz.html'">
|
| 128 |
+
<div class="dash-icon">📝</div>
|
| 129 |
+
<div class="dash-title">Take a Book Quiz!</div>
|
| 130 |
+
</div>
|
| 131 |
+
<div class="dash-card" onclick="window.location.href='tables.html'">
|
| 132 |
+
<div class="dash-icon">🔢</div>
|
| 133 |
+
<div class="dash-title">Maths Table</div>
|
| 134 |
+
</div>
|
| 135 |
+
<div class="dash-card" onclick="window.location.href='translator.html'">
|
| 136 |
+
<div class="dash-icon">🎙️</div>
|
| 137 |
+
<div class="dash-title">Text & Voice</div>
|
| 138 |
+
</div>
|
| 139 |
+
<div class="dash-card" onclick="window.location.href='image.html'">
|
| 140 |
+
<div class="dash-icon">🖼️</div>
|
| 141 |
+
<div class="dash-title">Image Translate</div>
|
| 142 |
+
</div>
|
| 143 |
+
<div class="dash-card" onclick="window.location.href='create.html'">
|
| 144 |
+
<div class="dash-icon">🎨</div>
|
| 145 |
+
<div class="dash-title">Image Creator</div>
|
| 146 |
+
</div>
|
| 147 |
+
<div class="dash-card" onclick="window.location.href='qa.html'">
|
| 148 |
+
<div class="dash-icon">📚</div>
|
| 149 |
+
<div class="dash-title">Document Q&A</div>
|
| 150 |
+
</div>
|
| 151 |
+
<div class="dash-card" onclick="window.location.href='history.html'">
|
| 152 |
+
<div class="dash-icon">🕒</div>
|
| 153 |
+
<div class="dash-title">History</div>
|
| 154 |
+
</div>
|
| 155 |
+
<div class="dash-card" onclick="window.location.href='chess.html'">
|
| 156 |
+
<div class="dash-icon">♟️</div>
|
| 157 |
+
<div class="dash-title">Chess AI</div>
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
</div>
|
| 161 |
+
|
| 162 |
+
<script>
|
| 163 |
+
function toggleSidebar() {
|
| 164 |
+
const sidebar = document.getElementById("sidebar");
|
| 165 |
+
const overlay = document.getElementById("overlay");
|
| 166 |
+
const active = !sidebar.classList.contains("active");
|
| 167 |
+
sidebar.classList.toggle("active", active);
|
| 168 |
+
if(overlay) overlay.classList.toggle("active", active);
|
| 169 |
+
document.body.classList.toggle("sidebar-open", active);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if(document.getElementById("overlay")) {
|
| 173 |
+
document.getElementById("overlay").onclick = () => {
|
| 174 |
+
document.getElementById("sidebar").classList.remove("active");
|
| 175 |
+
document.getElementById("overlay").classList.remove("active");
|
| 176 |
+
document.body.classList.remove("sidebar-open");
|
| 177 |
+
};
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
// Timer Logic
|
| 181 |
+
function updateResetTimer() {
|
| 182 |
+
const now = new Date();
|
| 183 |
+
const laTimeStr = now.toLocaleString("en-US", { timeZone: "America/Los_Angeles" });
|
| 184 |
+
const laTime = new Date(laTimeStr);
|
| 185 |
+
const nextMidnight = new Date(laTime);
|
| 186 |
+
nextMidnight.setHours(24, 0, 0, 0);
|
| 187 |
+
const diffMs = nextMidnight - laTime;
|
| 188 |
+
|
| 189 |
+
const h = Math.floor(diffMs / (1000 * 60 * 60));
|
| 190 |
+
const m = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));
|
| 191 |
+
const s = Math.floor((diffMs % (1000 * 60)) / 1000);
|
| 192 |
+
const pad = (num) => num.toString().padStart(2, '0');
|
| 193 |
+
|
| 194 |
+
const timerElement = document.getElementById("apiResetTimer");
|
| 195 |
+
if (timerElement) timerElement.innerText = `⏳ Quota resets in: ${pad(h)}h ${pad(m)}m ${pad(s)}s`;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
updateResetTimer();
|
| 199 |
+
setInterval(updateResetTimer, 1000);
|
| 200 |
+
|
| 201 |
+
// FETCH API STATS WITH 3-SECOND KILL SWITCH
|
| 202 |
+
async function fetchApiUsage() {
|
| 203 |
+
const container = document.getElementById("apiUsageContainer");
|
| 204 |
+
if (!container) return;
|
| 205 |
+
|
| 206 |
+
container.innerHTML = '<span style="font-size:14px; color:#94a3b8;">Syncing with server...</span>';
|
| 207 |
+
|
| 208 |
+
try {
|
| 209 |
+
// This AbortController stops the browser tab from spinning forever!
|
| 210 |
+
const controller = new AbortController();
|
| 211 |
+
const timeoutId = setTimeout(() => controller.abort(), 3000); // 3 Second hard limit
|
| 212 |
+
|
| 213 |
+
const res = await fetch('/api/usage', { signal: controller.signal });
|
| 214 |
+
clearTimeout(timeoutId);
|
| 215 |
+
|
| 216 |
+
if (!res.ok) throw new Error("Bad network response");
|
| 217 |
+
const data = await res.json();
|
| 218 |
+
|
| 219 |
+
if (Object.keys(data).length === 0) {
|
| 220 |
+
container.innerHTML = '<div style="color: #94a3b8; font-size: 14px; width: 100%; text-align: center;">No API requests made yet.</div>';
|
| 221 |
+
return;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
container.innerHTML = Object.entries(data).map(([apiName, count]) => `
|
| 225 |
+
<div style="background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); padding: 15px; border-radius: 16px; flex: 1; min-width: 110px; text-align: center;">
|
| 226 |
+
<div style="font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase;">${apiName}</div>
|
| 227 |
+
<div style="font-size: 24px; font-weight: 800; color: #60a5fa;">${count}</div>
|
| 228 |
+
</div>
|
| 229 |
+
`).join('');
|
| 230 |
+
|
| 231 |
+
} catch(e) {
|
| 232 |
+
console.error("API Usage Fetch Error:", e);
|
| 233 |
+
container.innerHTML = '<div style="color: #ef4444; font-size: 14px;">⚠️ Server stats offline (Request timed out).</div>';
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
document.addEventListener("DOMContentLoaded", fetchApiUsage);
|
| 238 |
+
</script>
|
| 239 |
+
|
| 240 |
+
<script>
|
| 241 |
+
// Bulletproof Loader Animation
|
| 242 |
+
document.addEventListener("DOMContentLoaded", () => {
|
| 243 |
+
const loadingTexts = ["solve math question...", "search using ai...", "search youtube...", "get quiz...", "solve answers..."];
|
| 244 |
+
let textIndex = 0;
|
| 245 |
+
const loaderText = document.getElementById("loaderText");
|
| 246 |
+
const loaderBar = document.getElementById("loaderBar");
|
| 247 |
+
const appLoader = document.getElementById("appLoader");
|
| 248 |
+
|
| 249 |
+
loaderText.innerText = loadingTexts[0];
|
| 250 |
+
const textInterval = setInterval(() => {
|
| 251 |
+
textIndex = (textIndex + 1) % loadingTexts.length;
|
| 252 |
+
loaderText.innerText = loadingTexts[textIndex];
|
| 253 |
+
}, 1500);
|
| 254 |
+
|
| 255 |
+
let progress = 0;
|
| 256 |
+
const progressInterval = setInterval(() => {
|
| 257 |
+
progress += Math.random() * 20;
|
| 258 |
+
if (progress > 95) progress = 95;
|
| 259 |
+
loaderBar.style.width = progress + "%";
|
| 260 |
+
}, 200);
|
| 261 |
+
|
| 262 |
+
// FORCED 2.5 SECOND UNLOCK: Prevents the page from being held hostage
|
| 263 |
+
setTimeout(() => {
|
| 264 |
+
clearInterval(textInterval);
|
| 265 |
+
clearInterval(progressInterval);
|
| 266 |
+
|
| 267 |
+
loaderBar.style.width = "100%";
|
| 268 |
+
loaderText.innerText = "system ready.";
|
| 269 |
+
|
| 270 |
+
setTimeout(() => { appLoader.classList.add("hidden"); }, 300);
|
| 271 |
+
}, 2500);
|
| 272 |
+
});
|
| 273 |
+
</script>
|
| 274 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
</html>
|