document.addEventListener('DOMContentLoaded', () => { // 1. Mock Data const startups = [ { id: 1, name: "FinFlow", tagline: "Next-gen liquidity management for SMEs", irr: 25, pd: 5, fragility: 15, revenueConcentration: 20, sector: "Fintech", description: "FinFlow uses advanced AI to predict cash flow gaps and automate short-term financing for medium-sized enterprises. They have already secured partnerships with 3 major banks and have a growing user base.", growth: "15% MoM", funding: "$4.5M Series A", burnRate: "$150k/mo" }, { id: 2, name: "EcoPay", tagline: "Sustainable payments infrastructure", irr: 18, pd: 3, fragility: 10, revenueConcentration: 15, sector: "Payments", description: "EcoPay provides carbon-neutral payment processing. They offset the carbon footprint of every transaction and offer lower fees for green certified businesses.", growth: "8% MoM", funding: "$2.2M Seed", burnRate: "$60k/mo" }, { id: 3, name: "CyberShield", tagline: "Zero-trust cybersecurity for remote teams", irr: 30, pd: 12, fragility: 25, revenueConcentration: 40, sector: "Cybersecurity", description: "CyberShield offers a decentralized zero-trust network access (ZTNA) platform. High growth but operating in a highly competitive market with significant R&D spend.", growth: "25% MoM", funding: "$12M Series B", burnRate: "$450k/mo" }, { id: 4, name: "DataNexus", tagline: "Federated learning for enterprise data", irr: 22, pd: 7, fragility: 18, revenueConcentration: 25, sector: "Big Data/AI", description: "DataNexus enables companies to train machine learning models on sensitive data without moving it, preserving privacy and compliance.", growth: "12% MoM", funding: "$6M Series A", burnRate: "$200k/mo" }, { id: 5, name: "HealthBridge", tagline: "Telemedicine platform for rural healthcare", irr: 20, pd: 4, fragility: 12, revenueConcentration: 10, sector: "Healthtech", description: "HealthBridge connects rural clinics with specialist doctors via a low-bandwidth, high-security video and diagnostics platform.", growth: "10% MoM", funding: "$3.5M Series A", burnRate: "$110k/mo" } ]; // 2. Navigation Control const sections = ['hero', 'profile', 'results', 'detail']; const sidebar = document.getElementById('wrapper'); const sidebarToggle = document.getElementById('sidebarToggle'); const showSection = (sectionId) => { sections.forEach(s => { const el = document.getElementById(`${s}-section`); if (el) el.classList.add('d-none'); const navLink = document.querySelector(`.nav-link[data-section="${s}"]`); if (navLink) navLink.classList.remove('active'); }); const target = document.getElementById(`${sectionId}-section`); if (target) { target.classList.remove('d-none'); // Re-trigger fade-in animation target.style.animation = 'none'; target.offsetHeight; // trigger reflow target.style.animation = null; } const activeNav = document.querySelector(`.nav-link[data-section="${sectionId}"]`); if (activeNav) activeNav.classList.add('active'); // Scroll to top window.scrollTo(0, 0); }; // Sidebar Toggle if (sidebarToggle) { sidebarToggle.addEventListener('click', (e) => { e.preventDefault(); sidebar.classList.toggle('toggled'); }); } // Nav Link Clicks document.querySelectorAll('.nav-link, .navigate-btn').forEach(btn => { btn.addEventListener('click', (e) => { e.preventDefault(); const target = btn.dataset.section || btn.dataset.target; showSection(target); }); }); // 3. Profile Setup const minIrrInput = document.getElementById('min-irr'); const maxPdInput = document.getElementById('max-pd'); const irrValBadge = document.getElementById('irr-val'); const pdValBadge = document.getElementById('pd-val'); minIrrInput.addEventListener('input', () => { irrValBadge.textContent = `${minIrrInput.value}%`; }); maxPdInput.addEventListener('input', () => { pdValBadge.textContent = `${maxPdInput.value}%`; }); // 4. Matching Logic const matchBtn = document.getElementById('match-startups-btn'); const matchesContainer = document.getElementById('matches-container'); matchBtn.addEventListener('click', () => { const minIrr = parseFloat(minIrrInput.value); const maxPd = parseFloat(maxPdInput.value); // Filter & Calculate RAR let matches = startups.map(s => { return { ...s, rar: (s.irr * (1 - s.pd/100)).toFixed(2) }; }); // Filter based on user constraints matches = matches.filter(s => s.irr >= minIrr && s.pd <= maxPd); // Sort by RAR descending matches.sort((a, b) => b.rar - a.rar); // Take top 3 const topMatches = matches.slice(0, 3); renderMatches(topMatches); showSection('results'); }); const renderMatches = (matches) => { matchesContainer.innerHTML = ''; if (matches.length === 0) { matchesContainer.innerHTML = `
Try lowering your IRR requirement or increasing your PD allowance.
${s.tagline}
${s.description}
Simulated performance under varying market conditions (Fragility Score: ${s.fragility}).
Get direct access to their data room and contact the founding team.