Changed file structure to align with the recommendations given by https://github.com/golang-standards/project-layout
This commit is contained in:
32
website/templates/admin.html
Normal file
32
website/templates/admin.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Admin</title>
|
||||
<link rel="stylesheet" href="/static/css/admin.css">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<nav>
|
||||
<button class="tab-button" id="button-1" onclick="openTab(event, 1)">Image Upload</button>
|
||||
<button class="tab-button" id="button-2" onclick="openTab(event, 2)">null</button>
|
||||
</nav>
|
||||
|
||||
<div class="tab-container" id="tab-1">
|
||||
<div class="container">
|
||||
<h2>Add New Image</h2>
|
||||
<form id="imageForm" enctype="multipart/form-data">
|
||||
<label for="imageInput">Select Image:</label>
|
||||
<input type="file" id="imageInput" name="image" accept="image/*" required><br>
|
||||
<button type="submit" style="width: 100%;">Upload</button>
|
||||
</form>
|
||||
<img id="preview" class="preview" alt="Image Preview">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-container" id="tab-2">
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<script src="/static/js/admin.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
58
website/templates/ascii.html
Normal file
58
website/templates/ascii.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/x-icon" href="/static/images/pvv_logo.png">
|
||||
<title>ASCII</title>
|
||||
<link rel="stylesheet" href="/static/css/global.css">
|
||||
</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>
|
||||
31
website/templates/images.html
Normal file
31
website/templates/images.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/x-icon" href="/static/images/pvv_logo.png">
|
||||
<link rel="stylesheet" href="/static/css/global.css">
|
||||
<title>IMAGES</title>
|
||||
</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);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, images.length*2*1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user