49 lines
1.3 KiB
HTML
49 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Group 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> |