<div class="efl-column-layout efl-column-layout--one">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>
<br>
<br>
<div class="efl-column-layout efl-column-layout--two">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>
<br>
<br>
<div class="efl-column-layout efl-column-layout--one full-width">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>
No notes defined.
/* No context defined. */
export default () => {
const MOBILE_BREAKPOINT = 820;
const courseIndexPage = document.querySelector('.efl-course-page');
const cpdIndexPage = document.querySelector('.efl-cpd-index-page');
const columnLayouts = document.querySelectorAll('.efl-column-layout');
// Hide efl-column layouts which are empty
/* eslint-disable no-param-reassign */
columnLayouts.forEach(element => {
if (element.children[0] === undefined) {
element.style.display = 'none';
} else {
const childElements = Array.from(element.children);
childElements.forEach(childElement => {
if (childElement.children[0] === undefined) {
childElement.style.display = 'none';
}
});
// repeat empty efl-column check after empty children removed
if (element.children[0] === undefined) {
element.style.display = 'none';
}
}
});
// to remove tabbed carousel tabpanel tab index
const carousels = document.querySelectorAll(
'[data-behavior=tabs-with-carousel]'
);
if (carousels.length) {
carousels.forEach(carousel => {
const tabpanel = carousel.querySelector('[role=tabpanel]');
if (tabpanel) {
tabpanel.removeAttribute('role');
tabpanel.removeAttribute('tabindex');
}
});
}
// add aria-label to signpost component
const signposts = document.querySelectorAll('.membership-signpost');
signposts.forEach(signpost => {
const link = signpost.querySelector('a');
if (signpost.querySelector('h3')) {
const text = signpost.querySelector('h3').innerText;
let ctatxt = '';
if (signpost.querySelector('.cta')) {
ctatxt = signpost.querySelector('.cta').innerText;
}
link.setAttribute('aria-label', `${text} - ${ctatxt}`);
}
});
if (!courseIndexPage && !cpdIndexPage) {
return;
}
const changeFourthCardListFormat = indexPage => {
if (window.innerWidth < MOBILE_BREAKPOINT) {
const eflCardLists = indexPage.querySelectorAll('.efl-card-list__inner');
eflCardLists.forEach((list, index) => {
if (index === 0 || index === 3) {
const firstCard = list.firstElementChild;
firstCard.classList.remove(...firstCard.classList);
firstCard.classList.add('efl-card', `efl-card--single`);
}
});
}
};
if (cpdIndexPage) {
changeFourthCardListFormat(cpdIndexPage);
window.addEventListener('resize', () => {
changeFourthCardListFormat(cpdIndexPage);
});
} else {
changeFourthCardListFormat(courseIndexPage);
window.addEventListener('resize', () => {
changeFourthCardListFormat(courseIndexPage);
});
}
};
.efl-column-layout {
&--one {
width: 100%;
padding: 2.4rem;
&.full-width {
padding: 0;
}
}
&--two {
display: flex;
flex-direction: column;
gap: 2.4rem;
padding: 2.4rem;
}
&--overlap {
display: flex;
margin: 0 auto;
background-color: $white;
width: 100%;
position: relative;
z-index: 1;
padding: 4rem 2.6rem;
min-height: 11.2rem;
}
@media screen and (min-width: $mq-medium) {
&--one {
display: flex;
max-width: 95.2rem;
margin: 0 auto;
flex-direction: column;
.efl-column-layout__col {
width: 100%;
}
&.full-width {
max-width: initial;
display: grid;
}
}
&--two {
display: grid;
grid-template-columns: 58.6rem auto;
max-width: 95.2rem;
margin-left: calc(50% - 47.6rem);
gap: 6.7rem;
}
&--overlap {
max-width: 119.6rem;
}
}
@media screen and (min-width: $mq-medium) and (max-width: $mq-large) {
&--two {
margin: 0 auto;
}
}
@media screen and (min-width: $mq-large) {
&--one,
&--two {
padding: 0;
}
}
}
.efl-course-page,
.efl-cpd-index-page {
.efl-page-content__dynamic-placeholder {
margin-top: -112px;
}
}
.efl-page-content {
.efl-column-layout {
&--two {
padding: 0;
}
}
}
@media screen and (max-width: $mq-medium) {
.efl-cpd-index-page {
.efl-card--horizontal,
.efl-card--vertical {
grid-template-rows: 10.6rem;
.efl-card {
&__content--description {
display: none;
}
}
}
}
}
<div class="efl-column-layout efl-column-layout--one">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>
<br>
<br>
<div class="efl-column-layout efl-column-layout--two">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>
<br>
<br>
<div class="efl-column-layout efl-column-layout--one full-width">
<div class="efl-column-layout__col">
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et ut labore et
ut labore et dolorgna aliqua.
</div>
</div>