feat(video-page): add related videos section with shorts and regular videos

- Add new related videos section with styling for shorts and regular videos
- Implement logic to load and display related videos based on current video category
- Restructure video page layout to accommodate new related videos section
- Add shuffle functionality for video recommendations
This commit is contained in:
2026-02-13 10:44:28 +08:00
parent d1df0b339c
commit 86651b50ef
3 changed files with 376 additions and 86 deletions

View File

@@ -1,14 +1,21 @@
.video-content-wrapper {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
gap: 24px;
padding: 24px;
background-color: #121212;
flex: 1;
overflow: hidden;
}
.video-main-section {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.video-player {
width: 70%;
width: 100%;
aspect-ratio: 16 / 9;
margin-bottom: 20px;
border-radius: 20px;
@@ -28,9 +35,11 @@
}
.video-info-container {
margin-left: 30px;
margin-right: 30px;
width: 100%;
margin-bottom: 20px;
padding: 1px;
border: 1px solid #000000;
box-sizing: border-box;
}
.video-title {
@@ -255,9 +264,11 @@
}
.comments-section {
margin-left: 30px;
margin-right: 30px;
width: 100%;
margin-bottom: 40px;
padding: 1px;
border: 1px solid #000000;
box-sizing: border-box;
}
.comments-header {
@@ -383,3 +394,163 @@
.comment-action-btn i {
font-size: 16px;
}
.related-videos-section {
width: 400px;
display: flex;
flex-direction: column;
gap: 24px;
overflow-y: auto;
flex-shrink: 0;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #ffffff;
margin: 0 0 12px 0;
}
.shorts-section {
display: flex;
flex-direction: column;
}
.shorts-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}
.short-item {
position: relative;
width: 100%;
padding-top: 177.78%; /* 9:16 ratio */
background-color: #272727;
border-radius: 8px;
overflow: hidden;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.short-item:hover {
transform: translateY(-4px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.short-thumbnail {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.short-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}
.short-info {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 8px;
background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}
.short-title {
font-size: 14px;
font-weight: 600;
color: #ffffff;
margin: 0 0 4px 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.short-channel {
font-size: 12px;
color: #aaaaaa;
margin: 0 0 2px 0;
}
.short-views {
font-size: 12px;
color: #aaaaaa;
margin: 0;
}
.regular-videos-section {
display: flex;
flex-direction: column;
}
.regular-videos-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.regular-video-item {
display: flex;
gap: 12px;
cursor: pointer;
transition: background-color 0.2s;
border-radius: 12px;
padding: 8px;
}
.regular-video-item:hover {
background-color: #272727;
}
.regular-video-thumbnail {
width: 168px;
height: 94px;
border-radius: 8px;
overflow: hidden;
flex-shrink: 0;
background-color: #272727;
}
.regular-video-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}
.regular-video-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.regular-video-title {
font-size: 14px;
font-weight: 600;
color: #ffffff;
margin: 0 0 6px 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.regular-video-channel {
font-size: 12px;
color: #aaaaaa;
margin: 0 0 4px 0;
}
.regular-video-meta {
font-size: 12px;
color: #aaaaaa;
margin: 0;
}