// Sample data - in a real app, this would come from an API const cpuData = [ // Intel 13th Gen { id: 1, name: "Intel Core i9-13900K", cores: 24, threads: 32, baseClock: 3.0, boostClock: 5.8, tdp: 125 }, { id: 2, name: "Intel Core i7-13700K", cores: 16, threads: 24, baseClock: 3.4, boostClock: 5.4, tdp: 125 }, { id: 3, name: "Intel Core i5-13600K", cores: 14, threads: 20, baseClock: 3.5, boostClock: 5.1, tdp: 125 }, { id: 4, name: "Intel Core i9-13900", cores: 24, threads: 32, baseClock: 2.0, boostClock: 5.6, tdp: 65 }, { id: 5, name: "Intel Core i7-13700", cores: 16, threads: 24, baseClock: 2.1, boostClock: 5.2, tdp: 65 }, { id: 6, name: "Intel Core i5-13600", cores: 14, threads: 20, baseClock: 2.7, boostClock: 5.0, tdp: 65 }, // Intel 12th Gen { id: 7, name: "Intel Core i9-12900K", cores: 16, threads: 24, baseClock: 3.2, boostClock: 5.2, tdp: 125 }, { id: 8, name: "Intel Core i7-12700K", cores: 12, threads: 20, baseClock: 3.6, boostClock: 5.0, tdp: 125 }, { id: 9, name: "Intel Core i5-12600K", cores: 10, threads: 16, baseClock: 3.7, boostClock: 4.9, tdp: 125 }, { id: 10, name: "Intel Core i9-12900", cores: 16, threads: 24, baseClock: 2.4, boostClock: 5.1, tdp: 65 }, { id: 11, name: "Intel Core i7-12700", cores: 12, threads: 20, baseClock: 2.1, boostClock: 4.9, tdp: 65 }, { id: 12, name: "Intel Core i5-12600", cores: 6, threads: 12, baseClock: 3.3, boostClock: 4.8, tdp: 65 }, // AMD Ryzen 7000 Series { id: 13, name: "AMD Ryzen 9 7950X", cores: 16, threads: 32, baseClock: 4.5, boostClock: 5.7, tdp: 170 }, { id: 14, name: "AMD Ryzen 9 7900X", cores: 12, threads: 24, baseClock: 4.7, boostClock: 5.6, tdp: 170 }, { id: 15, name: "AMD Ryzen 7 7800X3D", cores: 8, threads: 16, baseClock: 4.2, boostClock: 5.0, tdp: 120 }, { id: 16, name: "AMD Ryzen 7 7700X", cores: 8, threads: 16, baseClock: 4.5, boostClock: 5.4, tdp: 105 }, { id: 17, name: "AMD Ryzen 5 7600X", cores: 6, threads: 12, baseClock: 4.7, boostClock: 5.3, tdp: 105 }, // AMD Ryzen 5000 Series { id: 18, name: "AMD Ryzen 9 5950X", cores: 16, threads: 32, baseClock: 3.4, boostClock: 4.9, tdp: 105 }, { id: 19, name: "AMD Ryzen 9 5900X", cores: 12, threads: 24, baseClock: 3.7, boostClock: 4.8, tdp: 105 }, { id: 20, name: "AMD Ryzen 7 5800X3D", cores: 8, threads: 16, baseClock: 3.4, boostClock: 4.5, tdp: 105 }, { id: 21, name: "AMD Ryzen 7 5800X", cores: 8, threads: 16, baseClock: 3.8, boostClock: 4.7, tdp: 105 }, { id: 22, name: "AMD Ryzen 5 5600X", cores: 6, threads: 12, baseClock: 3.7, boostClock: 4.6, tdp: 65 }, // AMD Ryzen 3000 Series { id: 23, name: "AMD Ryzen 9 3950X", cores: 16, threads: 32, baseClock: 3.5, boostClock: 4.7, tdp: 105 }, { id: 24, name: "AMD Ryzen 9 3900X", cores: 12, threads: 24, baseClock: 3.8, boostClock: 4.6, tdp: 105 }, { id: 25, name: "AMD Ryzen 7 3800X", cores: 8, threads: 16, baseClock: 3.9, boostClock: 4.5, tdp: 105 }, { id: 26, name: "AMD Ryzen 7 3700X", cores: 8, threads: 16, baseClock: 3.6, boostClock: 4.4, tdp: 65 }, { id: 27, name: "AMD Ryzen 5 3600X", cores: 6, threads: 12, baseClock: 3.8, boostClock: 4.4, tdp: 95 }, { id: 28, name: "AMD Ryzen 5 3600", cores: 6, threads: 12, baseClock: 3.6, boostClock: 4.2, tdp: 65 }, // Budget Options { id: 29, name: "Intel Core i3-13100", cores: 4, threads: 8, baseClock: 3.4, boostClock: 4.5, tdp: 60 }, { id: 30, name: "Intel Core i3-12100", cores: 4, threads: 8, baseClock: 3.3, boostClock: 4.3, tdp: 60 }, { id: 31, name: "AMD Ryzen 5 5500", cores: 6, threads: 12, baseClock: 3.6, boostClock: 4.2, tdp: 65 }, { id: 32, name: "AMD Ryzen 3 3300X", cores: 4, threads: 8, baseClock: 3.8, boostClock: 4.3, tdp: 65 } ]; const gpuData = [ { id: 1, name: "NVIDIA RTX 4090", vram: 24, baseClock: 2235, boostClock: 2520, tdp: 450 }, { id: 2, name: "AMD RX 7900 XTX", vram: 24, baseClock: 1900, boostClock: 2500, tdp: 355 }, { id: 3, name: "NVIDIA RTX 4080", vram: 16, baseClock: 2205, boostClock: 2505, tdp: 320 }, { id: 4, name: "AMD RX 7900 XT", vram: 20, baseClock: 1500, boostClock: 2400, tdp: 300 }, { id: 5, name: "NVIDIA RTX 4070 Ti", vram: 12, baseClock: 2310, boostClock: 2610, tdp: 285 }, { id: 6, name: "AMD RX 7800 XT", vram: 16, baseClock: 1800, boostClock: 2430, tdp: 263 }, { id: 7, name: "NVIDIA RTX 3090 Ti", vram: 24, baseClock: 1560, boostClock: 1860, tdp: 450 }, { id: 8, name: "AMD RX 6950 XT", vram: 16, baseClock: 1890, boostClock: 2310, tdp: 335 }, { id: 9, name: "NVIDIA RTX 3080 Ti", vram: 12, baseClock: 1365, boostClock: 1665, tdp: 350 }, { id: 10, name: "AMD RX 6800 XT", vram: 16, baseClock: 1825, boostClock: 2250, tdp: 300 }, ]; // DOM elements const cpuList = document.getElementById('cpu-list'); const gpuList = document.getElementById('gpu-list'); const cpuSearch = document.getElementById('cpu-search'); const gpuSearch = document.getElementById('gpu-search'); const calculateBtn = document.getElementById('calculate-btn'); const resultContainer = document.getElementById('result-container'); const selectedCpu = document.getElementById('selected-cpu'); const selectedGpu = document.getElementById('selected-gpu'); const bottleneckPercentage = document.getElementById('bottleneck-percentage'); const bottleneckMeter = document.getElementById('bottleneck-meter'); const recommendations = document.getElementById('recommendations'); const resolutionSelect = document.getElementById('resolution-select'); // Selected components let selectedCPU = null; let selectedGPU = null; // Initialize the component lists function initComponentLists() { renderCPUList(cpuData); renderGPUList(gpuData); } // Render CPU list function renderCPUList(cpus) { cpuList.innerHTML = ''; cpus.forEach(cpu => { const li = document.createElement('li'); li.className = 'px-4 py-3 hover:bg-gray-50 cursor-pointer'; li.dataset.id = cpu.id; li.innerHTML = `