feat: improve shorts style

This commit is contained in:
2025-10-03 08:20:11 +04:00
parent f68a6e152c
commit e6b2b60edc
2 changed files with 112 additions and 18 deletions
+108
View File
@@ -1118,6 +1118,7 @@ img {
/* Shorts specific styling */
.short-card {
width: 180px;
position: relative;
}
.short-thumbnail {
@@ -1125,6 +1126,13 @@ img {
height: 320px;
border-radius: 12px;
overflow: hidden;
position: relative;
cursor: pointer;
transition: transform 0.3s ease;
}
.short-thumbnail:hover {
transform: scale(1.05);
}
.short-thumbnail img {
@@ -1132,6 +1140,106 @@ img {
height: 100%;
object-fit: cover;
object-position: center;
transition: filter 0.3s ease;
}
.short-thumbnail:hover img {
filter: blur(2px);
}
/* Overlay hover pour les shorts */
.short-thumbnail::before {
content: '';
position: absolute;
top: 100%;
left: 0;
right: 0;
bottom: 0;
background: rgba(64, 64, 64, 0.9);
transition: top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
z-index: 2;
}
.short-thumbnail:hover::before {
top: 0;
}
/* Logo overlay */
.short-thumbnail::after {
content: '';
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%) translateY(20px);
width: 80px;
height: 80px;
background-image: url('../img/logo.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
opacity: 0;
transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
z-index: 3;
}
.short-thumbnail:hover::after {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
/* Titre sur l'overlay pour les shorts */
.short-card .short-title-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: white;
font-weight: 600;
font-size: 14px;
line-height: 1.3;
text-shadow: 0 2px 4px rgba(0,0,0,0.8);
z-index: 4;
background: linear-gradient(transparent, rgba(0,0,0,0.9));
padding: 30px 12px 12px;
border-radius: 0 0 12px 12px;
text-align: center;
opacity: 0;
transform: translateY(20px);
transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}
.short-card:hover .short-title-overlay {
opacity: 1;
transform: translateY(0);
}
/* Icône play sur l'overlay pour les shorts */
.short-card .short-play-overlay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
z-index: 5;
width: 60px;
height: 60px;
background-image: url('../img/play-icon.svg');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
pointer-events: none;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
/* Cacher l'icône Font Awesome pour les shorts */
.short-card .short-play-overlay i {
display: none;
}
.short-card:hover .short-play-overlay {
opacity: 1;
transform: translate(-50%, -50%) scale(1.1);
}
/* Ajustements pour mobile */
+4 -18
View File
@@ -274,28 +274,14 @@ setSecurityHeaders();
<article class="video-card short-card" data-video-id="<?php echo $video['id']; ?>">
<div class="video-thumbnail short-thumbnail">
<img src="<?php echo $video['thumbnail']; ?>" alt="Miniature de la vidéo: <?php echo htmlspecialchars($video['title']); ?>">
<div class="video-play-icon" aria-hidden="true">
<i class="fas fa-play-circle"></i>
</div>
<div class="video-duration" aria-label="Durée: <?php echo formatDuration($video['duration']); ?>">
<?php echo formatDuration($video['duration']); ?>
</div>
<div class="short-play-overlay" aria-hidden="true">
<i class="fas fa-play-circle"></i>
</div>
<div class="video-info">
<h3 class="video-title"><?php echo htmlspecialchars($video['title']); ?></h3>
<div class="video-channel">
<?php if (strpos($video['channelAvatar'], 'default-avatar.png') !== false || empty($video['channelAvatar'])): ?>
<div class="channel-avatar-placeholder">
<i class="fas fa-user-circle"></i>
</div>
<?php else: ?>
<img src="<?php echo $video['channelAvatar']; ?>" alt="<?php echo $video['channel']; ?>" class="channel-avatar">
<?php endif; ?>
<span class="channel-name"><?php echo $video['channel']; ?></span>
</div>
<div class="video-metadata">
<span class="video-views"><i class="fas fa-eye"></i> <?php echo formatViewCount($video['views']); ?> vues</span>
<span class="video-date"><i class="far fa-calendar-alt"></i> <?php echo formatDate($video['date']); ?></span>
<div class="short-title-overlay">
<?php echo htmlspecialchars($video['title']); ?>
</div>
</div>
</article>