Youtube Clone
Youtube Clone
HTML CODE:
<html lang="en">
<head>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet" />
</head>
<body>
<div class="header">
<div class="header__left">
<img
src="https://www.youtube.com/about/static/svgs/icons/brand-resources
/YouTube-logo-full_color_light.svg?cache=72a5d9c"
alt=""
/>
</div>
<div class="header__search">
<form action="">
<button><i class="material-icons">search</i></button>
</form>
</div>
<div class="header__icons">
<i class="material-icons">videocam</i>
<i class="material-icons">apps</i>
<i class="material-icons">notifications</i>
</div>
<div class="mainBody">
<div class="sidebar">
<div class="sidebar__categories">
<div class="sidebar__category">
<i class="material-icons">home</i>
<span>Home</span>
</div>
<div class="sidebar__category">
<i class="material-icons">local_fire_department</i>
<span>Trending</span>
</div>
<div class="sidebar__category">
<i class="material-icons">subscriptions</i>
<span>Subcriptions</span>
</div>
</div>
<hr />
<div class="sidebar__categories">
<div class="sidebar__category">
<i class="material-icons">library_add_check</i>
<span>Library</span>
</div>
<div class="sidebar__category">
<i class="material-icons">history</i>
<span>History</span>
</div>
<div class="sidebar__category">
<i class="material-icons">play_arrow</i>
<span>Your Videos</span>
</div>
<div class="sidebar__category">
<i class="material-icons">watch_later</i>
<span>Watch Later</span>
</div>
<div class="sidebar__category">
<i class="material-icons">thumb_up</i>
<span>Liked Videos</span>
</div>
</div>
<hr />
</div>
<div class="videos">
<h1>Recommended</h1>
<div class="videos__container">
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/PpXUTUXU7Qc/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<h3>
</h3>
<a href="">FutureCoders</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/YpTmcCBBdTE/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<a href="">FutureCoders</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/46cXFUzR9XM/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnh53ZRIGnyzC28QrfuggCINb3cfN
bNWo4Uc6qR9=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<a href="">Netflix</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/d2na6sCyM5Q/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhESPVEatju_1yE-03-KLeSrnSLc5
yy0RcvhPd5Lg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/2Ji-clqUYnA/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwniaHN7MZyFEiNvdHuKMzIWnDF6
04Z2--O4GCMq-FA=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<h3>Javascript Fundamentals</h3>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/3PHXvlpOkf4/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/CVClHLwv-4I/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhIz_0Su6HhW6Ym50QCroJCAnF
10X9xnnMDboN2=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/ulprqHHWlng/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/PpXUTUXU7Qc/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<h3>
</h3>
<a href="">FutureCoders</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/YpTmcCBBdTE/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<a href="">FutureCoders</a>
<span>10M Views • 3 Months Ago</span>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/46cXFUzR9XM/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnh53ZRIGnyzC28QrfuggCINb3cfN
bNWo4Uc6qR9=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<a href="">Netflix</a>
<span>10M Views • 11 Months Ago</span>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/d2na6sCyM5Q/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhESPVEatju_1yE-03-KLeSrnSLc5
yy0RcvhPd5Lg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/2Ji-clqUYnA/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwniaHN7MZyFEiNvdHuKMzIWnDF6
04Z2--O4GCMq-FA=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<h3>Javascript Fundamentals</h3>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/3PHXvlpOkf4/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/CVClHLwv-4I/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhIz_0Su6HhW6Ym50QCroJCAnF
10X9xnnMDboN2=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/ulprqHHWlng/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/PpXUTUXU7Qc/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<h3>
</h3>
<a href="">FutureCoders</a>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/YpTmcCBBdTE/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="http://aninex.com/images/srvc/web_de_icon.png" alt="" />
</div>
<div class="title">
<a href="">FutureCoders</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/46cXFUzR9XM/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnh53ZRIGnyzC28QrfuggCINb3cfN
bNWo4Uc6qR9=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<a href="">Netflix</a>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/d2na6sCyM5Q/maxresdefault.jpg"
alt="" />
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhESPVEatju_1yE-03-KLeSrnSLc5
yy0RcvhPd5Lg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/2Ji-clqUYnA/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwniaHN7MZyFEiNvdHuKMzIWnDF6
04Z2--O4GCMq-FA=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
<h3>Javascript Fundamentals</h3>
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/3PHXvlpOkf4/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/CVClHLwv-4I/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnhIz_0Su6HhW6Ym50QCroJCAnF
10X9xnnMDboN2=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
<div class="video">
<div class="video__thumbnail">
<img
src="https://img.youtube.com/vi/ulprqHHWlng/maxresdefault.jpg" alt=""
/>
</div>
<div class="video__details">
<div class="author">
<img
src="https://yt3.ggpht.com/ytc/AAUvwnifaQZvAunS0OFb2y_cieoVjLCVjq
QW8Exf3BC1gg=s48-c-k-c0x00ffffff-no-rj"
alt=""
/>
</div>
<div class="title">
</div>
</div>
</div>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
CSS CODE:
@import
url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;70
0&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
body {
/* header */
.material-icons {
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 70px;
padding: 15px;
.header__left {
display: flex;
align-items: center;
.header__left img {
width: 100px;
margin-left: 15px;
}
.header i {
padding: 0 7px;
cursor: pointer;
.header__search form {
height: 35px;
margin: 0;
padding: 0;
display: flex;
.header__search input {
width: 500px;
padding: 10px;
margin: 0;
border-radius: 0;
border: none;
height: 100%;
}
.header__search button {
padding: 0;
margin: 0;
height: 100%;
border: none;
border-radius: 0;
/* Sidebar */
.mainBody {
display: flex;
overflow: hidden;
.sidebar {
height: 100%;
width: 230px;
background-color: white;
overflow-y: scroll;
}
.sidebar__categories {
width: 100%;
display: flex;
flex-direction: column;
margin-bottom: 15px;
margin-top: 15px;
.sidebar__category {
display: flex;
align-items: center;
.sidebar__category span {
margin-left: 15px;
.sidebar__category:hover {
background: #e5e5e5;
cursor: pointer;
}
.sidebar::-webkit-scrollbar {
display: none;
hr {
height: 1px;
background-color: #e5e5e5;
border: none;
/* videos */
.videos {
background-color: #f9f9f9;
width: 100%;
height: 100%;
overflow-y: scroll;
.videos__container {
display: flex;
flex-direction: row;
justify-content: space-around;
flex-wrap: wrap;
}
.video {
width: 310px;
margin-bottom: 30px;
.video__thumbnail {
width: 100%;
height: 170px;
.video__thumbnail img {
object-fit: cover;
height: 100%;
width: 100%;
.author img {
object-fit: cover;
border-radius: 50%;
height: 40px;
width: 40px;
margin-right: 10px;
.video__details {
display: flex;
margin-top: 10px;
.title {
display: flex;
flex-direction: column;
.title h3 {
line-height: 18px;
font-size: 14px;
margin-bottom: 6px;
.title a,
span {
text-decoration: none;
font-size: 14px;
h1 {
font-size: 20px;
margin-bottom: 10px;
color: rgb(3, 3, 3);
.header__search {
display: none;
.header__icons .material-icons {
display: none;
.header__icons .display-this {
display: inline;
.sidebar {
display: none;
.header__search {
display: none;
.sidebar {
display: none;
}
.show-sidebar {
display: inline;
position: fixed;
top: 4.4rem;
height: auto;
.header__search input {
width: 300px;