dhruvprashbtech24's picture
what happened to all the main links on the original website? don't remove them, i asked you to redesign them so that they are in alignment with said principles
810e258 verified
Raw History Blame Contribute Delete
1.12 kB
// Progressive disclosure implementation
document.querySelectorAll('.disclosure-trigger').forEach(trigger => {
trigger.addEventListener('click', () => {
const content = trigger.nextElementSibling;
content.style.maxHeight = content.style.maxHeight === '0px' ? `${content.scrollHeight}px` : '0px';
});
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Responsive table functionality
function makeTableResponsive() {
document.querySelectorAll('table').forEach(table => {
const wrapper = document.createElement('div');
wrapper.className = 'table-responsive';
wrapper.style.overflowX = 'auto';
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
});
}
document.addEventListener('DOMContentLoaded', () => {
makeTableResponsive();
feather.replace();
});