Spaces:
Sleeping
Sleeping
Commit ·
73c1061
1
Parent(s): f8b4220
Add attractive welcome popup with CPU warning
Browse files- static/index.html +158 -0
static/index.html
CHANGED
|
@@ -1156,6 +1156,130 @@
|
|
| 1156 |
::-webkit-scrollbar-thumb:hover {
|
| 1157 |
background: var(--text-muted);
|
| 1158 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1159 |
</style>
|
| 1160 |
</head>
|
| 1161 |
|
|
@@ -1311,6 +1435,26 @@
|
|
| 1311 |
</div>
|
| 1312 |
</div>
|
| 1313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1314 |
<script>
|
| 1315 |
// State
|
| 1316 |
let serverUrl = ''; // Empty = relative URL (works on HF Spaces or any host)
|
|
@@ -1355,8 +1499,22 @@
|
|
| 1355 |
document.getElementById('sendBtn').disabled = !e.target.value.trim();
|
| 1356 |
}
|
| 1357 |
});
|
|
|
|
|
|
|
|
|
|
| 1358 |
});
|
| 1359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1360 |
// Theme toggle
|
| 1361 |
function toggleTheme() {
|
| 1362 |
const current = document.documentElement.getAttribute('data-theme');
|
|
|
|
| 1156 |
::-webkit-scrollbar-thumb:hover {
|
| 1157 |
background: var(--text-muted);
|
| 1158 |
}
|
| 1159 |
+
|
| 1160 |
+
/* ============================================ */
|
| 1161 |
+
/* WELCOME POPUP - CPU Warning */
|
| 1162 |
+
/* ============================================ */
|
| 1163 |
+
.welcome-popup-overlay {
|
| 1164 |
+
position: fixed;
|
| 1165 |
+
inset: 0;
|
| 1166 |
+
background: rgba(0, 0, 0, 0.7);
|
| 1167 |
+
backdrop-filter: blur(8px);
|
| 1168 |
+
display: flex;
|
| 1169 |
+
align-items: center;
|
| 1170 |
+
justify-content: center;
|
| 1171 |
+
z-index: 9999;
|
| 1172 |
+
opacity: 0;
|
| 1173 |
+
visibility: hidden;
|
| 1174 |
+
transition: all 0.4s ease;
|
| 1175 |
+
}
|
| 1176 |
+
|
| 1177 |
+
.welcome-popup-overlay.show {
|
| 1178 |
+
opacity: 1;
|
| 1179 |
+
visibility: visible;
|
| 1180 |
+
}
|
| 1181 |
+
|
| 1182 |
+
.welcome-popup {
|
| 1183 |
+
background: linear-gradient(135deg, rgba(30, 58, 95, 0.95) 0%, rgba(45, 140, 190, 0.9) 50%, rgba(64, 201, 201, 0.85) 100%);
|
| 1184 |
+
border-radius: 24px;
|
| 1185 |
+
padding: 32px;
|
| 1186 |
+
width: 90%;
|
| 1187 |
+
max-width: 480px;
|
| 1188 |
+
text-align: center;
|
| 1189 |
+
box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
|
| 1190 |
+
0 0 40px rgba(64, 201, 201, 0.3),
|
| 1191 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
| 1192 |
+
transform: scale(0.8) translateY(20px);
|
| 1193 |
+
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
|
| 1194 |
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
| 1195 |
+
position: relative;
|
| 1196 |
+
overflow: hidden;
|
| 1197 |
+
}
|
| 1198 |
+
|
| 1199 |
+
.welcome-popup::before {
|
| 1200 |
+
content: '';
|
| 1201 |
+
position: absolute;
|
| 1202 |
+
top: -50%;
|
| 1203 |
+
left: -50%;
|
| 1204 |
+
width: 200%;
|
| 1205 |
+
height: 200%;
|
| 1206 |
+
background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
|
| 1207 |
+
pointer-events: none;
|
| 1208 |
+
}
|
| 1209 |
+
|
| 1210 |
+
.welcome-popup-overlay.show .welcome-popup {
|
| 1211 |
+
transform: scale(1) translateY(0);
|
| 1212 |
+
}
|
| 1213 |
+
|
| 1214 |
+
.welcome-popup-emoji {
|
| 1215 |
+
font-size: 56px;
|
| 1216 |
+
margin-bottom: 16px;
|
| 1217 |
+
animation: bounce-emoji 2s infinite ease-in-out;
|
| 1218 |
+
}
|
| 1219 |
+
|
| 1220 |
+
@keyframes bounce-emoji {
|
| 1221 |
+
|
| 1222 |
+
0%,
|
| 1223 |
+
100% {
|
| 1224 |
+
transform: translateY(0);
|
| 1225 |
+
}
|
| 1226 |
+
|
| 1227 |
+
50% {
|
| 1228 |
+
transform: translateY(-10px);
|
| 1229 |
+
}
|
| 1230 |
+
}
|
| 1231 |
+
|
| 1232 |
+
.welcome-popup-title {
|
| 1233 |
+
font-size: 24px;
|
| 1234 |
+
font-weight: 700;
|
| 1235 |
+
color: white;
|
| 1236 |
+
margin-bottom: 12px;
|
| 1237 |
+
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
| 1238 |
+
}
|
| 1239 |
+
|
| 1240 |
+
.welcome-popup-message {
|
| 1241 |
+
font-size: 15px;
|
| 1242 |
+
color: rgba(255, 255, 255, 0.9);
|
| 1243 |
+
line-height: 1.6;
|
| 1244 |
+
margin-bottom: 24px;
|
| 1245 |
+
}
|
| 1246 |
+
|
| 1247 |
+
.welcome-popup-highlight {
|
| 1248 |
+
background: rgba(255, 255, 255, 0.15);
|
| 1249 |
+
padding: 12px 16px;
|
| 1250 |
+
border-radius: 12px;
|
| 1251 |
+
margin-bottom: 24px;
|
| 1252 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 1253 |
+
}
|
| 1254 |
+
|
| 1255 |
+
.welcome-popup-highlight span {
|
| 1256 |
+
color: #FFD700;
|
| 1257 |
+
font-weight: 600;
|
| 1258 |
+
}
|
| 1259 |
+
|
| 1260 |
+
.welcome-popup-btn {
|
| 1261 |
+
background: white;
|
| 1262 |
+
color: #1e3a5f;
|
| 1263 |
+
border: none;
|
| 1264 |
+
padding: 14px 48px;
|
| 1265 |
+
border-radius: 50px;
|
| 1266 |
+
font-size: 16px;
|
| 1267 |
+
font-weight: 600;
|
| 1268 |
+
cursor: pointer;
|
| 1269 |
+
transition: all 0.3s ease;
|
| 1270 |
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
| 1271 |
+
}
|
| 1272 |
+
|
| 1273 |
+
.welcome-popup-btn:hover {
|
| 1274 |
+
transform: translateY(-2px);
|
| 1275 |
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
|
| 1276 |
+
}
|
| 1277 |
+
|
| 1278 |
+
.welcome-popup-footer {
|
| 1279 |
+
margin-top: 20px;
|
| 1280 |
+
font-size: 12px;
|
| 1281 |
+
color: rgba(255, 255, 255, 0.6);
|
| 1282 |
+
}
|
| 1283 |
</style>
|
| 1284 |
</head>
|
| 1285 |
|
|
|
|
| 1435 |
</div>
|
| 1436 |
</div>
|
| 1437 |
|
| 1438 |
+
<!-- Welcome Popup - CPU Warning -->
|
| 1439 |
+
<div class="welcome-popup-overlay" id="welcomePopup">
|
| 1440 |
+
<div class="welcome-popup">
|
| 1441 |
+
<div class="welcome-popup-emoji">🧠</div>
|
| 1442 |
+
<h2 class="welcome-popup-title">Welcome to Krish Mind!</h2>
|
| 1443 |
+
<p class="welcome-popup-message">
|
| 1444 |
+
I'm your AI assistant, created by Krish CS. I'm running on Hugging Face's free tier to keep this service
|
| 1445 |
+
accessible to everyone.
|
| 1446 |
+
</p>
|
| 1447 |
+
<div class="welcome-popup-highlight">
|
| 1448 |
+
⚡ <span>Please Note:</span> Responses may take <span>15-30 seconds</span> due to limited CPU resources.
|
| 1449 |
+
Thank you for your patience!
|
| 1450 |
+
</div>
|
| 1451 |
+
<button class="welcome-popup-btn" onclick="closeWelcomePopup()">
|
| 1452 |
+
Got it, Let's Chat! 🚀
|
| 1453 |
+
</button>
|
| 1454 |
+
<p class="welcome-popup-footer">Powered by Llama 3 • Fine-tuned for Krish Mind</p>
|
| 1455 |
+
</div>
|
| 1456 |
+
</div>
|
| 1457 |
+
|
| 1458 |
<script>
|
| 1459 |
// State
|
| 1460 |
let serverUrl = ''; // Empty = relative URL (works on HF Spaces or any host)
|
|
|
|
| 1499 |
document.getElementById('sendBtn').disabled = !e.target.value.trim();
|
| 1500 |
}
|
| 1501 |
});
|
| 1502 |
+
|
| 1503 |
+
// Show welcome popup on page load
|
| 1504 |
+
showWelcomePopup();
|
| 1505 |
});
|
| 1506 |
|
| 1507 |
+
// Welcome Popup Functions
|
| 1508 |
+
function showWelcomePopup() {
|
| 1509 |
+
setTimeout(() => {
|
| 1510 |
+
document.getElementById('welcomePopup').classList.add('show');
|
| 1511 |
+
}, 300);
|
| 1512 |
+
}
|
| 1513 |
+
|
| 1514 |
+
function closeWelcomePopup() {
|
| 1515 |
+
document.getElementById('welcomePopup').classList.remove('show');
|
| 1516 |
+
}
|
| 1517 |
+
|
| 1518 |
// Theme toggle
|
| 1519 |
function toggleTheme() {
|
| 1520 |
const current = document.documentElement.getAttribute('data-theme');
|