MODULE-4

 Module-Music App


HTML CODE

<<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Music app</title>
    <!--Boostrap CDN-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/
css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9H
uZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.
js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOM
MV+rV" crossorigin="anonymous"></script> 

    <!--font awsome CDN-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/
4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2
xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">


    <!--favicion-->
    <link href="images/icons/favicon.ico" rel="icon" type="image/x-icon" />

    <!--css file linking-->
    <link rel="stylesheet" href="style/style.css">
</head>
<body>
    <div id="wrapper">
        <!-- side bar  -->
        <div class="leftside">
          <ul class="nav sidebar">
            <a href="#" style="text-align: center"
              ><img class="nav__profile" src="images/logos/profile.JPG" alt=""
            /></a>
            <h6 style="text-align: center; margin-top: 15px">Pruthviraj Rajput</h6>
            <p style="text-align: center; font-size: 12px; margin-bottom: 50px; 
color:#ccc;">
              pruthvirajrajput575@gmail.com
            </p>
  
            <li class="nav__menuList">
              <a href="#"
                ><img src="images/logos/dashboard.png" alt=""
              /></a>
              <span class="">Home</span>
            </li>
            <li class="nav__menuList">
              <a href="#"
                ><img src="images/logos/allcourse.png" alt="" />
              </a>
              <span class="nav__menuList__active">Browse</span>
            </li>
            <li class="nav__menuList">
              <a href="#"><img src="images/logos/files.png" alt="" /></a>
              <span>Liked</span>
            </li>
            <li class="nav__menuList">
              <a href="#"><img src="images/logos/profile.png" alt="" /></a>
              <span>Artist</span>
            </li>
  
            <li class="nav__menuList">
              <a href="#"
                ><img src="images/logos/settings.png" alt=""
              /></a>
              <span>Settings</span>
            </li>
  
            <div class="nav__footer">
              <p>
                Upgrade to for <br />
                more resources
              </p>
              <button class="nav__btn" style="margin: 0px 0px">Upgrade</button>
            </div>
          </ul>
        </div>
  
        <!-- main div container -->
        <div id="content-wrapper">
          <!-- content header  -->
          <div class="header">
            <!-- input search feild -->
  
            <div class="input-group">
              <div class="input-group-append">
                <button class="btn" type="button">
                  <i class="fa fa-search fa-sm" style="font-size: 15px"></i>
                </button>
              </div>
              <input
                type="text"
                class="content__input"
                placeholder="Search for..."
                aria-label="Search"
                aria-describedby="basic-addon2"
              />
            </div>
          </div>
  
          <!-- main content  -->
          <div class="main">
            <nav
              class="navbar navbar-expand-lg navbar-light"
              style="
                justify-content: space-between !important;
                margin-bottom: 15px;
              "
            >
              <div class="navbar-Album_title">
                <a class="navbar-brand" href="#">Billboard Topchart</a>
                <span>25 Albums</span>
              </div>
  
              <div class="my-2 my-lg-0" id="navbarNav" >
                <ul class="nav justify-content-end">
                  <li class="nav-item">
                    <a class="nav-link main__navlink main__navlinkactive" href="#"
                      >Ongoing</a
                    >
                  </li>
                  <li class="nav-item">
                    <a
                      class="nav-link main__navlink main__navlinkdisabled"
                      href="#"
                      >Favorite</a
                    >
                  </li>
                  <li class="nav-item">
                    <a
                      class="nav-link main__navlink main__navlinkdisabled"
                      href="#"
                      >Saved</a
                    >
                  </li>
                </ul>
              </div>
            </nav>
  
            <!-- playlist container -->
            <div class="playlist">
              <div class="music">
                <img src="images/playlist/beach.jpg" alt="" />
                <h6>Coloring book</h6>
                <span>Pop King</span>
              </div>
              <div class="music">
                <img src="images/playlist/tower.jpg" alt="" />
                <h6>Mirage</h6>
                <span>Else twin</span>
              </div>
            </div>
  
            <!-- songs list  -->
            <div class="songsList">
              <h4>Most Popular</h4>
              <span>80 songs</span>
              <div class="lsit_items">
                <div class="item">
                  <h1>01</h1>
                  <a href=""
                    ><img src="images/playlist/beach.jpg" alt="" />
                  </a>
                  <span style="font-weight: 600">Coloring book</span>
                  <span id="music_title">Pop King</span>
                  <span>3.22</span>
                  <i class="fa fa-heart-o"></i>
                </div>
                <div class="item">
                  <h1>02</h1>
                  <a href=""
                    ><img src="images/playlist/mountain.jpg" alt="" />
                  </a>
                  <span style="font-weight: 600">Mountain</span>
                  <span id="music_title"> Imagine Dragons</span>
                  <span>3.22</span>
                  <i class="fa fa-heart-o"></i>
                </div>
                <div class="item">
                  <h1>03</h1>
                  <a href=""
                    ><img src="images/playlist/map.jpg" alt="" />
                  </a>
                  <span style="font-weight: 600">Map book</span>
                  <span id="music_title">Pop King</span>
                  <span>3.22</span>
                  <i class="fa fa-heart-o"></i>
                </div>
                <div class="item">
                  <h1>04</h1>
                  <a href=""
                    ><img src="images/playlist/tower.jpg" alt="" />
                  </a>
                  <span style="font-weight: 600">black and white</span>
                  <span id="music_title">Pop King</span>
                  <span>3.22</span>
                  <i class="fa fa-heart-o"></i>
                </div>
              </div>
            </div>
          </div>
        </div>
  
        <div class="rightside">
          <ul class="nav sidebar">
            <div class="music_player" style="height: 500px">
              <h2>Beliver</h2>
              <span>Imagine Dragons</span>
              <img id="track_img" src="images/playlist/road.jpg" alt="" />
              <audio id="music" src="audio/audio1.mp3"></audio>
              <div class="controler">
                <i class="fa fa-backward" id="back" aria-hidden="true"></i>
                <i
                  class="fa fa-play-circle-o"
                  style="font-size: 45px"
                  aria-hidden="true"
                  id="play">
                </i>
                <i class="fa fa-forward" id="forward" aria-hidden="true"></i>
              </div>
              <div class="download">
                <a href="audio/audio1.mp3" download="Music">Download</a>
              </div>
            </div>
          </ul>
        </div>
      </div>
      <script src="js/script.js"></script>
