Changed around line 1
+ const models = [
+ {
+ name: "OpenAI GPT-4",
+ speed: "Fast",
+ accuracy: "High",
+ pricing: "Paid",
+ expertise: "General Purpose",
+ imageUpload: false,
+ fileUpload: true
+ },
+ {
+ name: "Google Bard",
+ speed: "Medium",
+ accuracy: "High",
+ pricing: "Free",
+ expertise: "Research & Education",
+ imageUpload: true,
+ fileUpload: true
+ },
+ {
+ name: "Anthropic Claude",
+ speed: "Fast",
+ accuracy: "High",
+ pricing: "Paid",
+ expertise: "Business & Legal",
+ imageUpload: false,
+ fileUpload: false
+ },
+ {
+ name: "Cohere Command",
+ speed: "Fast",
+ accuracy: "Medium",
+ pricing: "Paid",
+ expertise: "Marketing & Sales",
+ imageUpload: false,
+ fileUpload: true
+ }
+ ];
+
+ const modelGrid = document.getElementById('modelGrid');
+ const searchInput = document.getElementById('searchInput');
+ const filterButtons = document.querySelectorAll('.filter-btn');
+
+ function renderModels(filteredModels) {
+ modelGrid.innerHTML = filteredModels.map(model => `
+
+
${model.name}
+
Accuracy: ${model.accuracy}
+
Pricing: ${model.pricing}
+
Expertise: ${model.expertise}
+
Image Upload: ${model.imageUpload ? 'Yes' : 'No'}
+
File Upload: ${model.fileUpload ? 'Yes' : 'No'}
+
+ `).join('');
+ }
+
+ function filterModels() {
+ const searchTerm = searchInput.value.toLowerCase();
+ const activeFilter = document.querySelector('.filter-btn.active')?.dataset.filter || 'all';
+
+ const filteredModels = models.filter(model => {
+ const matchesSearch = model.name.toLowerCase().includes(searchTerm);
+ const matchesFilter = activeFilter === 'all' ||
+ (activeFilter === 'free' && model.pricing === 'Free') ||
+ (activeFilter === 'paid' && model.pricing === 'Paid') ||
+ (activeFilter === 'image' && model.imageUpload) ||
+ (activeFilter === 'file' && model.fileUpload);
+ return matchesSearch && matchesFilter;
+ });
+
+ renderModels(filteredModels);
+ }
+
+ filterButtons.forEach(button => {
+ button.addEventListener('click', () => {
+ filterButtons.forEach(btn => btn.classList.remove('active'));
+ button.classList.add('active');
+ filterModels();
+ });
+ });
+
+ searchInput.addEventListener('input', filterModels);
+
+ // Initial render
+ renderModels(models);