diff --git a/css/body-background.css b/css/body-background.css index 18563b0..549c26e 100644 --- a/css/body-background.css +++ b/css/body-background.css @@ -1,6 +1,6 @@ /*Filter for body's lazy loaded background */ -#bodyBackground { +#dummyBodyBackground { background: var(--base-body-bg); position: absolute; top: 0; @@ -13,7 +13,11 @@ transition: all 3s; } -.blurFiltered { +.dummyBackgroundBlur { filter: blur(5px); -webkit-filter: blur(5px); +} + +.dummyBackgroundHide { + opacity: 0; } \ No newline at end of file diff --git a/index.html b/index.html index 5f48bcf..d056244 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ -
+
diff --git a/js/body-background-set.js b/js/body-background-set.js index dbf559b..426f927 100644 --- a/js/body-background-set.js +++ b/js/body-background-set.js @@ -1,11 +1,11 @@ -class BodyBackground { +class DummyBodyBackground { constructor() { this._body = document.body; - this._bodyBackground = document.querySelector('#bodyBackground'); + this._dummyBodyBackground = document.querySelector('#dummyBodyBackground'); this._bodyStyle = this._body.style; - this._bodyBackgroundStyle = this._bodyBackground.style; + this._dummyBodyBackgroundStyle = this._dummyBodyBackground.style; this._hqBackground = document.createElement('img'); @@ -24,10 +24,10 @@ class BodyBackground { _lazyLoadBackground = fileName => { // Add a class to blur the dummy background - this._bodyBackground.classList.add('blurFiltered'); + this._dummyBodyBackground.classList.add('dummyBackgroundBlur'); // Set a low quality background image for the dummy background - this._styleBodyBackgrond(this._bodyBackgroundStyle, `url('assets/backgrounds/${fileName}-low.webp')`); + this._styleBodyBackgrond(this._dummyBodyBackgroundStyle, `url('assets/backgrounds/${fileName}-low.webp')`); // After loading/fetching the _hqBackground's background image this._hqBackground.onload = () => { @@ -39,10 +39,10 @@ class BodyBackground { setTimeout ( () => { // Hide the dummy background - this._bodyBackgroundStyle.display = 'none'; + this._dummyBodyBackground.classList.add('dummyBackgroundHide'); // Remove class to unblur - this._bodyBackground.classList.remove('blurFiltered'); + this._dummyBodyBackground.classList.remove('dummyBackgroundBlur'); }, 3000 diff --git a/js/mobile-swipe-callback.js b/js/mobile-swipe-callback.js index 6640121..1507666 100644 --- a/js/mobile-swipe-callback.js +++ b/js/mobile-swipe-callback.js @@ -63,7 +63,7 @@ class SwipeEventCallbacks extends SwipeEventManager { // Assign swipe callback for each IDs _createSwipeEvents = () => { - this.swipeEvent('bodyBackground', this._bodyBackgroundSwipeEvent); + this.swipeEvent('dummyBodyBackground', this._bodyBackgroundSwipeEvent); this.swipeEvent('rightDashboard', this._rightDashboardSwipeEvent); diff --git a/js/script.js b/js/script.js index eeef4b2..476c857 100644 --- a/js/script.js +++ b/js/script.js @@ -1,8 +1,8 @@ // Instantiate config const config = new Config(); -// Instantiate background setter -const bodyBackground = new BodyBackground(); +// Instantiate dummy background setter +const dummyBodyBackground = new DummyBodyBackground(); // Instantiate a clock object const clock = new Clock();