</body>
</html>








CSS CODE


#wrapper {
    displayflex;
   
  }
  .leftside .nav {
    displayflex;
    flex-directioncolumn;
  
    background-colorwhite;
    height100%;
    padding50px 40px 0px;
  }
  
  .leftside .sidebar {
    width272px;
    min-height100vh;
  }
  
  .leftside .nav__btn {
    border0px;
    margin48px 0px;
    background-color#5e81f4;
    colorwhite;
    text-aligncenter;
    padding14px 35px;
    border-radius10px;
    font-family: Inter;
    font-stylenormal;
    font-weight600;
    font-size16px;
    line-height19px;
  }
  
  .leftside .nav__menuList {
    margin-bottom30px;
    padding-left15%;
    cursorpointer;
  }
  
  .leftside .nav__menuList span {
    font-weight500;
    margin-left25px;
    font-size16px;
    color#8da1b5;
    line-height19px;
    transitionall 0.5s ease-in-out;
  }
  .leftside .nav__menuList span:hover {
    color#272829 !important;
  }
  
  .leftside .nav__menuList__active {
    font-weight700;
    color#272829 !important;
  }
  
  .leftside .nav__footer {
    background-color#f5f5fb;
    border-radius12px;
    height232px;
    margin-top70px;
    padding24px;
  }
  
  .leftside .nav__footer p {
    font-family: Inter;
    font-stylenormal;
    font-weight500;
    font-size16px;
    line-height22px;
    text-aligncenter;
    color#0a5ad1;
  }
  
  .leftside .nav__footer__img {
    text-aligncenter;
  }
  
  .leftside .nav__footer__img img {
    margin-top-70px;
    margin-bottom33px;
  }
  
  .leftside .nav__profile {
    width150px;
    height150px;
    border-radius50%;
    box-shadow0 0.5rem 1rem rgba(0000.246);
  }
  .navbar-Album_title {
    displayflex;
    flex-directioncolumn;
  }
  
  #content-wrapper {
    width100%;
    height100%;
    background-color#f5f5fb;
    padding40px;
    padding-top48px;
    flex1;
  }
  .header {
    displayflex;
    flex-directionrow;
    margin-bottom45px;
  }
  .input-group {
    displayflex;
  }
  
  .input-group-append .btn {
    background-color#fff;
    border-radius10px 0 0 10px !important;
    padding10px;
    padding-left23px !important;
    color#ccd6e8;
  }
  .input-group-append .btn:focus {
    outline0 !important;
  }
  
  .content__input {
    padding15px 0px !important;
    border-radius0 10px 10px 0;
    border0px;
    font-family: Inter;
    font-stylenormal;
    font-weightnormal;
    font-size15px;
    color#747b88;
    width100%;
    max-width470px;
    flex1;
  }
  
  .content__input::placeholder {
    font-family: Inter;
    font-stylenormal;
    font-weightnormal;
    font-size15px;
  
    color#ccd6e8;
  }
  
  .content__input:focus {
    outlinenone;
  }
  
  .header:focus {
    border-colorblue;
  }
  
  .header__notification {
    padding10px;
  }
  
  .navbar-brand {
    font-family: Inter;
    font-stylenormal;
    font-weight600;
    font-size28px;
    line-height34px;
  
    color#011f3b;
  }
  
  .main__navlink {
    font-family: Inter;
    font-stylenormal;
    font-weight600;
    font-size17px;
    line-height21px;
    transitioncolor 0.5s;
  }
  
  .main__navlinkactive {
    color#5e81f4 !important;
  }
  .main__navlinkdisabled {
    colorrgba(1181321460.8);
  }
  
  .main__navlink:hover {
    color#5e81f4;
  }
  .playlist {
    displayflex;
    flex-wrapnowrap !important;
    overflowscroll;
  }
  .playlist::-webkit-scrollbar {
    displaynone;
  }
  .music {
    max-width250px;
    padding10px;
    box-sizingborder-box;
    margin10px;
    cursorpointer;
    transition: transform 0.5s ease-in-out;
  }
  .music:hover {
    transformtranslateY(-5px);
  }
  .music img {
    width100%;
    min-width250px;
    height100%;
    max-height250px;
    object-fitcover;
    border-radius30px;
    margin-bottom10px;
    box-shadow0 0 10px 0 rgba(0000.253);
  }
  .music img:hover {
    box-shadow0 0 10px 0 rgba(002550.473);
  }
  .music h6 {
    colorblack;
    font-size17px;
    margin-bottom0px;
  }
  .music span {
    margin-top1px;
    font-size13px;
  }
  .header_course {
    displayblock;
    height100%;
    height300px;
    background-imageurl("../assets/images/images/1.png");
  
    background-size100% 100%;
    background-repeatno-repeat;
    background-positioncenter;
  
    border-radius20px;
    padding30px;
  }
  .multiple__course {
    displayflex;
    margin-top30px;
  }
  
  .multicourse-2 {
    flex-basis50%;
  }
  
  .course {
    background-size100% 100%;
    height100%;
    height300px;
    border-radius20px;
    padding30px;
  }
  
  .course_head {
    color#fff;
    displayflex;
    flex-wrapwrap;
    justify-contentspace-between;
  }
  
  .course_head h3 {
    font-family: Inter;
    font-stylenormal;
    font-weight500;
    font-size24px;
    line-height29px;
  }
  
  .course_head p {
    font-family: Inter;
    font-stylenormal;
    font-weightnormal;
    font-size16px;
    line-height19px;
  
    colorrgba(2552552550.8);
  }
  
  .rightside .nav {
    displayflex;
    flex-directioncolumn;
  
    background-colorwhite;
    height100%;
    padding50px 40px 0px;
  }
  
  .rightside .sidebar {
    width384px;
    min-height100vh;
  }
  
  .rightside .nav__btn {
    border0px;
    margin48px 0px;
    background-color#5e81f4;
    colorwhite;
    text-aligncenter;
    padding14px 35px;
    border-radius10px;
    font-family: Inter;
    font-stylenormal;
    font-weight600;
    font-size16px;
    line-height19px;
  }
  
  .rightside .nav__menuList {
    margin-bottom30px;
    padding-left15%;
  }
  
  .rightside .nav__menuList span {
    font-weight500;
    margin-left25px;
    font-size16px;
    color#8da1b5;
    line-height19px;
  }
  
  .rightside .nav__menuList__active {
    font-weight700;
    color#272829 !important;
  }
  
  .rightside .nav__footer {
    background-color#f5f5fb;
    border-radius12px;
    height232px;
    margin-top40px;
    padding24px;
    background-imageurl(../asset/img/images/download.png);
  }
  
  .rightside .nav__footer p {
    font-family: Inter;
    font-stylenormal;
    font-weight500;
    font-size16px;
    line-height22px;
    text-aligncenter;
    color#0a5ad1;
  }
  
  .rightside .nav__footer__img {
    text-aligncenter;
  }
  
  .rightside .nav__footer__img img {
    margin-top-70px;
    margin-bottom33px;
  }
  
  #name {
    font-family: Inter;
    font-stylenormal;
    font-weight600;
    font-size20px;
    line-height24px;
    colorblack;
    padding-left20px;
  }
  
  .course__progress h5 {
    font-weight600;
    font-size18px;
    line-height22px;
    margin-bottom20px;
  }
  
  .progress__item {
    displayflex;
    margin-bottom15px;
  }
  
  .progress__icon {
    padding13px;
    background#eef2fd;
  
    border-radius6px;
    transitionall 0.5s;
  }
  .progress__icon:hover {
    box-shadow0px 4px 4px rgba(0000.25);
  }
  .progress__icon img {
    width20px;
  }
  .course__desc {
    margin-left20px;
  }
  .course__desc p {
    font-weight600;
    font-size16px;
  
    color#011f3b;
    margin0;
  }
  
  .course__desc span {
    font-weightnormal;
    font-size14px;
    line-height17px;
    /* identical to box height */
  
    color#83919e;
  }
  
  .lsit_items {
    margin20px 0px;
  }
  
  .lsit_items .item {
    displayflex;
    cursorpointer;
  
    align-itemscenter;
    margin10px 10px;
    background-color#fff;
    padding5px 50px;
    border-radius10px;
    transitionall 0.2s ease-in-out;
    box-shadow0 0 0.5rem 0 rgba(5842420.144);
  }
  .lsit_items .item h1 {
    opacity25%;
    text-aligncenter;
    align-selfcenter;
  }
  
  .lsit_items .item span {
    margin0 10px;
  }
  .lsit_items .item:hover {
    background-colorrgba(0000.89);
    color#fff;
  }
  .lsit_items .item .fa.fa-heart-o {
    colorred;
    border10px;
  }
  .lsit_items .item .fa.fa-heart-o :hover {
    background-colorred;
  }
  .lsit_items .item img {
    margin0 20px;
    width40px;
    height40px;
    object-fitcover;
    overflowhidden;
    border-radius10px;
  }
  
  #music_title {
    flex1;
    text-alignright;
  }
  .music_player {
    displayflex;
    align-itemscenter;
    flex-directioncolumn;
    justify-contentcenter;
  }
  .music_player img {
    width200px;
    height200px;
    border-radius50%;
    border10px solid rgba(002550.336);
    box-shadow0 0 0.5rem rgba(0000.2);
    object-fitcover;
    transitionall 0.5s ease-in-out;
  }
  .music_player img:hover {
    border10px solid rgba(002550.575);
  }
  
  .controler {
    padding0 50px;
    margin50px auto;
    width100%;
    displayflex;
    justify-contentspace-around !important;
  }
  
  .controler .fa {
    font-size25px;
    align-selfcenter;
    justify-contentcenter;
    color#777;
    filterdrop-shadow(0 1.2rem 3rem 0.5rem rgba(0000.4));
  
    padding10px;
    margin10px;
    transitionall 0.5s ease-in-out;
  }
  
  .controler .fa:hover {
    transformtranslateY(-2px);
    colorrgba(002550.856);
  }
  
  .music_player h2 {
    text-shadow2px 2px 5px rgba(0000.233);
    font-weight700;
    margin-bottom05px;
  }
  
  .music_player span {
    margin-top0px;
    color#ccc;
    margin-bottom20px;
  }
  
  .animate {
    animation: rotateplayer 5s linear infinite;
  }
  
  @keyframes rotateplayer {
    from {
      transformrotate(0deg);
    }
    to {
      transformrotate(360deg);
    }
  }
  .alert {
    displaynone;
  }
  
 

JS CODE


const play = document.getElementById("play");
const image = document.getElementById("track_img");
const music = document.getElementById("music");
let isplaying = false;

const playMusic = () => {
  music.play();
  play.classList.replace("fa-play-circle-o""fa-pause-circle-o");
  image.classList.add("animate");
  isplaying = true;
};

const pauseMusic = () => {
  music.pause();
  play.classList.replace("fa-pause-circle-o""fa-play-circle-o");
  image.classList.remove("animate");
  isplaying = false;
};
play.addEventListener("click", () => {
  if (isplaying) {
    pauseMusic();
  } else {
    playMusic();
  }
});

Comments

Popular posts from this blog

Switching Tab in wix

Culture Interactive Project Research

Bootstrap /Flex-Boxs / Grids