This commit is contained in:
2024-08-13 16:46:44 -04:00
commit 8cb37c6011
418 changed files with 69567 additions and 0 deletions

87
frontend/dist/init.html vendored Normal file
View File

@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ESTABLO</title>
<style>
body {
padding: 0;
margin: 0;
background: #ffffff;
}
#loading {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #ffffff;
}
#app {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="loading">
<img src=logo.svg>
</div>
<iframe frameborder="0" id="app"></iframe>
<script>
const loadingScreen = document.getElementById("loading");
const app = document.getElementById("app");
let timeout
app.style.display = "none";
function request_image(url) {
return new Promise(function (resolve, reject) {
var img = new Image();
img.onload = function () { resolve(img); };
img.onerror = function () { reject(url); };
img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
});
}
function checkApp(url) {
request_image(`http://localhost:5173/favicon.ico`).then(function () {
timeout = setTimeout(function () {
// show app
loadingScreen.style.display = "none";
if (app.style.display === "none") {
app.style.display = "block";
// reinitialize iframe
app.src = app.src;
}
}, 2000)
}).catch(function (error) {
// show loading screen
clearTimeout(timeout)
app.style.display = "none";
loadingScreen.style.display = "flex";
})
}
function init() {
app.src = "http://localhost:5173/";
url = app.src;
loadingScreen.style.display = "flex";
setInterval(function () { checkApp(url) }, 1000)
}
document.addEventListener("DOMContentLoaded", init)
</script>
</body>
</html>