Added lcp-ui.js and changes to blocks

This commit is contained in:
Jeremy Rangel
2024-12-30 17:39:30 -08:00
parent b9e2660318
commit 4b78f9f571
18 changed files with 55007 additions and 107450 deletions

34
assets/js/lcp-ui.js Normal file
View File

@ -0,0 +1,34 @@
document.addEventListener('DOMContentLoaded', function () {
// Find all elements with the class "lcp-accordion"
var accordions = document.querySelectorAll('.lcp-accordion');
accordions.forEach(function (accordion) {
// Find all tabs within the current accordion
var tabs = accordion.querySelectorAll('.lcp-accordion-tab');
tabs.forEach(function (tab) {
var header = tab.querySelector('h3');
var content = tab.querySelector('.lcp-accordion-content');
// Add click event to each header to toggle the content
header.addEventListener('click', function () {
// Toggle the 'active' class on the tab to show/hide content
tab.classList.toggle('active');
// Optional: Close other open tabs (if only one tab should be open at a time)
tabs.forEach(function (otherTab) {
if (otherTab !== tab) {
otherTab.classList.remove('active');
}
});
});
});
});
});