Fix ugly footer that pulls secondary color when content is too short for screen
This broke TRCD after some time. Kurt fixed it but hasn't uploaded his fix here yet. Remove this text once updated.
Put in the scripts tab and it will make the footer stretch if needed:
document.addEventListener('DOMContentLoaded', function() {
const footer = document.getElementById('page-footer');
const layout = document.querySelector('.poc-layout'); function adjustFooter() {
const viewportHeight = window.innerHeight;
const layoutHeight = layout.offsetHeight;
const footerHeight = footer.offsetHeight; // If the layout height (including the footer) is less than the viewport height, adjust the footer
if (layoutHeight < viewportHeight) {
footer.style.position = 'absolute';
footer.style.bottom = '0';
footer.style.width = '100%';
footer.style.height = `${viewportHeight - (layoutHeight - footerHeight)}px`;
} else {
footer.style.position = 'static';
footer.style.height = '';
}
}
adjustFooter();
window.addEventListener('resize', adjustFooter);
});