66 lines
2.4 KiB
HTML
66 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Pumpkin Gallery🎃</title>
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}">
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='gallery_styles.css') }}">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.min.js"></script>
|
|
<style>
|
|
.gallery-container {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
gap: 10px;
|
|
}
|
|
|
|
.gallery-container img {
|
|
width: 100%;
|
|
height: auto;
|
|
display: block;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="button-container">
|
|
<a href="{{ url_for('gallery') }}" class="button">🤺🤺🤺</a>
|
|
<a href="{{ url_for('dump') }}" class="button">🎃🎃🎃</a>
|
|
</div>
|
|
<h1>Pumpkin Gallery🎃</h1>
|
|
<div class="gallery-container">
|
|
{% for image in images %}
|
|
<a href="#" data-original="{{ url_for('uploaded_dump_file', filename=image) }}" target="_blank">
|
|
<img class="responsive-img" src="{{ url_for('dump_cached_file', filename=image) }}" alt="{{ image }}">
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<script>
|
|
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
|
|
|
|
socket.on('update_dump', function() {
|
|
location.reload();
|
|
});
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
var images = document.querySelectorAll('.responsive-img');
|
|
images.forEach(function(img) {
|
|
img.addEventListener('load', function() {
|
|
img.classList.add('loaded');
|
|
});
|
|
if (img.complete) {
|
|
img.classList.add('loaded');
|
|
}
|
|
});
|
|
|
|
var links = document.querySelectorAll('.gallery-container a');
|
|
links.forEach(function(link) {
|
|
link.addEventListener('click', function(event) {
|
|
event.preventDefault();
|
|
var originalUrl = link.getAttribute('data-original');
|
|
window.open(originalUrl, '_blank');
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |