implement tempaltes
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/x-icon" href="/static/images/pvv_logo.png">
|
||||
<title>ASCII</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background: black;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: white;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
font-family: monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<pre id="ascii">
|
||||
a@@@@a
|
||||
a@@@@@@@@@@@@a
|
||||
a@@@@@@by@@@@@@@@a
|
||||
a@@@@@S@C@E@S@W@@@@@@a
|
||||
@@@@@@@@@@@@@@@@@@@@@@
|
||||
`@@@@@@`\\//'@@@@@@'
|
||||
,, || ,, S.C.E.S.W.
|
||||
/(-\ || /.)m
|
||||
,---' /`-'||`-'\ `----,
|
||||
/( )__)) || ((,==( )\
|
||||
_ /_//___\\ __|| ___\\ __\\ ____
|
||||
`` `` /MM\ '' ''
|
||||
</pre>
|
||||
<script>
|
||||
fetch("/files")
|
||||
.then(res => res.json())
|
||||
.then(files => {
|
||||
const AsciiObj = files.AsciiFiles
|
||||
|
||||
let index = 0;
|
||||
const preElement = document.getElementById("ascii");
|
||||
|
||||
const nextAscii = () => {
|
||||
const filePath = AsciiObj[index].Name;
|
||||
fetch(filePath)
|
||||
.then(res => {return res.text();})
|
||||
.then(fileContent => {preElement.textContent = fileContent;})
|
||||
.catch(err => {
|
||||
console.error("PANIC FETCH .txt FAILED PANIC!!")
|
||||
preElement.textContent = fileContent;
|
||||
})
|
||||
index = (index + 1) % AsciiObj.length;
|
||||
}
|
||||
|
||||
nextAscii();
|
||||
setInterval(nextAscii, 1000);
|
||||
}).catch(err => {
|
||||
console.error("PANIC FETCH of file list FAILED!", err);
|
||||
preElement.textContent = "Error loading file list.";
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/x-icon" href="/static/images/pvv_logo.png">
|
||||
<title>IMAGES</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background: black;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<img id="images" src="/static/images/pvv_logo.png" alt="images">
|
||||
<script>
|
||||
fetch("/files")
|
||||
.then(res => res.json())
|
||||
.then(files => {
|
||||
const images = files.ImageNames
|
||||
console.log(images)
|
||||
let index = 0;
|
||||
setInterval(() => {
|
||||
index = (index + 1) % images.length;
|
||||
document.getElementById("images").src = images[index];
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user