File size: 61,796 Bytes
fd5dfc3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 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 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 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 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flipkart 2.0 - Modern Online Shopping</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Poppins', sans-serif;
background-color: #f8fafc;
color: #1e293b;
scroll-behavior: smooth;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* Header */
.header {
box-shadow: 0 4px 12px 0 rgba(0,0,0,.05);
border-bottom: 1px solid #e2e8f0;
background: white;
}
/* Search bar */
.search-bar {
box-shadow: 0 2px 8px 0 rgba(0,0,0,.05);
border-radius: 8px;
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}
.search-bar:focus-within {
box-shadow: 0 4px 16px 0 rgba(0,0,0,.1);
}
/* Category nav */
.category-item {
transition: all 0.3s ease;
color: #64748b;
}
.category-item:hover {
color: #3b82f6;
transform: translateY(-2px);
}
.category-item.active {
color: #3b82f6;
position: relative;
}
.category-item.active::after {
content: '';
position: absolute;
bottom: -4px;
left: 50%;
transform: translateX(-50%);
width: 6px;
height: 6px;
border-radius: 50%;
background: #3b82f6;
}
/* Product cards */
.product-card {
background: white;
border-radius: 12px;
overflow: hidden;
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
border: 1px solid #e2e8f0;
}
.product-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
border-color: #3b82f6;
}
.product-img {
height: 180px;
object-fit: contain;
transition: transform 0.3s ease;
}
.product-card:hover .product-img {
transform: scale(1.05);
}
.discount-badge {
background: linear-gradient(to right, #10b981, #34d399);
color: white;
border-radius: 4px;
padding: 2px 6px;
font-size: 11px;
font-weight: 500;
}
.add-to-cart {
background: linear-gradient(to right, #3b82f6, #60a5fa);
color: white;
border-radius: 6px;
font-weight: 500;
transition: all 0.3s;
}
.add-to-cart:hover {
background: linear-gradient(to right, #2563eb, #3b82f6);
transform: translateY(-1px);
}
/* Hero banner */
.hero-banner {
height: 320px;
background-image: url('https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1998&q=80');
background-size: cover;
background-position: center;
border-radius: 12px;
position: relative;
overflow: hidden;
}
.hero-overlay {
position: absolute;
inset: 0;
background: linear-gradient(45deg, rgba(0,0,0,0.6), rgba(0,0,0,0.3));
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
from { transform: translateX(-20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
.animate-fadeIn {
animation: fadeIn 0.5s ease-out forwards;
}
.animate-slideRight {
animation: slideRight 0.6s ease-out forwards;
}
/* Modal */
.modal {
backdrop-filter: blur(5px);
}
/* Notification */
.notification {
opacity: 0;
transform: translateY(20px);
animation: fadeIn 0.3s ease-out forwards;
}
/* Cart sidebar */
.cart-sidebar {
box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}
/* Discount banner */
.discount-banner {
transition: transform 0.3s ease;
}
.discount-banner:hover {
transform: translateY(-3px);
}
/* Responsive adjustments */
@media (max-width: 768px) {
.hero-banner {
height: 200px;
}
.product-img {
height: 120px;
}
}
</style>
</head>
<body class="bg-gray-50">
<!-- Notification Area -->
<div id="notification-area" class="fixed top-4 right-4 z-50 space-y-2 w-full max-w-xs"></div>
<!-- Header -->
<header class="header sticky top-0 z-40">
<div class="container mx-auto px-4">
<!-- Top Bar -->
<div class="flex items-center justify-between py-3 md:py-0">
<!-- Logo -->
<a href="#" class="flex items-center">
<h1 class="text-2xl font-bold text-blue-600 flex items-center">
<span class="mr-1">Flipkart</span>
<span class="text-xs text-yellow-400 font-normal">Plus</span>
</h1>
</a>
<!-- Search Bar -->
<div class="hidden md:block mx-4 flex-1 max-w-2xl">
<div class="search-bar flex items-center bg-gray-50 p-1.5 rounded-lg">
<input type="text" placeholder="Search for products, brands and more..."
class="w-full px-4 py-2 bg-transparent focus:outline-none text-gray-700">
<button class="bg-blue-600 text-white p-2 rounded-lg hover:bg-blue-700 transition">
<i class="fas fa-search"></i>
</button>
</div>
</div>
<!-- User Actions -->
<div class="flex items-center space-x-3 md:space-x-6">
<button id="login-btn" class="hidden md:flex items-center space-x-1 px-3 py-2 text-gray-700 hover:text-blue-600">
<i class="far fa-user"></i>
<span>Login</span>
</button>
<div class="relative group">
<button class="hidden md:flex items-center space-x-1 px-3 py-2 text-gray-700 hover:text-blue-600">
<span>More</span>
<i class="fas fa-chevron-down text-xs mt-0.5"></i>
</button>
<div class="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg hidden group-hover:block z-50 border border-gray-100 animate-fadeIn">
<div class="py-1">
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="far fa-bell mr-2"></i> Notifications
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="far fa-question-circle mr-2"></i> Customer Care
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-ad mr-2"></i> Advertise
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-mobile-alt mr-2"></i> Download App
</a>
</div>
</div>
</div>
<a href="#" id="cart-button" class="flex items-center space-x-1 px-3 py-2 relative text-gray-700 hover:text-blue-600">
<i class="fas fa-shopping-cart"></i>
<span id="cart-count" class="absolute -top-1 -right-1 bg-blue-600 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center font-bold">0</span>
<span class="hidden md:inline">Cart</span>
</a>
</div>
</div>
<!-- Mobile Search -->
<div class="md:hidden pb-3">
<div class="search-bar flex items-center bg-gray-50 p-1.5 rounded-lg">
<input type="text" placeholder="Search for products..."
class="w-full px-4 py-2 bg-transparent focus:outline-none text-gray-700">
<button class="bg-blue-600 text-white p-2 rounded-lg hover:bg-blue-700 transition">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
<!-- Categories Navigation -->
<nav class="bg-white border-t border-gray-100 hidden md:block">
<div class="container mx-auto px-4 overflow-x-auto">
<div class="flex space-x-8 py-3 whitespace-nowrap">
<a href="#" class="category-item text-sm font-medium flex flex-col items-center active">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-shopping-basket text-blue-600"></i>
</div>
<span>Grocery</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-mobile-alt text-blue-600"></i>
</div>
<span>Mobiles</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-tshirt text-blue-600"></i>
</div>
<span>Fashion</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-laptop text-blue-600"></i>
</div>
<span>Electronics</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-home text-blue-600"></i>
</div>
<span>Home</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-tv text-blue-600"></i>
</div>
<span>Appliances</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-umbrella-beach text-blue-600"></i>
</div>
<span>Travel</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-spa text-blue-600"></i>
</div>
<span>Beauty</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-gamepad text-blue-600"></i>
</div>
<span>Toys</span>
</a>
<a href="#" class="category-item text-sm font-medium flex flex-col items-center">
<div class="w-10 h-10 rounded-full bg-gray-100 mb-1 flex items-center justify-center">
<i class="fas fa-couch text-blue-600"></i>
</div>
<span>Furniture</span>
</a>
</div>
</div>
</nav>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-6">
<!-- Hero Banner -->
<section class="hero-banner mb-8 rounded-xl overflow-hidden animate-slideRight">
<div class="hero-overlay flex items-center">
<div class="px-8 text-white">
<h2 class="text-3xl md:text-4xl font-bold mb-2">Summer Sale 2023</h2>
<p class="text-lg md:text-xl mb-6 max-w-lg">Up to 70% off on all fashion items. Limited time only!</p>
<button class="bg-white text-blue-600 px-6 py-3 rounded-xl font-bold hover:bg-gray-100 transition">
Shop Collection <i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
</div>
</section>
<!-- Deals Section -->
<section class="mb-10 animate-fadeIn" style="animation-delay: 0.2s">
<div class="flex items-center justify-between mb-6">
<h2 class="text-2xl font-bold text-gray-900">Trending Deals</h2>
<a href="#" class="text-blue-600 hover:text-blue-800 font-medium text-sm flex items-center">
View All <i class="fas fa-chevron-right text-xs ml-1"></i>
</a>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-5">
<!-- Product Card 1 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1611791484670-ce19b801d192?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=687&q=80"
alt="iPhone 14" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">20% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Apple iPhone 14 (Blue, 128GB)</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹66,999</span>
<span class="text-sm text-gray-500 line-through ml-2">₹79,900</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.7</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">1,243 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="1" data-name="iPhone 14" data-price="66999">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 2 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1611186871348-b1ce696e52c9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80"
alt="Samsung TV" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">30% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Samsung 80 cm (32 inch) HD Smart TV</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹15,499</span>
<span class="text-sm text-gray-500 line-through ml-2">₹19,900</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.5</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">892 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="2" data-name="Samsung TV" data-price="15499">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 3 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1525966222134-fcfa99b8ae77?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=698&q=80"
alt="Shoes" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">60% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Nike Running Shoes For Men</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹2,499</span>
<span class="text-sm text-gray-500 line-through ml-2">₹5,999</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.8</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">1,542 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="3" data-name="Nike Shoes" data-price="2499">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 4 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1590658268037-6bf12165ee8a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=732&q=80"
alt="Headphones" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">45% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">boAt Rockerz 450 Wireless Headphones</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹1,299</span>
<span class="text-sm text-gray-500 line-through ml-2">₹2,990</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.3</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">1,024 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="4" data-name="Boat Headphones" data-price="1299">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 5 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1523170335258-f5ed11844a49?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80"
alt="Watch" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">30% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Noise ColorFit Pro Smart Watch</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹2,999</span>
<span class="text-sm text-gray-500 line-through ml-2">₹4,299</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.2</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">876 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="5" data-name="Smart Watch" data-price="2999">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
</div>
</section>
<!-- Fashion Section -->
<section class="mb-10 animate-fadeIn" style="animation-delay: 0.4s">
<div class="flex items-center justify-between mb-6">
<h2 class="text-2xl font-bold text-gray-900">Summer Fashion</h2>
<a href="#" class="text-blue-600 hover:text-blue-800 font-medium text-sm flex items-center">
View All <i class="fas fa-chevron-right text-xs ml-1"></i>
</a>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-5">
<!-- Product Card 1 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1591047139829-d91aecb6caea?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=736&q=80"
alt="Shirt" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">55% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Peter England Slim Fit Shirt</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹799</span>
<span class="text-sm text-gray-500 line-through ml-2">₹1,799</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.4</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">634 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="6" data-name="Formal Shirt" data-price="799">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 2 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1542272604-787c3835535d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1026&q=80"
alt="Jeans" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">50% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Levis Men's Slim Fit Jeans</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹1,499</span>
<span class="text-sm text-gray-500 line-through ml-2">₹2,999</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.6</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">1,128 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="7" data-name="Levis Jeans" data-price="1499">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 3 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1525507119028-ed4c629a60a3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=735&q=80"
alt="Dress" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">60% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">H&M Women's Summer Dress</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹999</span>
<span class="text-sm text-gray-500 line-through ml-2">₹2,499</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.5</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">842 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="8" data-name="Summer Dress" data-price="999">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 4 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1600269452121-4f2416e55c28?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=765&q=80"
alt="Sandals" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">40% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">Puma Men's Sports Sandals</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹1,199</span>
<span class="text-sm text-gray-500 line-through ml-2">₹1,999</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.3</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">567 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="9" data-name="Sports Sandals" data-price="1199">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
<!-- Product Card 5 -->
<div class="product-card transform transition">
<div class="relative overflow-hidden">
<img src="https://images.unsplash.com/photo-1553062407-98eeb64c6a62?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=687&q=80"
alt="Bag" class="product-img w-full">
<div class="absolute top-2 left-2">
<span class="discount-badge">35% OFF</span>
</div>
</div>
<div class="p-4">
<h3 class="text-md font-semibold text-gray-800 line-clamp-2">American Tourister Backpack</h3>
<div class="flex items-center mt-2">
<span class="text-lg font-bold">₹1,599</span>
<span class="text-sm text-gray-500 line-through ml-2">₹2,459</span>
</div>
<div class="flex items-center mt-1">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 text-sm"></i>
<span class="text-sm text-gray-600 ml-1">4.7</span>
</div>
<span class="text-sm text-gray-500 mx-2">•</span>
<span class="text-sm text-gray-500">1,043 Reviews</span>
</div>
<button class="add-to-cart mt-4 w-full py-2.5 text-sm flex items-center justify-center space-x-2"
data-id="10" data-name="Backpack" data-price="1599">
<i class="fas fa-shopping-cart"></i>
<span>Add to Cart</span>
</button>
</div>
</div>
</div>
</section>
<!-- Discount Banner -->
<div class="discount-banner overflow-hidden rounded-xl mb-10 cursor-pointer group animate-fadeIn" style="animation-delay: 0.6s">
<img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80"
alt="Discount Banner" class="w-full h-auto group-hover:scale-105 transition-transform duration-500">
<div class="absolute inset-0 bg-black/10"></div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-900 text-gray-300">
<div class="container mx-auto px-4 py-12">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<!-- About -->
<div>
<h3 class="text-white text-lg font-bold mb-4">ABOUT</h3>
<ul class="space-y-2">
<li><a href="#" class="hover:text-white transition">Contact Us</a></li>
<li><a href="#" class="hover:text-white transition">About Us</a></li>
<li><a href="#" class="hover:text-white transition">Careers</a></li>
<li><a href="#" class="hover:text-white transition">Flipkart Stories</a></li>
<li><a href="#" class="hover:text-white transition">Press</a></li>
</ul>
</div>
<!-- Help -->
<div>
<h3 class="text-white text-lg font-bold mb-4">HELP</h3>
<ul class="space-y-2">
<li><a href="#" class="hover:text-white transition">Payments</a></li>
<li><a href="#" class="hover:text-white transition">Shipping</a></li>
<li><a href="#" class="hover:text-white transition">Cancellation & Returns</a></li>
<li><a href="#" class="hover:text-white transition">FAQ</a></li>
<li><a href="#" class="hover:text-white transition">Report Infringement</a></li>
</ul>
</div>
<!-- Policy -->
<div>
<h3 class="text-white text-lg font-bold mb-4">POLICY</h3>
<ul class="space-y-2">
<li><a href="#" class="hover:text-white transition">Return Policy</a></li>
<li><a href="#" class="hover:text-white transition">Terms Of Use</a></li>
<li><a href="#" class="hover:text-white transition">Security</a></li>
<li><a href="#" class="hover:text-white transition">Privacy</a></li>
<li><a href="#" class="hover:text-white transition">Sitemap</a></li>
</ul>
</div>
<!-- Social -->
<div>
<h3 class="text-white text-lg font-bold mb-4">SOCIAL</h3>
<div class="flex space-x-4">
<a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-blue-600 transition">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-blue-400 transition">
<i class="fab fa-twitter"></i>
</a>
<a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-red-600 transition">
<i class="fab fa-youtube"></i>
</a>
<a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-pink-600 transition">
<i class="fab fa-instagram"></i>
</a>
</div>
<h4 class="text-white text-lg font-bold mt-6 mb-3">Download App</h4>
<div class="flex space-x-2">
<a href="#" class="w-32 h-10 rounded bg-gray-800 hover:bg-gray-700 transition"></a>
<a href="#" class="w-32 h-10 rounded bg-gray-800 hover:bg-gray-700 transition"></a>
</div>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="flex items-center">
<i class="fas fa-briefcase mr-3 text-gray-400"></i>
<span class="hover:text-white cursor-pointer transition">Become a Seller</span>
</div>
<div class="flex items-center">
<i class="fas fa-star mr-3 text-gray-400"></i>
<span class="hover:text-white cursor-pointer transition">Advertise</span>
</div>
<div class="flex items-center">
<i class="fas fa-gift mr-3 text-gray-400"></i>
<span class="hover:text-white cursor-pointer transition">Gift Cards</span>
</div>
<div class="flex items-center">
<i class="fas fa-question-circle mr-3 text-gray-400"></i>
<span class="hover:text-white cursor-pointer transition">Help Center</span>
</div>
</div>
</div>
</div>
<div class="bg-gray-800 py-4">
<div class="container mx-auto px-4 text-center text-gray-400 text-sm">
© 2023 Flipkart Clone. All Rights Reserved.
</div>
</div>
</footer>
<!-- Login Modal -->
<div id="login-modal" class="fixed inset-0 z-50 hidden modal">
<div class="flex items-center justify-center min-h-screen p-4">
<div class="bg-white rounded-xl shadow-2xl w-full max-w-md relative">
<div class="absolute top-4 right-4">
<button id="close-login" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-8">
<h2 class="text-3xl font-bold text-center mb-8">Welcome Back</h2>
<div class="mb-6">
<input class="w-full px-4 py-3 rounded-lg border border-gray-200 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200"
id="login-email" type="text" placeholder="Email or mobile number">
</div>
<div class="mb-6">
<input class="w-full px-4 py-3 rounded-lg border border-gray-200 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200"
id="login-password" type="password" placeholder="Password">
</div>
<button id="login-submit" class="w-full bg-blue-600 text-white py-3 rounded-lg font-semibold hover:bg-blue-700 transition mb-4">
Login
</button>
<div class="text-center">
<a href="#" class="text-blue-600 text-sm hover:underline">Forgot Password?</a>
</div>
<div class="flex items-center my-6">
<div class="flex-1 border-t border-gray-200"></div>
<span class="px-3 text-gray-400">or</span>
<div class="flex-1 border-t border-gray-200"></div>
</div>
<div class="space-y-3">
<button class="w-full flex items-center justify-center space-x-2 py-2.5 px-4 rounded-lg border border-gray-200 hover:bg-gray-50">
<i class="fab fa-google text-blue-600"></i>
<span>Continue with Google</span>
</button>
<button class="w-full flex items-center justify-center space-x-2 py-2.5 px-4 rounded-lg border border-gray-200 hover:bg-gray-50">
<i class="fab fa-facebook text-blue-600"></i>
<span>Continue with Facebook</span>
</button>
</div>
<p class="text-center text-gray-500 mt-6">
New to Flipkart? <a href="#" class="text-blue-600 hover:underline">Create an account</a>
</p>
</div>
</div>
</div>
</div>
<!-- Cart Sidebar -->
<div id="cart-sidebar" class="fixed inset-0 z-50 overflow-hidden hidden">
<div class="absolute inset-0 bg-black/30" id="cart-backdrop"></div>
<div class="absolute inset-y-0 right-0 w-full sm:w-96 bg-white cart-sidebar transform transition-transform duration-300 translate-x-full">
<div class="flex flex-col h-full">
<div class="p-6 border-b border-gray-200 flex items-center justify-between">
<h2 class="text-xl font-bold">My Cart</h2>
<button id="close-cart" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div id="cart-items" class="flex-1 overflow-y-auto p-6">
<div class="flex flex-col items-center justify-center h-full">
<div class="w-24 h-24 rounded-full bg-gray-100 flex items-center justify-center mb-4">
<i class="fas fa-shopping-cart text-gray-400 text-3xl"></i>
</div>
<h3 class="text-xl font-semibold mb-2">Your cart is empty</h3>
<p class="text-gray-500 text-center mb-6">Looks like you haven't added anything to your cart yet</p>
<button class="bg-blue-600 text-white px-6 py-2.5 rounded-lg hover:bg-blue-700 transition">
Continue Shopping
</button>
</div>
</div>
<div class="p-6 border-t border-gray-200">
<div class="flex justify-between mb-4">
<span>Subtotal (<span id="sidebar-item-count">0</span> items):</span>
<span id="cart-subtotal" class="font-bold text-lg">₹0</span>
</div>
<button id="checkout-btn" class="w-full bg-blue-600 text-white py-3 rounded-lg font-semibold hover:bg-blue-700 transition flex items-center justify-center">
<span>Proceed to Checkout</span>
<i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
</div>
</div>
</div>
<script>
// Cart functionality
let cart = [];
// Load cart from localStorage if available
if (localStorage.getItem('cart')) {
cart = JSON.parse(localStorage.getItem('cart'));
updateCartCount();
}
// Login modal functionality
const loginBtn = document.getElementById('login-btn');
const loginModal = document.getElementById('login-modal');
const closeLogin = document.getElementById('close-login');
const loginSubmit = document.getElementById('login-submit');
loginBtn.addEventListener('click', () => {
loginModal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
});
closeLogin.addEventListener('click', () => {
loginModal.classList.add('hidden');
document.body.style.overflow = '';
});
loginSubmit.addEventListener('click', () => {
const email = document.getElementById('login-email').value;
const password = document.getElementById('login-password').value;
if (email && password) {
showNotification('Logged in successfully!', 'success');
loginModal.classList.add('hidden');
document.body.style.overflow = '';
loginBtn.innerHTML = `
<i class="far fa-user-circle"></i>
<span>${email.split('@')[0]}</span>
`;
} else {
showNotification('Please fill all fields', 'error');
}
});
// Cart functionality
const cartButton = document.getElementById('cart-button');
const cartSidebar = document.getElementById('cart-sidebar');
const cartBackdrop = document.getElementById('cart-backdrop');
const closeCart = document.getElementById('close-cart');
const addToCartButtons = document.querySelectorAll('.add-to-cart');
cartButton.addEventListener('click', (e) => {
e.preventDefault();
cartSidebar.classList.remove('hidden');
setTimeout(() => {
cartSidebar.querySelector('div.cart-sidebar').style.transform = 'translateX(0)';
document.body.style.overflow = 'hidden';
}, 10);
updateCartSidebar();
});
const closeCartSidebar = () => {
cartSidebar.querySelector('div.cart-sidebar').style.transform = 'translateX(100%)';
setTimeout(() => {
cartSidebar.classList.add('hidden');
document.body.style.overflow = '';
}, 300);
};
closeCart.addEventListener('click', closeCartSidebar);
cartBackdrop.addEventListener('click', closeCartSidebar);
addToCartButtons.forEach(button => {
button.addEventListener('click', function() {
const id = this.getAttribute('data-id');
const name = this.getAttribute('data-name');
const price = parseFloat(this.getAttribute('data-price'));
addToCart(id, name, price);
});
});
function addToCart(id, name, price) {
const existingItem = cart.find(item => item.id === id);
if (existingItem) {
existingItem.quantity += 1;
} else {
cart.push({
id,
name,
price,
quantity: 1
});
}
// Save to localStorage
localStorage.setItem('cart', JSON.stringify(cart));
// Update UI
updateCartCount();
updateCartSidebar();
// Show notification
showNotification(`${name} added to cart!`, 'success');
// Open cart sidebar if it's not empty
if (cart.length === 1) {
cartSidebar.classList.remove('hidden');
setTimeout(() => {
cartSidebar.querySelector('div.cart-sidebar').style.transform = 'translateX(0)';
document.body.style.overflow = 'hidden';
}, 10);
}
}
function updateCartCount() {
const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);
document.getElementById('cart-count').textContent = totalItems;
}
function updateCartSidebar() {
const cartItemsContainer = document.getElementById('cart-items');
const sidebarItemCount = document.getElementById('sidebar-item-count');
const cartSubtotal = document.getElementById('cart-subtotal');
const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);
const subtotal = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0);
sidebarItemCount.textContent = totalItems;
cartSubtotal.textContent = `₹${subtotal.toLocaleString('en-IN')}`;
if (cart.length === 0) {
cartItemsContainer.innerHTML = `
<div class="flex flex-col items-center justify-center h-full">
<div class="w-24 h-24 rounded-full bg-gray-100 flex items-center justify-center mb-4">
<i class="fas fa-shopping-cart text-gray-400 text-3xl"></i>
</div>
<h3 class="text-xl font-semibold mb-2">Your cart is empty</h3>
<p class="text-gray-500 text-center mb-6">Looks like you haven't added anything to your cart yet</p>
<button class="bg-blue-600 text-white px-6 py-2.5 rounded-lg hover:bg-blue-700 transition">
Continue Shopping
</button>
</div>
`;
return;
}
let cartItemsHTML = '<div class="space-y-4">';
cart.forEach(item => {
const productImg = document.querySelector(`.add-to-cart[data-id="${item.id}"]`).closest('.product-card').querySelector('.product-img').src;
cartItemsHTML += `
<div class="flex items-start p-3 rounded-lg bg-gray-50">
<div class="w-20 h-20 rounded-md bg-white border border-gray-200 overflow-hidden mr-4 flex-shrink-0">
<img src="${productImg}" alt="${item.name}" class="w-full h-full object-contain">
</div>
<div class="flex-1">
<h3 class="text-sm font-semibold text-gray-800">${item.name}</h3>
<div class="flex items-center justify-between mt-1">
<span class="text-sm font-bold text-gray-700">₹${item.price.toLocaleString('en-IN')}</span>
<div class="flex items-center">
<button class="quantity-btn w-6 h-6 flex items-center justify-center bg-gray-200 rounded-l-md" data-id="${item.id}" data-action="decrease">
<i class="fas fa-minus text-xs"></i>
</button>
<span class="w-8 text-center">${item.quantity}</span>
<button class="quantity-btn w-6 h-6 flex items-center justify-center bg-gray-200 rounded-r-md" data-id="${item.id}" data-action="increase">
<i class="fas fa-plus text-xs"></i>
</button>
</div>
</div>
</div>
<button class="remove-item ml-2 text-gray-400 hover:text-red-500 transition" data-id="${item.id}">
<i class="fas fa-trash-alt text-sm"></i>
</button>
</div>
`;
});
cartItemsHTML += '</div>';
cartItemsContainer.innerHTML = cartItemsHTML;
// Add event listeners to remove buttons
document.querySelectorAll('.remove-item').forEach(button => {
button.addEventListener('click', function() {
const id = this.getAttribute('data-id');
removeFromCart(id);
});
});
// Add event listeners to quantity buttons
document.querySelectorAll('.quantity-btn').forEach(button => {
button.addEventListener('click', function() {
const id = this.getAttribute('data-id');
const action = this.getAttribute('data-action');
updateQuantity(id, action);
});
});
}
function updateQuantity(id, action) {
const item = cart.find(item => item.id === id);
if (action === 'increase') {
item.quantity += 1;
} else if (action === 'decrease' && item.quantity > 1) {
item.quantity -= 1;
}
localStorage.setItem('cart', JSON.stringify(cart));
updateCartCount();
updateCartSidebar();
}
function removeFromCart(id) {
cart = cart.filter(item => item.id !== id);
localStorage.setItem('cart', JSON.stringify(cart));
updateCartCount();
updateCartSidebar();
showNotification('Item removed from cart', 'success');
}
// Checkout button
document.getElementById('checkout-btn').addEventListener('click', () => {
if (cart.length === 0) {
showNotification('Your cart is empty!', 'error');
return;
}
showNotification('Proceeding to checkout!', 'success');
closeCartSidebar();
// Here you would typically redirect to a checkout page
});
// Notification system
function showNotification(message, type) {
const notificationArea = document.getElementById('notification-area');
const notification = document.createElement('div');
notification.className = `notification px-4 py-3 rounded-lg shadow-md flex items-center ${type === 'success' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'}`;
notification.innerHTML = `
<i class="${type === 'success' ? 'fas fa-check-circle' : 'fas fa-exclamation-circle'} mr-2"></i>
<span class="flex-1 text-sm">${message}</span>
<button class="ml-4 -mr-1">
<i class="fas fa-times"></i>
</button>
`;
notificationArea.appendChild(notification);
// Auto remove notification after 3 seconds
const timeout = setTimeout(() => {
notification.style.opacity = '0';
setTimeout(() => {
notification.remove();
}, 300);
}, 3000);
// Add click to dismiss
notification.querySelector('button').addEventListener('click', () => {
clearTimeout(timeout);
notification.remove();
});
}
// Close modals when clicking outside
window.addEventListener('click', (e) => {
if (e.target === loginModal) {
loginModal.classList.add('hidden');
document.body.style.overflow = '';
}
});
// Product search functionality (simplified)
document.querySelectorAll('.search-bar button').forEach(button => {
button.addEventListener('click', () => {
const input = button.closest('.search-bar').querySelector('input');
const query = input.value.trim();
if (query) {
showNotification(`Searching for: ${query}`, 'success');
input.value = '';
}
});
});
// Allow search on Enter key
document.querySelectorAll('.search-bar input').forEach(input => {
input.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
const query = input.value.trim();
if (query) {
showNotification(`Searching for: ${query}`, 'success');
input.value = '';
}
}
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=junglicheats/hi" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
</html> |