Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: youtube-video-scaling #1872

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 22 additions & 28 deletions components/UI/Services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,28 @@ const Services = ({ youtubeStats, youtubeVideos }) => {
{youtubeVideos
?.filter((video) => video.id.videoId)
?.map((video) => (
<div
onClick={() =>
window.open(
`https://youtube.com/watch?v=${video.id.videoId}`,
"_blank"
)
}
style={{ padding: "10px" }}
key={video.id.videoId}
>
<img
src={video.snippet.thumbnails.medium.url}
height={0}
width={0}
sizes="100vw"
style={{
borderRadius: "20px",
marginBottom: "10px",
width: "100%",
height: "auto",
}}
alt={video.snippet.title}
/>
<p>{video.snippet.title}</p>
<p className="p-2.5 bg-[#171f38] w-fit text-xs text-white mt-2 rounded-md">
{new Date(video.snippet.publishTime).toDateString()}
</p>
</div>
<div
onClick={() =>
window.open(
`https://youtube.com/watch?v=${video.id.videoId}`,
"_blank"
)
}
key={video.id.videoId}
className={classes.videoItem}
>
<img
src={video.snippet.thumbnails.medium.url}
sizes="100vw"
className={classes.videoThumbnail}
alt={video.snippet.title}
/>
<p>{video.snippet.title}</p>
<p className="p-2.5 bg-[#171f38] w-fit text-xs text-white mt-2 rounded-md">
{new Date(video.snippet.publishTime).toDateString()}
</p>
</div>

))}
</Slider>
</Col>
Expand Down
21 changes: 21 additions & 0 deletions styles/services.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,24 @@
font-size: 1.3rem;
}
}
.videoItem {
padding: 10px;
transition: transform 0.3s ease-in-out;
}

.videoItem:hover {
transform: scale(1.05);
}

.videoThumbnail {
border-radius: 20px;
margin-bottom: 10px;
width: 100%;
height: auto;
transition: transform 0.3s ease-in-out;
}

.videoThumbnail:hover {
transform: scale(1.05);
}

Loading
Loading