fix header not turning dark on scroll

apl/regionalrumble
Ayush Mukherjee 1 year ago
parent 2cdc967c10
commit 4d32436018

@ -1,3 +1,7 @@
.scroll {
background: rgba(black, 0.5) !important;
}
.rumble { .rumble {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -97,7 +101,7 @@
align-self: flex-end; align-self: flex-end;
left: 0; left: 0;
right: 0; right: 0;
top: 62%; top: 60%;
bottom: 0; bottom: 0;
margin: auto; margin: auto;
} }
@ -162,7 +166,7 @@
width: 50%; width: 50%;
} }
.overlay { .unoverlay {
display: block; display: block;
position: absolute; position: absolute;
width: 100%; width: 100%;

@ -14,15 +14,15 @@
<section class="selector"> <section class="selector">
<div class="apac"> <div class="apac">
<span class="overlay"></span> <span class="unoverlay"></span>
<img alt="Regional Rumble APAC Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/65086296b79fcrr23-brand-logo-asia-white.png" /> <img alt="Regional Rumble APAC Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/65086296b79fcrr23-brand-logo-asia-white.png" />
</div> </div>
<div class="me"> <div class="me">
<span class="overlay"></span> <span class="unoverlay"></span>
<img alt="Regional Rumble MENA Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/6508629a9ba86rr23-brand-logo-mena-white.png" /> <img alt="Regional Rumble MENA Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/6508629a9ba86rr23-brand-logo-mena-white.png" />
</div> </div>
<div class="ssa"> <div class="ssa">
<span class="overlay"></span> <span class="unoverlay"></span>
<img alt="Regional Rumble SSA Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/6508629d08e60rr23-brand-logo-ssa-white.png" /> <img alt="Regional Rumble SSA Logo" src="https://cms.aplesports.com/storage/uploads/2023/09/18/6508629d08e60rr23-brand-logo-ssa-white.png" />
</div> </div>
</section> </section>
@ -36,6 +36,20 @@
export default { export default {
name: 'RegionalRumble', name: 'RegionalRumble',
mounted() { mounted() {
const h = document.querySelector('header');
const container = document.querySelector('.rumble');
container.addEventListener('scroll', () => {
if(container.scrollTop > 128) {
if(!h.classList.contains('scroll')) {
h.classList.add('scroll')
}
} else {
if(h.classList.contains('scroll')) {
h.classList.remove('scroll')
}
}
});
const apac = document.querySelector('.apac')[0]; const apac = document.querySelector('.apac')[0];
const apac_overlay = document.querySelector('.apac span'); const apac_overlay = document.querySelector('.apac span');
const me = document.querySelector('.me')[0]; const me = document.querySelector('.me')[0];

Loading…
Cancel
Save