// Initialize AOS AOS.init({ duration: 1000, once: true, offset: 100 }); // Parallax Effect window.addEventListener('scroll', () => { const scrolled = window.pageYOffset; const parallaxElements = document.querySelectorAll('.parallax-layer'); parallaxElements.forEach(element => { const speed = element.dataset.speed || 0.5; const yPos = -(scrolled * speed); element.style.transform = `translateY(${yPos}px)`; }); }); // Modal Functions function openModal(modalId) { const modal = document.getElementById(`${modalId}-modal`); modal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; if (modalId === 'coa') { setTimeout(() => initCharts(), 100); } } function closeModal(modalId) { const modal = document.getElementById(`${modalId}-modal`); modal.classList.add('hidden'); document.body.style.overflow = 'auto'; } function showProductDetails(productId) { const productData = { '7OH-Coffee': { title: '7OH-COFFEE TABLETS', content: `
7OH Coffee

SPECIFICATIONS

Active Compound 7-Hydroxymitragynine
Dosage 100mg per tablet
Tablets per Bottle 60 tablets
Flavor Premium Coffee

PRODUCT ANALYSIS

BATCH DATA

Purity 99.8%
Potency 98.5%
Dissolution Rate 95%
Stability 24 months
` }, 'Focus-Blend': { title: 'FOCUS BLEND', content: `
Focus Blend

SPECIFICATIONS

Active Compounds Multi-blend
Dosage 200mg per capsule
Capsules per Bottle 90 capsules
Type Cognitive Enhancer

PRODUCT ANALYSIS

BATCH DATA

Purity 99.2%
Potency 97.8%
Bioavailability 92%
Stability 18 months
` }, 'Recovery-Plus': { title: 'RECOVERY PLUS', content: `
Recovery Plus

SPECIFICATIONS

Active Compounds Recovery Matrix
Dosage 300mg per serving
Servings per Container 30 servings
Form Powder

PRODUCT ANALYSIS

BATCH DATA

Purity 98.9%
Potency 96.5%
Absorption Rate 88%
Stability 24 months
` } }; const product = productData[productId]; document.getElementById('product-title').textContent = product.title; document.getElementById('product-content').innerHTML = product.content; openModal('product'); setTimeout(() => initProductChart(), 100); } // Chart Functions function initCharts() { // Purity Chart const purityCtx = document.getElementById('purityChart').getContext('2d'); new Chart(purityCtx, { type: 'doughnut', data: { labels: ['Pure Compound', 'Other'], datasets: [{ data: [99.8, 0.2], backgroundColor: ['#22c55e', '#4a5568'], borderWidth: 0 }] }, options: { responsive: true, plugins: { legend: { labels: { color: '#ffffff' } }, title: { display: true, text: 'PURITY ANALYSIS', color: '#22c55e', font: { size: 16, family: 'Bebas Neue' } } } } }); // Compound Chart const compoundCtx = document.getElementById('compoundChart').getContext('2d'); new Chart(compoundCtx, { type: 'bar', data: { labels: ['7OH', 'MG', 'Alkaloids', 'Flavonoids'], datasets: [{ label: 'Concentration (%)', data: [45, 25, 20, 10], backgroundColor: '#22c55e', borderWidth: 0 }] }, options: { responsive: true, plugins: { legend: { labels: { color: '#ffffff' } }, title: { display: true, text: 'COMPOUND BREAKDOWN', color: '#22c55e', font: { size: 16, family: 'Bebas Neue' } } }, scales: { y: { ticks: { color: '#ffffff' }, grid: { color: 'rgba(255, 255, 255, 0.1)' } }, x: { ticks: { color: '#ffffff' }, grid: { color: 'rgba(255, 255, 255, 0.1)' } } } } }); } function initProductChart() { const productCtx = document.getElementById('productChart'); if (!productCtx) return; new Chart(productCtx.getContext('2d'), { type: 'radar', data: { labels: ['Purity', 'Potency', 'Bioavailability', 'Stability', 'Efficacy'], datasets: [{ label: 'Product Metrics', data: [99, 98, 95, 97, 96], backgroundColor: 'rgba(34, 197, 94, 0.2)', borderColor: '#22c55e', borderWidth: 2 }] }, options: { responsive: true, plugins: { legend: { labels: { color: '#ffffff' } } }, scales: { r: { angleLines: { color: 'rgba(255, 255, 255, 0.1)' }, grid: { color: 'rgba(255, 255, 255, 0.1)' }, pointLabels: { color: '#ffffff' }, ticks: { color: '#ffffff', backdropColor: 'transparent' } } } } }); } // Initialize Feather Icons feather.replace(); // Smooth scroll for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth' }); } }); });