Add video gallery section with YouTube Shorts
- Update app.py to include video IDs - Add video section to index.html - Add CSS for vertical video aspect ratio - Add basic integration test Co-authored-by: abustosp <63634574+abustosp@users.noreply.github.com>
This commit is contained in:
12
app.py
12
app.py
@@ -60,6 +60,17 @@ GALLERY_ITEMS = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
VIDEO_ITEMS = [
|
||||||
|
"656GdIPFvjE",
|
||||||
|
"5OpuBwlszB0",
|
||||||
|
"QtFkxb3wcYQ",
|
||||||
|
"OdMX991dFCg",
|
||||||
|
"EpDvw0fQP8Q",
|
||||||
|
"BCvTlTp3Gmo",
|
||||||
|
"LEojsBDbV0A",
|
||||||
|
"mPpbDCaG3D8",
|
||||||
|
]
|
||||||
|
|
||||||
FEATURES = [
|
FEATURES = [
|
||||||
"WiFi en todo el camping",
|
"WiFi en todo el camping",
|
||||||
"Arroyo dentro de la propiedad",
|
"Arroyo dentro de la propiedad",
|
||||||
@@ -80,6 +91,7 @@ def home():
|
|||||||
return render_template(
|
return render_template(
|
||||||
"index.html",
|
"index.html",
|
||||||
gallery_items=GALLERY_ITEMS,
|
gallery_items=GALLERY_ITEMS,
|
||||||
|
video_items=VIDEO_ITEMS,
|
||||||
features=FEATURES,
|
features=FEATURES,
|
||||||
map_embed_url=MAP_EMBED_URL,
|
map_embed_url=MAP_EMBED_URL,
|
||||||
map_link=MAP_LINK,
|
map_link=MAP_LINK,
|
||||||
|
|||||||
@@ -400,6 +400,44 @@ p {
|
|||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Videos Section */
|
||||||
|
.videos-section {
|
||||||
|
background-color: var(--bg-body);
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||||
|
gap: 2rem;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
/* 9:16 Aspect Ratio */
|
||||||
|
padding-bottom: 177.77%;
|
||||||
|
background: var(--bg-surface);
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: var(--shadow-soft);
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-wrapper:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: var(--shadow-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-wrapper iframe {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* Map Section */
|
/* Map Section */
|
||||||
.map-section {
|
.map-section {
|
||||||
background-color: var(--bg-alt);
|
background-color: var(--bg-alt);
|
||||||
|
|||||||
@@ -88,6 +88,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="videos" class="section videos-section">
|
||||||
|
<div class="container">
|
||||||
|
<div class="section-header">
|
||||||
|
<span class="eyebrow">Experiencia</span>
|
||||||
|
<h2>Vive la naturaleza</h2>
|
||||||
|
<p>Un vistazo a lo que te espera en Camping Fénix.</p>
|
||||||
|
</div>
|
||||||
|
<div class="video-grid">
|
||||||
|
{% for video_id in video_items %}
|
||||||
|
<div class="video-wrapper">
|
||||||
|
<iframe
|
||||||
|
src="https://www.youtube.com/embed/{{ video_id }}"
|
||||||
|
title="YouTube video player"
|
||||||
|
frameborder="0"
|
||||||
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
|
allowfullscreen>
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section id="ubicacion" class="section map-section">
|
<section id="ubicacion" class="section map-section">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
|
|||||||
18
test_app.py
Normal file
18
test_app.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
import pytest
|
||||||
|
from app import app
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def client():
|
||||||
|
app.config['TESTING'] = True
|
||||||
|
with app.test_client() as client:
|
||||||
|
yield client
|
||||||
|
|
||||||
|
def test_home_page(client):
|
||||||
|
"""Test that the home page loads successfully."""
|
||||||
|
response = client.get('/')
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert b"Vive la naturaleza" in response.data
|
||||||
|
# Check for presence of video IDs (checking the first two)
|
||||||
|
assert b"656GdIPFvjE" in response.data
|
||||||
|
assert b"5OpuBwlszB0" in response.data
|
||||||
Reference in New Issue
Block a user