Krishkanth commited on
Commit
6d574ae
·
1 Parent(s): 73c1061

Add toast notification with gradient colors

Browse files
Files changed (1) hide show
  1. static/index.html +169 -101
static/index.html CHANGED
@@ -1158,127 +1158,176 @@
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>
@@ -1435,24 +1484,31 @@
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>
@@ -1500,19 +1556,31 @@
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
 
1158
  }
1159
 
1160
  /* ============================================ */
1161
+ /* NOTIFICATION TOAST - Bottom Left */
1162
  /* ============================================ */
1163
+ .notification-toast {
1164
  position: fixed;
1165
+ bottom: 24px;
1166
+ left: 24px;
1167
+ background: var(--bg-primary);
1168
+ border-radius: 16px;
1169
+ padding: 16px 20px;
1170
+ max-width: 380px;
1171
  z-index: 9999;
1172
  opacity: 0;
1173
  visibility: hidden;
1174
+ transform: translateY(20px) scale(0.95);
1175
+ transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
1176
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 255, 255, 0.3);
1177
  }
1178
 
1179
+ .notification-toast.show {
1180
  opacity: 1;
1181
  visibility: visible;
1182
+ transform: translateY(0) scale(1);
1183
  }
1184
 
1185
+ /* Animated glowing border */
1186
+ .notification-toast::before {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1187
  content: '';
1188
  position: absolute;
1189
+ inset: -2px;
1190
+ border-radius: 18px;
1191
+ padding: 2px;
1192
+ background: linear-gradient(90deg, #1e3a5f, #2d8cbe, #40c9c9, #2d8cbe, #1e3a5f);
1193
+ background-size: 300% 100%;
1194
+ animation: border-glow 3s linear infinite;
1195
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1196
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1197
+ -webkit-mask-composite: xor;
1198
+ mask-composite: exclude;
1199
+ z-index: -1;
1200
+ }
1201
+
1202
+ @keyframes border-glow {
1203
+ 0% {
1204
+ background-position: 0% 50%;
1205
+ }
1206
+
1207
+ 100% {
1208
+ background-position: 300% 50%;
1209
+ }
1210
  }
1211
 
1212
+ .toast-header {
1213
+ display: flex;
1214
+ align-items: center;
1215
+ justify-content: space-between;
1216
+ margin-bottom: 8px;
1217
  }
1218
 
1219
+ .toast-title {
1220
+ display: flex;
1221
+ align-items: center;
1222
+ gap: 8px;
1223
+ font-size: 16px;
1224
+ font-weight: 700;
1225
+ background: linear-gradient(135deg, #1e3a5f 0%, #2d8cbe 50%, #40c9c9 100%);
1226
+ -webkit-background-clip: text;
1227
+ -webkit-text-fill-color: transparent;
1228
+ background-clip: text;
1229
  }
1230
 
1231
+ .toast-icon {
1232
+ width: 20px;
1233
+ height: 20px;
1234
+ animation: pulse-icon 2s infinite ease-in-out;
1235
+ }
1236
+
1237
+ @keyframes pulse-icon {
1238
 
1239
  0%,
1240
  100% {
1241
+ opacity: 1;
1242
+ transform: scale(1);
1243
  }
1244
 
1245
  50% {
1246
+ opacity: 0.7;
1247
+ transform: scale(0.9);
1248
  }
1249
  }
1250
 
1251
+ .toast-close {
1252
+ background: none;
1253
+ border: none;
1254
+ color: var(--text-muted);
1255
+ cursor: pointer;
1256
+ padding: 4px;
1257
+ border-radius: 6px;
1258
+ transition: all 0.2s;
1259
+ display: flex;
1260
+ align-items: center;
1261
+ justify-content: center;
1262
  }
1263
 
1264
+ .toast-close:hover {
1265
+ background: var(--bg-hover);
1266
+ color: var(--text-primary);
 
 
1267
  }
1268
 
1269
+ .toast-message {
1270
+ font-size: 14px;
1271
+ color: var(--text-primary);
1272
+ line-height: 1.6;
1273
+ margin-bottom: 14px;
 
1274
  }
1275
 
1276
+ .toast-message strong {
1277
+ background: linear-gradient(135deg, #2d8cbe 0%, #40c9c9 100%);
1278
+ -webkit-background-clip: text;
1279
+ -webkit-text-fill-color: transparent;
1280
+ background-clip: text;
1281
+ font-weight: 700;
1282
  }
1283
 
1284
+ .toast-btn {
1285
+ background: linear-gradient(135deg, #1e3a5f 0%, #2d8cbe 50%, #40c9c9 100%);
1286
+ color: white;
1287
  border: none;
1288
+ padding: 12px 24px;
1289
+ border-radius: 10px;
1290
+ font-size: 14px;
1291
  font-weight: 600;
1292
  cursor: pointer;
1293
  transition: all 0.3s ease;
1294
+ width: 100%;
1295
  }
1296
 
1297
+ .toast-btn:hover {
1298
+ filter: brightness(1.15);
1299
  transform: translateY(-2px);
1300
+ box-shadow: 0 4px 20px rgba(45, 140, 190, 0.4);
1301
  }
1302
 
1303
+ .toast-progress {
1304
+ position: absolute;
1305
+ bottom: 0;
1306
+ left: 0;
1307
+ height: 3px;
1308
+ background: linear-gradient(90deg, #00FFFF, #00D4FF);
1309
+ border-radius: 0 0 16px 16px;
1310
+ animation: progress-shrink 10s linear forwards;
1311
+ }
1312
+
1313
+ @keyframes progress-shrink {
1314
+ from {
1315
+ width: 100%;
1316
+ }
1317
+
1318
+ to {
1319
+ width: 0%;
1320
+ }
1321
+ }
1322
+
1323
+ /* Mobile Responsive */
1324
+ @media (max-width: 480px) {
1325
+ .notification-toast {
1326
+ left: 12px;
1327
+ right: 12px;
1328
+ bottom: 12px;
1329
+ max-width: none;
1330
+ }
1331
  }
1332
  </style>
1333
  </head>
 
1484
  </div>
1485
  </div>
1486
 
1487
+ <!-- Notification Toast - Bottom Left -->
1488
+ <div class="notification-toast" id="notificationToast">
1489
+ <div class="toast-header">
1490
+ <div class="toast-title">
1491
+ <svg class="toast-icon" viewBox="0 0 24 24" fill="none" stroke="#2d8cbe" stroke-width="2.5">
1492
+ <circle cx="12" cy="12" r="10"></circle>
1493
+ <line x1="12" y1="8" x2="12" y2="12"></line>
1494
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
1495
+ </svg>
1496
+ Heads Up!
 
 
1497
  </div>
1498
+ <button class="toast-close" onclick="closeToast()">
1499
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1500
+ <line x1="18" y1="6" x2="6" y2="18"></line>
1501
+ <line x1="6" y1="6" x2="18" y2="18"></line>
1502
+ </svg>
1503
  </button>
 
1504
  </div>
1505
+ <p class="toast-message">
1506
+ Responses may be <strong>slow</strong> due to limited CPU resources. Thank you for your patience!
1507
+ </p>
1508
+ <button class="toast-btn" onclick="closeToast()">
1509
+ Let's Chat!
1510
+ </button>
1511
+ <div class="toast-progress"></div>
1512
  </div>
1513
 
1514
  <script>
 
1556
  }
1557
  });
1558
 
1559
+ // Show notification toast on page load
1560
+ showToast();
1561
  });
1562
 
1563
+ // Toast Notification Functions
1564
+ let toastTimeout = null;
 
 
 
 
1565
 
1566
+ function showToast() {
1567
+ const toast = document.getElementById('notificationToast');
1568
+ setTimeout(() => {
1569
+ toast.classList.add('show');
1570
+ // Auto-dismiss after 10 seconds
1571
+ toastTimeout = setTimeout(() => {
1572
+ closeToast();
1573
+ }, 10000);
1574
+ }, 500);
1575
+ }
1576
+
1577
+ function closeToast() {
1578
+ const toast = document.getElementById('notificationToast');
1579
+ toast.classList.remove('show');
1580
+ if (toastTimeout) {
1581
+ clearTimeout(toastTimeout);
1582
+ toastTimeout = null;
1583
+ }
1584
  }
1585
 
1586
  // Theme toggle