Spaces:
Running
Running
File size: 37,605 Bytes
4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 ef9e54e 4c31fe4 | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Qubit - Premium Software Licenses</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Poppins', sans-serif;
background-color: #F9FAFB;
color: #1F1F1F;
}
.modal-enter {
opacity: 0;
transform: scale(0.9);
}
.modal-enter-active {
opacity: 1;
transform: scale(1);
transition: all 0.3s ease;
}
.modal-exit {
opacity: 1;
}
.modal-exit-active {
opacity: 0;
transform: scale(0.9);
transition: all 0.3s ease;
}
.fade-in {
animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.slide-up {
animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
from { transform: translateY(20px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
</style>
</head>
<body class="min-h-screen">
<!-- Navigation -->
<nav class="bg-white shadow-sm sticky top-0 z-40">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<span class="text-xl font-bold text-[#1F1F1F]">Qubit</span>
</div>
</div>
<div class="hidden md:ml-6 md:flex md:items-center md:space-x-8">
<a href="#products" class="text-[#1F1F1F] hover:text-[#5A96E3] px-3 py-2 text-sm font-medium transition-colors duration-300">Products</a>
<a href="#contact" class="text-[#1F1F1F] hover:text-[#5A96E3] px-3 py-2 text-sm font-medium transition-colors duration-300">Contact</a>
</div>
<div class="-mr-2 flex items-center md:hidden">
<button type="button" id="mobile-menu-button" class="inline-flex items-center justify-center p-2 rounded-md text-[#1F1F1F] hover:text-[#5A96E3] focus:outline-none">
<i data-feather="menu"></i>
</button>
</div>
</div>
</div>
<!-- Mobile menu -->
<div id="mobile-menu" class="hidden md:hidden bg-white shadow-lg">
<div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<a href="#products" class="block px-3 py-2 text-base font-medium text-[#1F1F1F] hover:text-[#5A96E3]">Products</a>
<a href="#contact" class="block px-3 py-2 text-base font-medium text-[#1F1F1F] hover:text-[#5A96E3]">Contact</a>
</div>
</div>
</nav>
<!-- Hero Section -->
<div class="bg-white">
<div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8 lg:py-20">
<div class="lg:text-center">
<h1 class="text-4xl tracking-tight font-extrabold text-[#1F1F1F] sm:text-5xl md:text-6xl">
<span class="block">Premium Software</span>
<span class="block text-[#5A96E3]">At Unbeatable Prices</span>
</h1>
<p class="mt-3 max-w-md mx-auto text-base text-[#9CA3AF] sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
Get genuine software licenses for your business at discounted rates. Instant delivery, lifetime support.
</p>
<div class="mt-8 flex justify-center">
<a href="#products" class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-2xl shadow-sm text-white bg-[#5A96E3] hover:bg-[#4a7dc2] transition-colors duration-300">
Browse Products
</a>
</div>
</div>
</div>
</div>
<!-- Products Section -->
<section id="products" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="flex flex-col md:flex-row justify-between items-center mb-8">
<h2 class="text-3xl font-bold text-[#1F1F1F] mb-4 md:mb-0">Our Software Collection</h2>
<div class="w-full md:w-auto flex flex-col space-y-3 md:flex-row md:space-y-0 md:space-x-3">
<div class="relative">
<input type="text" id="search" placeholder="Search products..." class="w-full md:w-64 px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
<i data-feather="search" class="absolute right-3 top-2.5 text-[#9CA3AF]"></i>
</div>
<select id="sort" class="px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
<option value="name-asc">Name (A-Z)</option>
<option value="name-desc">Name (Z-A)</option>
<option value="price-asc">Price (Low to High)</option>
<option value="price-desc">Price (High to Low)</option>
</select>
</div>
</div>
<!-- Category Chips -->
<div class="flex flex-wrap gap-2 mb-8" id="category-filters">
<button class="category-chip px-4 py-1 rounded-full bg-[#5A96E3] text-white text-sm font-medium" data-category="all">All</button>
<!-- Categories will be added dynamically -->
</div>
<!-- Products Grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6" id="products-grid">
<!-- Products will be loaded here -->
<div class="text-center py-8">
<div class="animate-pulse flex space-x-4">
<div class="flex-1 space-y-4 py-1">
<div class="h-4 bg-[#9CA3AF] rounded w-3/4 mx-auto"></div>
<div class="space-y-2">
<div class="h-4 bg-[#9CA3AF] rounded"></div>
<div class="h-4 bg-[#9CA3AF] rounded w-5/6"></div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="bg-white py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="lg:text-center mb-12">
<h2 class="text-3xl font-bold text-[#1F1F1F]">Get In Touch</h2>
<p class="mt-2 max-w-2xl text-lg text-[#9CA3AF] lg:mx-auto">
Have questions? Reach out to us anytime.
</p>
</div>
<div class="mt-10 sm:mt-20">
<div class="grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3">
<div class="bg-[#F9FAFB] p-6 rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-300">
<div class="flex items-center">
<div class="flex-shrink-0 bg-[#5A96E3] p-3 rounded-full text-white">
<i data-feather="mail"></i>
</div>
<div class="ml-4">
<h3 class="text-lg font-medium text-[#1F1F1F]">Email</h3>
<p class="mt-1 text-sm text-[#9CA3AF]">We'll respond within 24 hours</p>
<p class="mt-2 text-sm text-[#5A96E3]">app.qubit@gmail.com</p>
</div>
</div>
</div>
<div class="bg-[#F9FAFB] p-6 rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-300">
<div class="flex items-center">
<div class="flex-shrink-0 bg-[#5A96E3] p-3 rounded-full text-white">
<i data-feather="message-square"></i>
</div>
<div class="ml-4">
<h3 class="text-lg font-medium text-[#1F1F1F]">WhatsApp</h3>
<p class="mt-1 text-sm text-[#9CA3AF]">Instant response during business hours</p>
<p class="mt-2 text-sm text-[#5A96E3]">+91 9855990775</p>
</div>
</div>
</div>
<div class="bg-[#F9FAFB] p-6 rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-300">
<div class="flex items-center">
<div class="flex-shrink-0 bg-[#5A96E3] p-3 rounded-full text-white">
<i data-feather="clock"></i>
</div>
<div class="ml-4">
<h3 class="text-lg font-medium text-[#1F1F1F]">Business Hours</h3>
<p class="mt-1 text-sm text-[#9CA3AF]">Monday - Friday</p>
<p class="mt-2 text-sm text-[#5A96E3]">10:00 AM - 7:00 PM IST</p>
</div>
</div>
</div>
</div>
</div>
<!-- Contact Form -->
<div class="mt-16 bg-[#F9FAFB] p-6 sm:p-8 rounded-2xl shadow-sm">
<h3 class="text-xl font-medium text-[#1F1F1F] mb-6">Send us a message</h3>
<form class="space-y-6">
<div>
<label for="name" class="block text-sm font-medium text-[#1F1F1F]">Your Name</label>
<input type="text" id="name" name="name" class="mt-1 block w-full px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
</div>
<div>
<label for="email" class="block text-sm font-medium text-[#1F1F1F]">Email Address</label>
<input type="email" id="email" name="email" class="mt-1 block w-full px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
</div>
<div>
<label for="message" class="block text-sm font-medium text-[#1F1F1F]">Message</label>
<textarea id="message" name="message" rows="4" class="mt-1 block w-full px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent"></textarea>
</div>
<div>
<button type="submit" class="w-full flex justify-center items-center px-6 py-3 border border-transparent text-base font-medium rounded-2xl shadow-sm text-white bg-[#5A96E3] hover:bg-[#4a7dc2] transition-colors duration-300">
Send Message
</button>
</div>
</form>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-[#1F1F1F] text-white py-8">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<span class="text-xl font-bold">Qubit</span>
<p class="text-sm text-[#9CA3AF] mt-1">Premium software at discounted prices</p>
</div>
<div class="flex space-x-6">
<a href="#" class="text-[#9CA3AF] hover:text-white transition-colors duration-300">
<i data-feather="message-square"></i>
</a>
<a href="#" class="text-[#9CA3AF] hover:text-white transition-colors duration-300">
<i data-feather="mail"></i>
</a>
</div>
</div>
<div class="mt-8 pt-8 border-t border-[#9CA3AF]/10">
<p class="text-sm text-[#9CA3AF] text-center">© 2025 Qubit. All rights reserved.</p>
</div>
</div>
</footer>
<!-- Product Modal -->
<div id="product-modal" class="hidden fixed inset-0 z-50 overflow-y-auto">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-[#1F1F1F] opacity-75 backdrop-blur-sm"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full w-full max-w-md">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="flex justify-between items-start">
<div>
<h3 id="modal-title" class="text-xl font-bold text-[#1F1F1F]"></h3>
<p id="modal-category" class="text-sm text-[#9CA3AF] mt-1"></p>
</div>
<button type="button" id="close-modal" class="text-[#9CA3AF] hover:text-[#1F1F1F] focus:outline-none">
<i data-feather="x"></i>
</button>
</div>
<div class="mt-4">
<img id="modal-image" src="" alt="" class="w-full h-48 object-contain rounded-lg">
<p id="modal-description" class="mt-4 text-sm text-[#1F1F1F]"></p>
<div class="mt-6">
<label for="modal-validity" class="block text-sm font-medium text-[#1F1F1F]">Select Validity</label>
<select id="modal-validity" class="mt-1 block w-full px-4 py-2 rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
<option value="1 Month">1 Month</option>
<option value="3 Months">3 Months</option>
<option value="6 Months">6 Months</option>
</select>
</div>
<div class="mt-4">
<p class="text-sm font-medium text-[#1F1F1F]">Price</p>
<p id="modal-price" class="text-2xl font-bold text-[#5A96E3] mt-1"></p>
</div>
</div>
</div>
<div class="bg-[#F9FAFB] px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" id="modal-buy-button" class="w-full inline-flex justify-center rounded-2xl border border-transparent shadow-sm px-4 py-2 bg-[#5A96E3] text-base font-medium text-white hover:bg-[#4a7dc2] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#5A96E3] sm:ml-3 sm:w-auto sm:text-sm transition-colors duration-300">
Buy on WhatsApp
</button>
<button type="button" id="modal-cancel-button" class="mt-3 w-full inline-flex justify-center rounded-2xl border border-[#9CA3AF] shadow-sm px-4 py-2 bg-white text-base font-medium text-[#1F1F1F] hover:bg-[#F9FAFB] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#5A96E3] sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm transition-colors duration-300">
Cancel
</button>
</div>
</div>
</div>
</div>
<script>
function getPriceByValidity(product, validity) {
if (validity === "1 Month") return product.Price_1M;
if (validity === "3 Months") return product.Price_3M;
if (validity === "6 Months") return product.Price_6M;
return "Not available";
}
document.addEventListener('DOMContentLoaded', function() {
// Initialize Feather Icons
feather.replace();
// Mobile menu toggle
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
mobileMenuButton.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
const icon = mobileMenuButton.querySelector('i');
if (mobileMenu.classList.contains('hidden')) {
icon.setAttribute('data-feather', 'menu');
} else {
icon.setAttribute('data-feather', 'x');
}
feather.replace();
});
// Fetch products from Notion
const productsGrid = document.getElementById('products-grid');
const categoryFilters = document.getElementById('category-filters');
const searchInput = document.getElementById('search');
const sortSelect = document.getElementById('sort');
let products = [];
let categories = new Set();
fetchProducts();
async function fetchProducts() {
try {
const response = await fetch('https://notion-api.splitbee.io/v1/table/22e3b1395b1380bfa27ccf729d087255?v=22e3b1395b138018b955000cea8ee8f8');
products = await response.json();
// Process products
products.forEach(product => {
if (product.Category) {
categories.add(product.Category);
}
});
// Add category filters
categories.forEach(category => {
const chip = document.createElement('button');
chip.className = 'category-chip px-4 py-1 rounded-full bg-white text-[#1F1F1F] border border-[#9CA3AF] text-sm font-medium hover:bg-[#5A96E3] hover:text-white transition-colors duration-300';
chip.textContent = category;
chip.dataset.category = category;
categoryFilters.appendChild(chip);
});
renderProducts(products);
setupEventListeners();
} catch (error) {
console.error('Error fetching products:', error);
productsGrid.innerHTML = `
<div class="col-span-full text-center py-12">
<i data-feather="alert-triangle" class="w-12 h-12 text-[#9CA3AF] mx-auto"></i>
<p class="mt-4 text-[#9CA3AF]">Failed to load products. Please try again later.</p>
<button onclick="fetchProducts()" class="mt-4 px-4 py-2 bg-[#5A96E3] text-white rounded-2xl hover:bg-[#4a7dc2] transition-colors duration-300">
Retry
</button>
</div>
`;
feather.replace();
}
}
function renderProducts(productsToRender) {
productsGrid.innerHTML = '';
if (productsToRender.length === 0) {
productsGrid.innerHTML = `
<div class="col-span-full text-center py-12">
<i data-feather="search" class="w-12 h-12 text-[#9CA3AF] mx-auto"></i>
<p class="mt-4 text-[#9CA3AF]">No products found matching your criteria.</p>
</div>
`;
feather.replace();
return;
}
productsToRender.forEach(product => {
const productCard = document.createElement('div');
productCard.className = 'bg-white rounded-2xl shadow-sm hover:shadow-md overflow-hidden transition-all duration-300 hover:scale-[1.02] slide-up';
productCard.innerHTML = `
<div class="relative">
${product.Trending ? '<span class="absolute top-2 left-2 bg-[#5A96E3] text-white text-xs font-bold px-2 py-1 rounded-full">Trending</span>' : ''}
<img src="${product['Image URL'] || 'https://via.placeholder.com/300x150?text=No+Image'}" alt="${product.Name}" class="w-full h-40 object-contain p-4">
</div>
<div class="p-4">
<h3 class="text-lg font-bold text-[#1F1F1F] truncate">${product.Name}</h3>
<p class="text-sm text-[#9CA3AF] mt-1">${product.Category || 'Software'}</p>
<div class="mt-4">
<label for="validity-${product.id}" class="block text-sm font-medium text-[#1F1F1F]">Validity</label>
<select id="validity-${product.id}" class="product-validity mt-1 block w-full px-3 py-1.5 text-sm rounded-2xl border border-[#9CA3AF] focus:outline-none focus:ring-2 focus:ring-[#5A96E3] focus:border-transparent">
<option value="1 Month">1 Month</option>
<option value="3 Months">3 Months</option>
<option value="6 Months">6 Months</option>
</select>
</div>
<div class="mt-3 flex justify-between items-center">
<p class="text-sm font-medium text-[#1F1F1F]">Price:</p>
<p class="product-price text-lg font-bold text-[#5A96E3]" data-price-1m="${product.Price_1M}" data-price-3m="${product.Price_3M}" data-price-6m="${product.Price_6M}">
₹${product.Price_1M}
</p>
</div>
<div class="mt-4 flex space-x-2">
<button class="view-details-btn w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl text-[#5A96E3] bg-[#5A96E3]/10 hover:bg-[#5A96E3]/20 transition-colors duration-300" data-product-id="${product.id}">
Details
</button>
<button class="buy-btn w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-[#5A96E3] hover:bg-[#4a7dc2] transition-colors duration-300" data-product-id="${product.id}">
Buy
</button>
</div>
</div>
`;
productsGrid.appendChild(productCard);
});
feather.replace();
}
function setupEventListeners() {
// Validity change handlers
document.querySelectorAll('.product-validity').forEach(select => {
select.addEventListener('change', function() {
const priceElement = this.closest('.bg-white').querySelector('.product-price');
const price1 = priceElement.dataset.price1;
const price3 = priceElement.dataset.price3;
const price12 = priceElement.dataset.price12;
const validity = this.value;
const productId = this.id.split('-')[1];
const product = products.find(p => p.id === productId);
const price = getPriceByValidity(product, validity);
priceElement.textContent = `₹${price}`;
});
});
// Buy button handlers
document.querySelectorAll('.buy-btn').forEach(button => {
button.addEventListener('click', function() {
const productId = this.dataset.productId;
const product = products.find(p => p.id === productId);
const validitySelect = document.getElementById(`validity-${productId}`);
const validity = validitySelect.value;
let validityText = '';
let price = '';
validityText = validity;
price = getPriceByValidity(product, validity);
const message = `Hi! I want to purchase ${product.Name} with ${validityText} validity for ₹${price}. Please send more details.`;
const encodedMessage = encodeURIComponent(message);
window.open(`https://wa.me/919855990775?text=${encodedMessage}`, '_blank');
});
});
// View details button handlers
document.querySelectorAll('.view-details-btn').forEach(button => {
button.addEventListener('click', function() {
const productId = this.dataset.productId;
const product = products.find(p => p.id === productId);
openProductModal(product);
});
});
// Category filter handlers
document.querySelectorAll('.category-chip').forEach(chip => {
chip.addEventListener('click', function() {
// Update active chip
document.querySelectorAll('.category-chip').forEach(c => {
if (c.dataset.category === 'all') {
c.classList.remove('bg-[#5A96E3]', 'text-white');
c.classList.add('bg-white', 'text-[#1F1F1F]', 'border', 'border-[#9CA3AF]');
} else {
c.classList.remove('bg-[#5A96E3]', 'text-white');
c.classList.add('bg-white', 'text-[#1F1F1F]', 'border', 'border-[#9CA3AF]');
}
});
this.classList.remove('bg-white', 'text-[#1F1F1F]', 'border', 'border-[#9CA3AF]');
this.classList.add('bg-[#5A96E3]', 'text-white');
// Filter products
const category = this.dataset.category;
let filteredProducts = [...products];
if (category !== 'all') {
filteredProducts = products.filter(product => product.Category === category);
}
// Apply search and sort
filteredProducts = filterAndSortProducts(filteredProducts);
renderProducts(filteredProducts);
setupEventListeners();
});
});
// Search input handler
searchInput.addEventListener('input', function() {
const searchTerm = this.value.toLowerCase();
let filteredProducts = [...products];
// Apply category filter
const activeCategory = document.querySelector('.category-chip.bg-[#5A96E3]');
if (activeCategory && activeCategory.dataset.category !== 'all') {
filteredProducts = products.filter(product => product.Category === activeCategory.dataset.category);
}
// Apply search
if (searchTerm) {
filteredProducts = filteredProducts.filter(product =>
product.Name.toLowerCase().includes(searchTerm) ||
(product.Description && product.Description.toLowerCase().includes(searchTerm))
);
}
// Apply sort
filteredProducts = sortProducts(filteredProducts, sortSelect.value);
renderProducts(filteredProducts);
setupEventListeners();
});
// Sort select handler
sortSelect.addEventListener('change', function() {
let filteredProducts = [...products];
// Apply category filter
const activeCategory = document.querySelector('.category-chip.bg-[#5A96E3]');
if (activeCategory && activeCategory.dataset.category !== 'all') {
filteredProducts = products.filter(product => product.Category === activeCategory.dataset.category);
}
// Apply search
const searchTerm = searchInput.value.toLowerCase();
if (searchTerm) {
filteredProducts = filteredProducts.filter(product =>
product.Name.toLowerCase().includes(searchTerm) ||
(product.Description && product.Description.toLowerCase().includes(searchTerm))
);
}
// Apply sort
filteredProducts = sortProducts(filteredProducts, this.value);
renderProducts(filteredProducts);
setupEventListeners();
});
}
function filterAndSortProducts(productsToFilter) {
// Apply search
const searchTerm = searchInput.value.toLowerCase();
let filteredProducts = [...productsToFilter];
if (searchTerm) {
filteredProducts = filteredProducts.filter(product =>
product.Name.toLowerCase().includes(searchTerm) ||
(product.Description && product.Description.toLowerCase().includes(searchTerm))
);
}
// Apply sort
return sortProducts(filteredProducts, sortSelect.value);
}
function sortProducts(productsToSort, sortOption) {
return [...productsToSort].sort((a, b) => {
switch(sortOption) {
case 'name-asc':
return a.Name.localeCompare(b.Name);
case 'name-desc':
return b.Name.localeCompare(a.Name);
case 'price-asc':
return (a['Price - 1 Month'] || 0) - (b['Price - 1 Month'] || 0);
case 'price-desc':
return (b['Price - 1 Month'] || 0) - (a['Price - 1 Month'] || 0);
default:
return 0;
}
});
}
// Product modal functions
function openProductModal(product) {
const modal = document.getElementById('product-modal');
const modalTitle = document.getElementById('modal-title');
const modalCategory = document.getElementById('modal-category');
const modalImage = document.getElementById('modal-image');
const modalDescription = document.getElementById('modal-description');
const modalPrice = document.getElementById('modal-price');
const modalBuyButton = document.getElementById('modal-buy-button');
modalTitle.textContent = product.Name;
modalCategory.textContent = product.Category || 'Software';
modalImage.src = product['Image URL'] || 'https://via.placeholder.com/300x150?text=No+Image';
modalImage.alt = product.Name;
modalDescription.textContent = product.Description || 'No description available.';
modalPrice.textContent = `₹${product['Price - 1 Month']}`;
// Set up validity selector
const validitySelect = document.getElementById('modal-validity');
validitySelect.value = '1';
validitySelect.addEventListener('change', function() {
const validity = this.value;
const price = getPriceByValidity(product, validity);
modalPrice.textContent = `₹${price}`;
});
// Set up buy button
modalBuyButton.onclick = function() {
let validityText = '';
let price = '';
switch(validitySelect.value) {
case '1':
validityText = '1 Month';
price = product['Price - 1 Month'];
break;
case '3':
validityText = '3 Months';
price = product['Price - 3 Months'];
break;
case '12':
validityText = '1 Year';
price = product['Price - 1 Year'];
break;
}
const message = `Hi! I want to purchase ${product.Name} with ${validityText} validity for ₹${price}. Please send more details.`;
const encodedMessage = encodeURIComponent(message);
window.open(`https://wa.me/919855990775?text=${encodedMessage}`, '_blank');
};
// Show modal
modal.classList.remove('hidden');
modal.classList.add('fade-in');
// Close modal handlers
document.getElementById('close-modal').onclick = function() {
modal.classList.add('hidden');
modal.classList.remove('fade-in');
};
document.getElementById('modal-cancel-button').onclick = function() {
modal.classList.add('hidden');
modal.classList.remove('fade-in');
};
// Close when clicking outside modal
modal.addEventListener('click', function(e) {
if (e.target === modal) {
modal.classList.add('hidden');
modal.classList.remove('fade-in');
}
});
feather.replace();
}
});
</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=krish95/software-website" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |