-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (24 loc) · 1.18 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(async function () {
const globals = await fetch('/globals.json').then(res => res.json());
document.getElementsByTagName('title')[0].innerHTML = `COMING SOON | ${globals.name}`;
document.getElementById('data-loading').style.display = 'none';
const h1 = document.getElementById('data-app-name')
h1.innerHTML = globals.name;
h1.style.color = globals.titleColour || '#bdbdbd';
const content =document.getElementById('data-content')
content.style.display = 'grid';
if (globals.backgroundPath) {
content.style.backgroundImage = `url(${globals.backgroundPath})`;
}
if(!globals.logoPath.endsWith('.svg')){
const imageLogo = document.createElement('img');
document.getElementById('data-logo').appendChild(imageLogo);
imageLogo.src = globals.logoPath
imageLogo.setAttribute('alt', `${globals.name} logo`);
} else {
const svgContents = await fetch(globals.logoPath).then(res => res.text());
const imgSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
document.getElementById('data-logo').appendChild(imgSvg);
imgSvg.outerHTML = svgContents;
}
})();