Enhance gallery items with updated images and add scroll-to-top button functionality

This commit is contained in:
2026-01-31 19:03:16 -03:00
parent feeeb36fa3
commit de0e31ebb2
3 changed files with 257 additions and 40 deletions

27
templates/index.html Normal file → Executable file
View File

@@ -78,7 +78,7 @@
{% for item in gallery_items %}
<article class="gallery-card">
<div class="image-wrap">
<img src="{{ url_for('static', filename=item.image) }}" alt="{{ item.title }}" loading="lazy">
<img src="{{ item.image }}" alt="{{ item.title }}" loading="lazy">
</div>
<div class="gallery-info">
<h3>{{ item.title }}</h3>
@@ -119,5 +119,30 @@
<footer class="footer">
<p>Camping Fénix · Naturaleza y descanso en Misiones · Contacto: {{ whatsapp_number }}</p>
</footer>
<button id="scrollToTop" class="scroll-to-top" aria-label="Volver arriba">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 4L10 16M10 4L4 10M10 4L16 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<script>
const scrollToTopBtn = document.getElementById('scrollToTop');
window.addEventListener('scroll', () => {
if (window.pageYOffset > 300) {
scrollToTopBtn.classList.add('visible');
} else {
scrollToTopBtn.classList.remove('visible');
}
});
scrollToTopBtn.addEventListener('click', () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
</script>
</body>
</html>