Add YouTube Shorts video gallery to React app
- Added `VIDEO_ITEMS` constant with YouTube Shorts IDs to `src/App.jsx`. - Added a new `<section>` for videos in `src/App.jsx`. - Ported video grid styles from `static/css/style.css` to `src/styles.css`, including the 9:16 aspect ratio fix. - Updated `static/css/style.css` to ensure consistent styling (if not already present). Co-authored-by: abustosp <63634574+abustosp@users.noreply.github.com>
This commit is contained in:
10
app.log
10
app.log
@@ -1,10 +0,0 @@
|
||||
* Serving Flask app 'app'
|
||||
* Debug mode: on
|
||||
[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m
|
||||
* Running on http://127.0.0.1:5000
|
||||
[33mPress CTRL+C to quit[0m
|
||||
* Restarting with stat
|
||||
* Debugger is active!
|
||||
* Debugger PIN: 410-907-091
|
||||
127.0.0.1 - - [31/Jan/2026 22:23:59] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [31/Jan/2026 22:23:59] "GET /static/css/style.css HTTP/1.1" 200 -
|
||||
1674
package-lock.json
generated
Normal file
1674
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
src/App.jsx
34
src/App.jsx
@@ -55,6 +55,17 @@ const GALLERY_ITEMS = [
|
||||
}
|
||||
]
|
||||
|
||||
const VIDEO_ITEMS = [
|
||||
'656GdIPFvjE',
|
||||
'5OpuBwlszB0',
|
||||
'QtFkxb3wcYQ',
|
||||
'OdMX991dFCg',
|
||||
'EpDvw0fQP8Q',
|
||||
'BCvTlTp3Gmo',
|
||||
'LEojsBDbV0A',
|
||||
'mPpbDCaG3D8'
|
||||
]
|
||||
|
||||
const MAP_EMBED_URL = 'https://www.google.com/maps?q=Fenix%20Camping%20Misiones&output=embed'
|
||||
const MAP_LINK = 'https://maps.app.goo.gl/7LycqCiKgPXpbSUf8'
|
||||
const WHATSAPP_NUMBER = '+543765253409'
|
||||
@@ -156,6 +167,29 @@ function App() {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="videos" className="section videos-section">
|
||||
<div className="container">
|
||||
<div className="section-header">
|
||||
<span className="eyebrow">Experiencia</span>
|
||||
<h2>Vive la naturaleza</h2>
|
||||
<p>Un vistazo a lo que te espera en Camping Fénix.</p>
|
||||
</div>
|
||||
<div className="video-grid">
|
||||
{VIDEO_ITEMS.map((videoId) => (
|
||||
<div className="video-wrapper" key={videoId}>
|
||||
<iframe
|
||||
src={`https://www.youtube.com/embed/${videoId}`}
|
||||
title="YouTube video player"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="ubicacion" className="section map-section">
|
||||
<div className="container">
|
||||
<div className="section-header">
|
||||
|
||||
@@ -359,6 +359,44 @@ p {
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
.gallery-item {
|
||||
background: var(--bg-surface);
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
18
test_app.py
18
test_app.py
@@ -1,18 +0,0 @@
|
||||
|
||||
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