Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-22 12:09:50 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-22 12:09:50 -0700
commitc23d9be9545d714d90a380197ba5e8411e73d6df (patch)
tree8f2d18ff17a22567cbca3cc6aa3ba7d03f9d1edf /src/index.js
parentb443b37a1110866db1352cf201f14f1916cd217b (diff)
Fade the map in after it is done loading
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js6
1 files changed, 6 insertions, 0 deletions
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);