Spaces:
Running

software-website / index.html
krish95's picture
Fix the product pricing logic on the website so that the correct price is shown based on the selected validity option from the dropdown. Each product object contains Notion fields: - Price_1M - Price_3M - Price_6M Bind the selected validity from the dropdown to dynamically show the correct price. Use this logic in the code: ```js 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"; } - Follow Up Deployment
ef9e54e verified
Raw History Blame Contribute Delete
37.6 kB
<!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">&#8203;</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>