Skip to content

Commit 320bb76

Browse files
ahtesham-quraishAhtesham Quraish
andauthored
fix: minor improvements on video collection pages (#3205)
Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.10.8>
1 parent 93cf233 commit 320bb76

3 files changed

Lines changed: 40 additions & 12 deletions

File tree

frontends/main/src/app-pages/VideoPlaylistCollectionPage/FeaturedVideo.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const FeaturedGrid = styled.div(({ theme }) => ({
1919
display: "grid",
2020
gridTemplateColumns: "3.95fr 4.6fr",
2121
columnGap: "40px",
22-
alignItems: "flex-start",
22+
alignItems: "center",
2323
[theme.breakpoints.down("sm")]: {
2424
gridTemplateColumns: "1fr",
2525
},
@@ -60,14 +60,10 @@ const FeaturedTitle = styled.h2(({ theme }) => ({
6060
fontWeight: theme.typography.fontWeightBold,
6161
color: theme.custom.colors.darkGray2,
6262
letterSpacing: "-1.28px",
63-
lineHeight: "110%",
63+
lineHeight: "120%",
6464
margin: "0 0 16px",
6565
cursor: "pointer",
66-
fontSize: "64px",
67-
overflow: "hidden",
68-
display: "-webkit-box",
69-
WebkitLineClamp: 2,
70-
WebkitBoxOrient: "vertical",
66+
fontSize: "48px",
7167
transition: "color 0.2s",
7268
"& .mobile-title": {
7369
display: "none",

frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const VideoCardItem = styled(Link)({
2222
},
2323

2424
"&:hover .play-overlay": {
25-
opacity: 1,
25+
opacity: 0.5,
2626
},
2727

2828
"&:focus-visible .play-overlay": {
29-
opacity: 1,
29+
opacity: 0.5,
3030
},
3131

3232
[theme.breakpoints.down("sm")]: {
@@ -108,8 +108,8 @@ const CardTitle = styled(Typography)(({ theme }) => ({
108108
}))
109109

110110
const PlayIcon = styled(RiPlayCircleFill)({
111-
width: 48,
112-
height: 48,
111+
width: 36,
112+
height: 36,
113113
})
114114

115115
const CardMetaRow = styled.div({

frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoDetailPage.tsx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Image from "next/image"
77
import { useFeatureFlagEnabled } from "posthog-js/react"
88
import { Typography, styled, theme, Skeleton, Breadcrumbs } from "ol-components"
99
import VideoContainer from "./VideoContainer"
10-
import { RiShareForwardFill } from "@remixicon/react"
10+
import { RiShareForwardFill, RiPlayCircleFill } from "@remixicon/react"
1111
import { useQuery } from "@tanstack/react-query"
1212
import {
1313
useLearningResourcesDetail,
@@ -76,6 +76,11 @@ const StyledBreadcrumbs = styled(Breadcrumbs)(() => ({
7676
"& > span > span": { paddingBottom: 0, paddingLeft: "4px" },
7777
}))
7878

79+
const PlayIcon = styled(RiPlayCircleFill)({
80+
width: 36,
81+
height: 36,
82+
})
83+
7984
const ContentArea = styled.div(({ theme }) => ({
8085
padding: "56px 0 80px",
8186
[theme.breakpoints.down("sm")]: {
@@ -237,6 +242,18 @@ const MoreFromItem = styled(Link)({
237242
textDecoration: "none",
238243
"&:hover .mf-title": { color: theme.custom.colors.red },
239244

245+
"&:hover .video-card-title, &:focus-visible .video-card-title": {
246+
color: theme.custom.colors.red,
247+
},
248+
249+
"&:hover .play-overlay": {
250+
opacity: 0.5,
251+
},
252+
253+
"&:focus-visible .play-overlay": {
254+
opacity: 0.5,
255+
},
256+
240257
"&:first-child": {
241258
padding: "0 0 24px 0",
242259
},
@@ -346,6 +363,18 @@ const DurationText = styled.span(({ theme }) => ({
346363
fontWeight: theme.typography.fontWeightBold,
347364
}))
348365

366+
const PlayOverlay = styled.div({
367+
position: "absolute",
368+
inset: 0,
369+
display: "flex",
370+
alignItems: "center",
371+
justifyContent: "center",
372+
color: "#fff",
373+
opacity: 0,
374+
transition: "opacity 0.2s",
375+
backgroundColor: "rgba(0, 0, 0, 0.18)",
376+
})
377+
349378
const ScreenReaderOnly = styled.span({
350379
position: "absolute",
351380
width: 1,
@@ -660,6 +689,9 @@ const VideoDetailPage: React.FC<VideoDetailPageProps> = ({
660689
{itemDuration && (
661690
<DurationBadge>{itemDuration}</DurationBadge>
662691
)}
692+
<PlayOverlay className="play-overlay">
693+
<PlayIcon />
694+
</PlayOverlay>
663695
</MoreFromThumbnailWrapper>
664696
<MoreFromTextSide>
665697
<MoreFromItemTitle className="mf-title">

0 commit comments

Comments
 (0)