<aside>
<div class="efl-global-message-banner efl-global-message-banner--neutral">
<div class="efl-global-message-banner__inner">
<div class="efl-global-message-banner__inner__message">
<div><a href="#" class="hyperlink">Register</a>your interest for introduction to coaching football course now available</div>
</div>
<a href="#" id="close" class="efl-global-message-banner__inner__close"></a>
</div>
</div>
</aside>
No notes defined.
{
"modifier": "neutral",
"message": [
{
"underlined": true,
"text": "Register"
},
{
"underlined": false,
"text": "your interest for introduction to coaching football course now available"
}
]
}
export default parentElement => {
const closeButton = parentElement.querySelector('#close');
const headerEle = document.querySelector('.global-fixed-header');
const { offsetHeight: headerHt } = headerEle;
const self = parentElement;
self.style.top = headerHt;
if (closeButton) {
closeButton.addEventListener('click', event => {
event.preventDefault();
setTimeout(() => {
parentElement.classList.add('hidden');
}, 300);
parentElement.classList.add('fade-out');
});
}
};
.efl-global-message-banner {
position: initial;
left: 0;
right: 0;
z-index: 15;
padding: 1.6rem;
color: $white;
opacity: 1;
&.fade-out {
opacity: 0;
transition: opacity 0.3s ease-out;
}
&.hidden {
display: none;
}
&__inner {
display: flex;
flex-direction: row;
align-items: flex-start;
&__message {
font: $efl-heading-4;
flex-grow: 1;
display: flex;
padding-top: 1.6rem;
padding-bottom: 1.4rem;
.hyperlink {
margin-right: 0.3rem;
}
&::before {
content: '';
display: block;
flex-shrink: 0;
background-image: url('./assets/images/efl-global-message-banner-info.svg');
background-size: 100%;
background-repeat: no-repeat;
width: 2.7rem;
height: 2.7rem;
margin-right: 1.1rem;
}
}
&__close {
text-decoration: none;
display: flex;
align-items: center;
&::before {
content: 'Close';
padding-right: 1.15rem;
font: $efl-heading-4;
display: none;
}
&::after {
content: '';
display: block;
background-image: url('./assets/images/efl-global-message-banner-close.svg');
background-size: 100%;
background-repeat: no-repeat;
width: 2.7rem;
height: 2.7rem;
}
}
}
&--neutral {
background-color: $color-interface-light;
& * {
background-color: $color-interface-light;
color: $white;
&::before {
color: $white;
}
}
}
&--positive {
background: $light-blue;
& * {
background: $light-blue;
color: $blue;
&::before {
color: $blue;
}
}
.efl-global-message-banner__inner {
&__message {
&::before {
background-image: url('./assets/images/efl-global-message-banner-info-blue.svg');
}
}
&__close {
&::after {
background-image: url('./assets/images/efl-global-message-banner-close-blue.svg');
}
}
}
}
&--negative {
background: $black;
& * {
background: $black;
color: $white;
&::before {
color: $white;
}
}
}
@media screen and (min-width: $mq-medium) {
position: absolute;
&__inner {
margin: auto;
max-width: 119.6rem;
justify-content: space-between;
align-items: center;
&__close {
&::before {
display: block;
}
&::after {
width: 3rem;
height: 3rem;
}
}
&__message {
padding: 0.9rem 0;
.hyperlink {
text-decoration: underline;
}
}
}
}
}
<aside>
<div class="efl-global-message-banner {{#if modifier}}efl-global-message-banner--{{modifier}}{{/if}}">
<div class="efl-global-message-banner__inner">
<div class="efl-global-message-banner__inner__message"><div>{{#each message}}{{#if underlined}}<a href="#" class="hyperlink">{{text}}</a>{{else}}{{text}}</div>{{/if}}{{/each}}</div>
<a href="#" id="close" class="efl-global-message-banner__inner__close"></a>
</div>
</div>
</aside>