Hey Builders, we're back!
`;
recordsContainer.innerHTML += recordData;
});
addReadMoreEvent();
};
// Function to add read more/less functionality
const addReadMoreEvent = () => {
let startups = document.querySelectorAll('.speaker-item');
startups.forEach(startup => {
startup.querySelector('.read-more-btn').addEventListener('click', function () {
startup.querySelector('.startup-description').classList.toggle('active');
if (startup.querySelector('.startup-description').classList.contains('active')) {
startup.querySelector('.read-more-btn').innerHTML = 'Read less';
} else {
startup.querySelector('.read-more-btn').innerHTML = 'Read more';
}
});
});
};
// Function to filter startups based on selected categories
const filterStartups = () => {
const selectedCategories = Array.from(document.querySelectorAll('.category-filters input[type="checkbox"]:checked')).map(checkbox => checkbox.value);
if (selectedCategories.length === 0) {
displayStartups(startupsData);
} else {
const filteredData = startupsData.filter(record => {
const categoryArray = record.fields['Brella | booth category (from Booth Dimensions)'] || [];
return selectedCategories.some(category => categoryArray.includes(category));
});
displayStartups(filteredData);
}
};
// Initial data fetch
fetchData();
});
-->