From 9c7be573e0a9759e3f040eb8478847a6678465c4 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Fri, 6 Aug 2021 10:41:12 +0200 Subject: [PATCH] BUGFIX: styles --- assets/js/page.js | 14 +++++++++++++- assets/scss/base.scss | 3 +-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/js/page.js b/assets/js/page.js index 9c86226..e5772d2 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -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() { diff --git a/assets/scss/base.scss b/assets/scss/base.scss index 72af013..6ff164b 100644 --- a/assets/scss/base.scss +++ b/assets/scss/base.scss @@ -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;