functioning
This commit is contained in:
49
templates/player_fullscreen.html
Normal file
49
templates/player_fullscreen.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Player Fullscreen Schedule</title>
|
||||
<style>
|
||||
body, html {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: black;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
display: none;
|
||||
}
|
||||
img.active {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
{% for item in content %}
|
||||
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" data-duration="{{ item.duration }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
<script>
|
||||
const images = document.querySelectorAll('#content img');
|
||||
let index = 0;
|
||||
|
||||
function showNextImage() {
|
||||
images.forEach((img, i) => {
|
||||
img.classList.toggle('active', i === index);
|
||||
});
|
||||
const duration = images[index].getAttribute('data-duration') * 1000;
|
||||
index = (index + 1) % images.length;
|
||||
setTimeout(showNextImage, duration);
|
||||
}
|
||||
|
||||
if (images.length > 0) {
|
||||
images[0].classList.add('active');
|
||||
showNextImage();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user