Static/Responsive YouTube Clone using HTML, CSS, and JavaScript

Static/Responsive YouTube Clone using HTML, CSS, and JavaScript

YouTube being most visited website after Google, and being a great source of information to all with great UI
So I decided to make a clone of it this was about a month ago and I just learned javascript so I was ready to use it.
Link to the website - YouTube Clone

Basic Dezine

The whole code is inside a div separated into top and bottom div and the bottom div is divided into three div in which two were left-navbar's and the main content.

Toggle for left navbar

The fun part comes is javascript that makes the mode almost 50% small, similar to the YouTube toggle navbar is available, and building it the first time from scratch was great.

imgonline-com-ua-resize-4oG4ZlMe2uCXwW0.jpg

imgonline-com-ua-resize-hBkbjTyVbtXsQ25.jpg

Use of JS in main content

I used CSS Grid for main section

  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(31rem,1fr));

For the different amounts of views, upload time, and video playtime I use a random function under the Math object

for (let i = 1; i <= 16; i++) {
    let min = Math.floor(Math.random() * 13) + 1;
    let sec = Math.floor(Math.random() * 26) + 1;
    let view = Math.floor(Math.random() * 100) + 1;
    let old = Math.floor(Math.random() * 5) + 1;
    view = view + "k";
    if (sec < 10) {
      sec = "0" + sec;
 }

JavaScript saves a lot of time and kept my code neat and clean( JavaScript Code) every YouTuber name, views, video playtime, uploaded time, and thumbnail were stored in an array which was then rendered in the grid.

Responsiveness

It is one of the cool areas where spending time is worth and I did the same, some of the screenshots at the end!!!

GitHub YouTube Clone Repository - YouTube Clone

My GitHub Profile - AnmolVerma404

My Twitter - @AnmolVe97231707

My LinkedIn Profile - Anmol Verma

imgonline-com-ua-resize-J6chWf3og45iS5d.jpg

imgonline-com-ua-resize-eg9dli2p6Sgl.jpg

imgonline-com-ua-resize-Gy7lGrj5me.jpg

imgonline-com-ua-resize-aozXJ88tPV5F.jpg