Skip to content

Commit ad9cabd

Browse files
authored
Make video info section more concise (#4338)
* Implement proposed formatting changes * Increase font-size of video metrics to 14px * More closely colocate title and channel to compensate for larger video metrics font size * Update breakpoint for single column template to 1000px to minimize icon wrapping * Fix like icon being on a different line from the text on smaller screen widths * Update all Watch breakpoints to 1050px from 900px
1 parent 351fdb9 commit ad9cabd

File tree

3 files changed

+75
-102
lines changed

3 files changed

+75
-102
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
.watchVideoInfo {
2-
column-gap: 15px;
3-
display: grid;
4-
grid-template-columns: auto minmax(min-content, 1fr);
2+
display: flex;
3+
flex-direction: column;
54
padding: 16px;
6-
7-
@media screen and (max-width: 680px) {
8-
grid-template-columns: auto;
9-
}
5+
gap: 8px;
106
}
117

128
.videoTitle {
139
display: block;
1410
font-size: 22px;
1511
font-weight: normal;
16-
margin-block: 0 24px;
12+
margin-block: 0;
1713
margin-inline: 0;
18-
margin-block-end: 1em;
1914
word-break: break-word;
2015
}
2116

22-
.channelInformation {
17+
.videoMetrics, .videoButtons {
18+
display: flex;
19+
justify-content: space-between;
20+
align-items: center;
21+
gap: 10px;
22+
}
23+
24+
.videoButtons {
2325
.profileRow {
2426
display: flex;
27+
align-items: center;
2528
}
2629

2730
.channelThumbnail {
@@ -36,6 +39,7 @@
3639
cursor: pointer;
3740
display: block;
3841
margin-inline-start: 6px;
42+
margin-block-end: 3px;
3943
position: relative;
4044
text-decoration: inherit;
4145
inset-block-start: -2px;
@@ -44,41 +48,33 @@
4448
.subscribeButton {
4549
font-size: 14px;
4650
margin-inline-start: 6px;
47-
margin-block-start: 6px;
51+
margin-block: 0;
4852
padding: 6px;
4953
}
50-
}
5154

52-
.viewCount,
53-
.datePublished {
54-
color: var(--secondary-text-color);
55-
font-size: 15px;
56-
text-align: end;
57-
58-
@media screen and (max-width: 680px) {
59-
text-align: start;
55+
.videoOptions {
56+
display: flex;
57+
flex-wrap: wrap;
58+
justify-content: flex-end;
59+
gap: 4px;
60+
61+
@media screen and (max-width: 680px) {
62+
:deep(.iconDropdown) {
63+
inset-inline-start: calc(50% - 20px);
64+
inset-inline-end: auto;
65+
}
66+
}
6067
}
6168
}
6269

63-
.viewCount {
64-
margin-block: 18px 0;
65-
margin-inline: 0;
66-
}
67-
68-
.datePublished {
69-
margin-block: 4px 0;
70-
margin-inline: 0;
71-
72-
@media screen and (max-width: 680px) {
73-
margin-block-start: 16px;
74-
}
75-
}
70+
.videoMetrics {
71+
font-size: 14px;
72+
color: var(--tertiary-text-color);
7673

77-
.likeSection {
74+
.likeSection {
7875
color: var(--tertiary-text-color);
7976
display: flex;
8077
flex-direction: column;
81-
font-size: 16px;
8278
margin-inline-start: auto;
8379
margin-block-start: 4px;
8480
max-inline-size: 210px;
@@ -97,24 +93,8 @@
9793

9894
.likeCount {
9995
margin-inline-end: 0;
96+
display: flex;
97+
gap: 3px;
10098
}
10199
}
102-
103-
.videoOptions {
104-
display: flex;
105-
justify-content: flex-end;
106-
margin-block-start: 16px;
107-
108-
.option:not(:first-child) {
109-
margin-inline-start: 4px;
110-
}
111-
112-
@media screen and (max-width: 680px) {
113-
justify-content: flex-start;
114-
115-
:deep(.iconDropdown) {
116-
inset-inline-start: calc(50% - 20px);
117-
inset-inline-end: auto;
118-
}
119-
}
120100
}

src/renderer/components/watch-video-info/watch-video-info.vue

+36-43
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,10 @@
66
>
77
{{ title }}
88
</h1>
9-
<div
10-
class="channelInformation"
11-
>
12-
<div
13-
class="profileRow"
14-
>
15-
<div>
16-
<router-link
17-
:to="`/channel/${channelId}`"
18-
>
19-
<img
20-
:src="channelThumbnail"
21-
class="channelThumbnail"
22-
alt=""
23-
>
24-
</router-link>
25-
</div>
26-
<div>
27-
<router-link
28-
:to="`/channel/${channelId}`"
29-
class="channelName"
30-
>
31-
{{ channelName }}
32-
</router-link>
33-
<ft-subscribe-button
34-
v-if="!hideUnsubscribeButton"
35-
:channel-id="channelId"
36-
:channel-name="channelName"
37-
:channel-thumbnail="channelThumbnail"
38-
:subscription-count-text="subscriptionCountText"
39-
/>
40-
</div>
41-
</div>
42-
</div>
439
</div>
44-
<div>
45-
<div class="datePublished">
46-
{{ publishedString }} {{ dateString }}
47-
</div>
48-
<div class="viewCount">
49-
{{ parsedViewCount }}
10+
<div class="videoMetrics">
11+
<div class="datePublishedAndViewCount">
12+
{{ publishedString }} {{ dateString }} • {{ parsedViewCount }}
5013
</div>
5114
<div
5215
v-if="!hideVideoLikesAndDislikes"
@@ -55,9 +18,7 @@
5518
<div
5619
class="likeSection"
5720
>
58-
<div>
59-
<span class="likeCount"><font-awesome-icon :icon="['fas', 'thumbs-up']" /> {{ parsedLikeCount }}</span>
60-
</div>
21+
<span class="likeCount"><font-awesome-icon :icon="['fas', 'thumbs-up']" /> {{ parsedLikeCount }}</span>
6122
</div>
6223
</div>
6324
<!--
@@ -80,6 +41,38 @@
8041
</div>
8142
</div>
8243
-->
44+
</div>
45+
<div class="videoButtons">
46+
<div
47+
class="profileRow"
48+
>
49+
<div>
50+
<router-link
51+
:to="`/channel/${channelId}`"
52+
>
53+
<img
54+
:src="channelThumbnail"
55+
class="channelThumbnail"
56+
alt=""
57+
>
58+
</router-link>
59+
</div>
60+
<div>
61+
<router-link
62+
:to="`/channel/${channelId}`"
63+
class="channelName"
64+
>
65+
{{ channelName }}
66+
</router-link>
67+
<ft-subscribe-button
68+
v-if="!hideUnsubscribeButton"
69+
:channel-id="channelId"
70+
:channel-name="channelName"
71+
:channel-thumbnail="channelThumbnail"
72+
:subscription-count-text="subscriptionCountText"
73+
/>
74+
</div>
75+
</div>
8376
<div class="videoOptions">
8477
<ft-icon-button
8578
v-if="showPlaylists && !isUpcoming"

src/renderer/views/Watch/Watch.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
display: inline-block;
1717
max-inline-size: calc(80vh * 1.78);
1818

19-
@media only screen and (min-width: 901px) {
19+
@media only screen and (min-width: 1051px) {
2020
inline-size: 300%;
2121
}
2222
}
@@ -99,7 +99,7 @@
9999
.sidebarArea {
100100
grid-area: sidebar;
101101

102-
@media only screen and (min-width: 901px) {
102+
@media only screen and (min-width: 1051px) {
103103
min-inline-size: 380px;
104104
}
105105

@@ -135,7 +135,7 @@
135135
margin-block: 0 16px;
136136
margin-inline: 0;
137137

138-
@media only screen and (min-width: 901px) {
138+
@media only screen and (min-width: 1051px) {
139139
margin-block: 0 16px;
140140
margin-inline: 8px;
141141
}
@@ -145,17 +145,17 @@
145145
@include theatre-mode-template;
146146
}
147147

148-
@media only screen and (min-width: 901px) {
148+
@media only screen and (min-width: 1051px) {
149149
&.useTheatreMode {
150150
@include theatre-mode-template;
151151
}
152152
}
153153

154-
@media only screen and (max-width: 900px) {
154+
@media only screen and (max-width: 1050px) {
155155
@include single-column-template;
156156
}
157157

158-
@media only screen and (min-width: 901px) {
158+
@media only screen and (min-width: 1051px) {
159159
.infoArea {
160160
scroll-margin-block-start: 76px;
161161
}

0 commit comments

Comments
 (0)