BUGFIX: styles

This commit is contained in:
Jeroen De Meerleer 2021-08-06 10:41:12 +02:00
parent 942c591403
commit 9c7be573e0
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 14 additions and 3 deletions

View File

@ -16,7 +16,10 @@ function initOverflow() {
}
function initNinetiesToggle() {
document.querySelector('.nineties-toggle').addEventListener('click', function() {
let nineties = document.querySelector('.nineties-toggle');
let container = document.querySelector('.container');
nineties.addEventListener('click', function() {
let body = document.querySelector('body');
if (body.classList.contains('nineties')) {
body.classList.remove('nineties');
@ -26,6 +29,15 @@ function initNinetiesToggle() {
Cookies.set('nineties', true, { sameSite: 'strict' });
}
})
if(
nineties.getBoundingClientRect().left < container.getBoundingClientRect().right &&
nineties.getBoundingClientRect().bottom > container.getBoundingClientRect().top
) {
nineties.style.position = 'initial';
nineties.style.textAlign = 'right';
}
}
function initExternalLinks() {

View File

@ -14,12 +14,11 @@ body {
color: $orange;
font-family: $font;
height: 100%;
margin: 0 10px;
&.nineties {
color: $black;
background-image: url("../images/background-1990.gif");
font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive;
a{
color: $black;