forked from albertba/Advertisement_Panel
50 lines
1.2 KiB
HTML
50 lines
1.2 KiB
HTML
<!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>
|
|
function setImage(path) {
|
|
document.getElementById("images").src = path;
|
|
}
|
|
let imageMetadata = [];
|
|
fetch("/files")
|
|
.then(res => res.json())
|
|
.then(files => {
|
|
imageMetadata = files
|
|
let index = 1;
|
|
|
|
setInterval(() => {
|
|
if(index > imageMetadata.length) index = 0;
|
|
|
|
if(index == 0) {
|
|
setImage("/static/images/pvv_logo.png");
|
|
} else {
|
|
setImage(imageMetadata[index-1].path);
|
|
}
|
|
|
|
index++;
|
|
}, 4000);
|
|
if(images.length < 1) {
|
|
setImage("/static/images/pvv_logo.png");
|
|
return
|
|
} else {
|
|
setTimeout(() => {
|
|
//window.location.reload();
|
|
}, images.length*2*1000);
|
|
}
|
|
});
|
|
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|