84 lines
2.5 KiB
Plaintext
84 lines
2.5 KiB
Plaintext
<script src="https://unpkg.com/embla-carousel/embla-carousel.umd.js"></script>
|
|
<script src="https://unpkg.com/embla-carousel-autoplay/embla-carousel-autoplay.umd.js"></script>
|
|
|
|
<script>
|
|
// Function to update footer placeholder heights
|
|
function updateFooterPlaceholders() {
|
|
const cards = document.querySelectorAll('.nintex-card');
|
|
cards.forEach(card => {
|
|
const footer = card.querySelector('.nintex-card-footer');
|
|
const placeholder = card.querySelector('.nintex-card-footer-placeholder');
|
|
if (footer && placeholder) {
|
|
const footerHeight = footer.getBoundingClientRect().height;
|
|
placeholder.style.height = `${footerHeight}px`;
|
|
}
|
|
});
|
|
}
|
|
|
|
// Create ResizeObserver instance
|
|
const resizeObserver = new ResizeObserver(entries => {
|
|
// Update heights when any observed element resizes
|
|
updateFooterPlaceholders();
|
|
});
|
|
|
|
// Function to initialize observers for all cards
|
|
function initializeObservers() {
|
|
const cards = document.querySelectorAll('.nintex-card');
|
|
cards.forEach(card => {
|
|
const footer = card.querySelector('.nintex-card-footer');
|
|
if (footer) {
|
|
resizeObserver.observe(footer);
|
|
}
|
|
});
|
|
}
|
|
|
|
// Initialize on DOM content loaded
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
initializeObservers();
|
|
updateFooterPlaceholders(); // Initial update
|
|
});
|
|
|
|
// Re-initialize when new cards might be added (e.g., after AJAX loads)
|
|
document.addEventListener('contentChanged', () => {
|
|
initializeObservers();
|
|
updateFooterPlaceholders();
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
let lang = '{{current_person.properties.preferred_language}}'
|
|
const langFromQuery = window.location.search.split('lang=')[1];
|
|
if (langFromQuery) {
|
|
lang = langFromQuery;
|
|
}
|
|
const style = document.createElement('style');
|
|
|
|
// Define all supported languages
|
|
const supportedLanguages = ['en-US', 'es', 'fr', 'de', 'en-GB', 'nl', 'pt-BR'];
|
|
|
|
// If current language is not supported, default to en-US
|
|
if (!supportedLanguages.includes(lang)) {
|
|
lang = 'en-US';
|
|
}
|
|
|
|
// Hide all languages except the current one
|
|
const languagesToHide = supportedLanguages.filter(langCode => langCode !== lang);
|
|
let cssContent = '';
|
|
|
|
languagesToHide.forEach(langCode => {
|
|
cssContent += `
|
|
.lang-${langCode} {
|
|
display: none !important;
|
|
visibility: hidden !important;
|
|
opacity: 0 !important;
|
|
}
|
|
`;
|
|
});
|
|
|
|
|
|
style.textContent = cssContent;
|
|
document.head.appendChild(style);
|
|
|
|
</script>
|
|
|
|
{% body %} |