video page responsive

This commit is contained in:
2025-04-08 09:41:02 +04:00
parent 2c8de68d20
commit 295e83e1d6
2 changed files with 130 additions and 91 deletions
+127 -88
View File
@@ -292,85 +292,87 @@
} }
/* Vidéos suggérées */ /* Vidéos suggérées */
.suggested-videos { .video-suggestions {
background-color: #fff; grid-column: 2;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 2rem;
padding: 1.5rem;
} }
.video-grid { .suggestion-list {
display: grid; display: flex;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); flex-direction: column;
gap: 1.5rem; gap: 15px;
} }
.video-card { .suggested-video {
cursor: pointer; display: flex;
flex-direction: column;
text-decoration: none;
color: inherit;
background-color: #f9f9f9;
border-radius: 8px;
overflow: hidden;
transition: transform 0.2s; transition: transform 0.2s;
} }
.video-card:hover { .suggested-video:hover {
transform: translateY(-3px); transform: translateY(-3px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
} }
.video-thumbnail { .suggested-video-thumbnail {
position: relative; position: relative;
border-radius: 8px;
overflow: hidden;
margin-bottom: 0.75rem;
}
.video-thumbnail img {
width: 100%; width: 100%;
aspect-ratio: 16/9; padding-top: 56.25%; /* Ratio 16:9 */
object-fit: cover;
transition: transform 0.3s;
} }
.video-card:hover .video-thumbnail img { .suggested-video-thumbnail img {
transform: scale(1.05);
}
.video-play-icon {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 50%; left: 0;
transform: translate(-50%, -50%); width: 100%;
opacity: 0; height: 100%;
transition: opacity 0.3s; object-fit: cover;
} }
.video-play-icon i { .suggested-video-duration {
font-size: 3rem; background-color: rgba(0, 0, 0, 0.7);
color: white; color: white;
opacity: 0.9; font-size: 12px;
padding: 2px 4px;
border-radius: 3px;
display: inline-block;
margin-top: 5px;
} }
.video-card:hover .video-play-icon { .suggested-video-info {
opacity: 1; padding: 10px;
} }
.video-info h3 { .suggested-video-title {
font-size: 0.9375rem; font-size: 14px;
font-weight: 600; font-weight: 600;
line-height: 1.4; margin: 0 0 5px 0;
margin-bottom: 0.5rem; line-height: 1.3;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
.video-tag { .suggested-video-channel {
display: inline-block; font-size: 12px;
background-color: #f0f0f0; color: #666;
color: #333; margin-bottom: 5px;
padding: 0.125rem 0.5rem; }
border-radius: 4px;
font-size: 0.75rem; .suggested-video-metadata {
margin-bottom: 0.25rem; display: flex;
font-size: 12px;
color: #777;
gap: 10px;
}
.suggested-video-views, .suggested-video-date {
font-size: 11px;
} }
/* Vidéos associées */ /* Vidéos associées */
@@ -434,39 +436,37 @@
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.related-videos { .video-content {
grid-column: 1; grid-column: 1;
} }
.related-videos-list { .video-suggestions {
grid-column: 1;
margin-top: 20px;
}
.suggestion-list {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 15px; gap: 15px;
} }
.related-video-card {
flex-direction: column;
margin-bottom: 0;
}
.related-video-thumbnail {
width: 100%;
height: 0;
padding-top: 56.25%;
margin-right: 0;
margin-bottom: 8px;
}
.related-video-thumbnail img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.video-player-container {
margin-left: -20px;
margin-right: -20px;
width: calc(100% + 40px);
}
.video-player {
border-radius: 0;
}
.video-player iframe {
border-radius: 0;
}
.video-info { .video-info {
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
@@ -478,27 +478,40 @@
justify-content: space-between; justify-content: space-between;
} }
.video-grid { .suggestion-list {
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-template-columns: 1fr;
} }
} }
@media (max-width: 576px) { @media (max-width: 576px) {
.related-videos-list { .video-page {
grid-template-columns: 1fr; display: flex;
flex-direction: column;
gap: 20px;
} }
.related-video-card { .video-player-container {
flex-direction: row; width: 100vw;
margin-bottom: 15px; margin-left: -20px;
margin-right: -20px;
} }
.related-video-thumbnail { .video-content,
width: 120px; .video-suggestions {
height: 68px; width: 100%;
padding-top: 0; }
margin-right: 10px;
margin-bottom: 0; .video-title {
font-size: 1.2rem;
}
.video-actions {
flex-wrap: wrap;
gap: 0.5rem;
}
.action-button {
padding: 0.3rem;
} }
.comment { .comment {
@@ -509,7 +522,33 @@
display: none; display: none;
} }
.video-grid { .suggested-video {
grid-template-columns: 1fr; display: flex;
flex-direction: row;
}
.suggested-video-thumbnail {
width: 120px;
min-width: 120px;
height: 68px;
padding-top: 0;
margin-right: 10px;
}
.suggested-video-info {
padding: 5px;
width: calc(100% - 120px);
}
.suggested-video-title {
-webkit-line-clamp: 2;
} }
} }
/* Message d'erreur */
.error-message {
text-align: center;
padding: 50px 20px;
max-width: 500px;
margin: 0 auto;
}
+2 -2
View File
@@ -195,7 +195,7 @@ if (empty($videoData) || isset($videoData['error'])) {
<div class="video-page"> <div class="video-page">
<div class="video-player-container"> <div class="video-player-container">
<div class="video-player"> <div class="video-player">
<iframe src="<?php echo $video['url']; ?>" frameborder="0" allowfullscreen></iframe> <iframe src="<?php echo $video['url']; ?>" frameborder="0" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" title="<?php echo htmlspecialchars($video['title']); ?>"></iframe>
</div> </div>
</div> </div>
@@ -259,9 +259,9 @@ if (empty($videoData) || isset($videoData['error'])) {
<a href="video.php?id=<?php echo $suggestedVideo['id']; ?>" class="suggested-video"> <a href="video.php?id=<?php echo $suggestedVideo['id']; ?>" class="suggested-video">
<div class="suggested-video-thumbnail"> <div class="suggested-video-thumbnail">
<img src="<?php echo $suggestedVideo['thumbnail']; ?>" alt="<?php echo $suggestedVideo['title']; ?>"> <img src="<?php echo $suggestedVideo['thumbnail']; ?>" alt="<?php echo $suggestedVideo['title']; ?>">
<span class="suggested-video-duration"><?php echo formatDuration($suggestedVideo['duration']); ?></span>
</div> </div>
<div class="suggested-video-info"> <div class="suggested-video-info">
<span class="suggested-video-duration"><?php echo formatDuration($suggestedVideo['duration']); ?></span>
<h4 class="suggested-video-title"><?php echo $suggestedVideo['title']; ?></h4> <h4 class="suggested-video-title"><?php echo $suggestedVideo['title']; ?></h4>
<div class="suggested-video-channel"><?php echo $suggestedVideo['channel']; ?></div> <div class="suggested-video-channel"><?php echo $suggestedVideo['channel']; ?></div>
<div class="suggested-video-metadata"> <div class="suggested-video-metadata">