Web Dev Solutions

Catalin Mititiuc

From c23d9be9545d714d90a380197ba5e8411e73d6df Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Mon, 22 Apr 2024 12:09:50 -0700 Subject: Fade the map in after it is done loading --- src/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index cb746f4..617e953 100644 --- a/src/index.js +++ b/src/index.js @@ -75,6 +75,12 @@ const RecordSheet = new function () { }; }; +const mapPlaceholder = document.querySelector('.map-placeholder'); +document.querySelector('object').addEventListener('load', function () { + mapPlaceholder.remove(); + this.style.opacity = 1; +}); + window.addEventListener('load', () => { const svg = document.querySelector('object').contentDocument.querySelector('svg'), game = new Game(svg); -- cgit v1.2.3