updated and removed unecesary files
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
<!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, video {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
display: none;
|
||||
}
|
||||
.active {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
{% for item in content %}
|
||||
{% if item.file_name.endswith('.mp4') %}
|
||||
<video class="content-item" data-duration="{{ item.duration }}" controls>
|
||||
<source src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="video/mp4">
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
{% else %}
|
||||
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" class="content-item" data-duration="{{ item.duration }}">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const items = document.querySelectorAll('.content-item');
|
||||
let currentIndex = 0;
|
||||
|
||||
function showNextItem() {
|
||||
items.forEach(item => item.classList.remove('active'));
|
||||
const currentItem = items[currentIndex];
|
||||
currentItem.classList.add('active');
|
||||
|
||||
const duration = parseInt(currentItem.getAttribute('data-duration'), 10) * 1000;
|
||||
if (currentItem.tagName === 'VIDEO') {
|
||||
currentItem.play();
|
||||
currentItem.onended = () => {
|
||||
currentIndex = (currentIndex + 1) % items.length;
|
||||
showNextItem();
|
||||
};
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
currentIndex = (currentIndex + 1) % items.length;
|
||||
showNextItem();
|
||||
}, duration);
|
||||
}
|
||||
}
|
||||
|
||||
showNextItem();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user