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 {
display: flex;
}
.leftside .nav {
display: flex;
flex-direction: column;
background-color: white;
height: 100%;
padding: 50px 40px 0px;
}
.leftside .sidebar {
width: 272px;
min-height: 100vh;
}
.leftside .nav__btn {
border: 0px;
margin: 48px 0px;
background-color: #5e81f4;
color: white;
text-align: center;
padding: 14px 35px;
border-radius: 10px;
font-family: Inter;
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 19px;
}
.leftside .nav__menuList {
margin-bottom: 30px;
padding-left: 15%;
cursor: pointer;
}
.leftside .nav__menuList span {
font-weight: 500;
margin-left: 25px;
font-size: 16px;
color: #8da1b5;
line-height: 19px;
transition: all 0.5s ease-in-out;
}
.leftside .nav__menuList span:hover {
color: #272829 !important;
}
.leftside .nav__menuList__active {
font-weight: 700;
color: #272829 !important;
}
.leftside .nav__footer {
background-color: #f5f5fb;
border-radius: 12px;
height: 232px;
margin-top: 70px;
padding: 24px;
}
.leftside .nav__footer p {
font-family: Inter;
font-style: normal;
font-weight: 500;
font-size: 16px;
line-height: 22px;
text-align: center;
color: #0a5ad1;
}
.leftside .nav__footer__img {
text-align: center;
}
.leftside .nav__footer__img img {
margin-top: -70px;
margin-bottom: 33px;
}
.leftside .nav__profile {
width: 150px;
height: 150px;
border-radius: 50%;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.246);
}
.navbar-Album_title {
display: flex;
flex-direction: column;
}
#content-wrapper {
width: 100%;
height: 100%;
background-color: #f5f5fb;
padding: 40px;
padding-top: 48px;
flex: 1;
}
.header {
display: flex;
flex-direction: row;
margin-bottom: 45px;
}
.input-group {
display: flex;
}
.input-group-append .btn {
background-color: #fff;
border-radius: 10px 0 0 10px !important;
padding: 10px;
padding-left: 23px !important;
color: #ccd6e8;
}
.input-group-append .btn:focus {
outline: 0 !important;
}
.content__input {
padding: 15px 0px !important;
border-radius: 0 10px 10px 0;
border: 0px;
font-family: Inter;
font-style: normal;
font-weight: normal;
font-size: 15px;
color: #747b88;
width: 100%;
max-width: 470px;
flex: 1;
}
.content__input::placeholder {
font-family: Inter;
font-style: normal;
font-weight: normal;
font-size: 15px;
color: #ccd6e8;
}
.content__input:focus {
outline: none;
}
.header:focus {
border-color: blue;
}
.header__notification {
padding: 10px;
}
.navbar-brand {
font-family: Inter;
font-style: normal;
font-weight: 600;
font-size: 28px;
line-height: 34px;
color: #011f3b;
}
.main__navlink {
font-family: Inter;
font-style: normal;
font-weight: 600;
font-size: 17px;
line-height: 21px;
transition: color 0.5s;
}
.main__navlinkactive {
color: #5e81f4 !important;
}
.main__navlinkdisabled {
color: rgba(118, 132, 146, 0.8);
}
.main__navlink:hover {
color: #5e81f4;
}
.playlist {
display: flex;
flex-wrap: nowrap !important;
overflow: scroll;
}
.playlist::-webkit-scrollbar {
display: none;
}
.music {
max-width: 250px;
padding: 10px;
box-sizing: border-box;
margin: 10px;
cursor: pointer;
transition: transform 0.5s ease-in-out;
}
.music:hover {
transform: translateY(-5px);
}
.music img {
width: 100%;
min-width: 250px;
height: 100%;
max-height: 250px;
object-fit: cover;
border-radius: 30px;
margin-bottom: 10px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.253);
}
.music img:hover {
box-shadow: 0 0 10px 0 rgba(0, 0, 255, 0.473);
}
.music h6 {
color: black;
font-size: 17px;
margin-bottom: 0px;
}
.music span {
margin-top: 1px;
font-size: 13px;
}
.header_course {
display: block;
height: 100%;
height: 300px;
background-image: url("../assets/images/images/1.png");
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 20px;
padding: 30px;
}
.multiple__course {
display: flex;
margin-top: 30px;
}
.multicourse-2 {
flex-basis: 50%;
}
.course {
background-size: 100% 100%;
height: 100%;
height: 300px;
border-radius: 20px;
padding: 30px;
}
.course_head {
color: #fff;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.course_head h3 {
font-family: Inter;
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 29px;
}
.course_head p {
font-family: Inter;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 19px;
color: rgba(255, 255, 255, 0.8);
}
.rightside .nav {
display: flex;
flex-direction: column;
background-color: white;
height: 100%;
padding: 50px 40px 0px;
}
.rightside .sidebar {
width: 384px;
min-height: 100vh;
}
.rightside .nav__btn {
border: 0px;
margin: 48px 0px;
background-color: #5e81f4;
color: white;
text-align: center;
padding: 14px 35px;
border-radius: 10px;
font-family: Inter;
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 19px;
}
.rightside .nav__menuList {
margin-bottom: 30px;
padding-left: 15%;
}
.rightside .nav__menuList span {
font-weight: 500;
margin-left: 25px;
font-size: 16px;
color: #8da1b5;
line-height: 19px;
}
.rightside .nav__menuList__active {
font-weight: 700;
color: #272829 !important;
}
.rightside .nav__footer {
background-color: #f5f5fb;
border-radius: 12px;
height: 232px;
margin-top: 40px;
padding: 24px;
background-image: url(../asset/img/images/download.png);
}
.rightside .nav__footer p {
font-family: Inter;
font-style: normal;
font-weight: 500;
font-size: 16px;
line-height: 22px;
text-align: center;
color: #0a5ad1;
}
.rightside .nav__footer__img {
text-align: center;
}
.rightside .nav__footer__img img {
margin-top: -70px;
margin-bottom: 33px;
}
#name {
font-family: Inter;
font-style: normal;
font-weight: 600;
font-size: 20px;
line-height: 24px;
color: black;
padding-left: 20px;
}
.course__progress h5 {
font-weight: 600;
font-size: 18px;
line-height: 22px;
margin-bottom: 20px;
}
.progress__item {
display: flex;
margin-bottom: 15px;
}
.progress__icon {
padding: 13px;
background: #eef2fd;
border-radius: 6px;
transition: all 0.5s;
}
.progress__icon:hover {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}
.progress__icon img {
width: 20px;
}
.course__desc {
margin-left: 20px;
}
.course__desc p {
font-weight: 600;
font-size: 16px;
color: #011f3b;
margin: 0;
}
.course__desc span {
font-weight: normal;
font-size: 14px;
line-height: 17px;
/* identical to box height */
color: #83919e;
}
.lsit_items {
margin: 20px 0px;
}
.lsit_items .item {
display: flex;
cursor: pointer;
align-items: center;
margin: 10px 10px;
background-color: #fff;
padding: 5px 50px;
border-radius: 10px;
transition: all 0.2s ease-in-out;
box-shadow: 0 0 0.5rem 0 rgba(58, 42, 42, 0.144);
}
.lsit_items .item h1 {
opacity: 25%;
text-align: center;
align-self: center;
}
.lsit_items .item span {
margin: 0 10px;
}
.lsit_items .item:hover {
background-color: rgba(0, 0, 0, 0.89);
color: #fff;
}
.lsit_items .item .fa.fa-heart-o {
color: red;
border: 10px;
}
.lsit_items .item .fa.fa-heart-o :hover {
background-color: red;
}
.lsit_items .item img {
margin: 0 20px;
width: 40px;
height: 40px;
object-fit: cover;
overflow: hidden;
border-radius: 10px;
}
#music_title {
flex: 1;
text-align: right;
}
.music_player {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
.music_player img {
width: 200px;
height: 200px;
border-radius: 50%;
border: 10px solid rgba(0, 0, 255, 0.336);
box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.2);
object-fit: cover;
transition: all 0.5s ease-in-out;
}
.music_player img:hover {
border: 10px solid rgba(0, 0, 255, 0.575);
}
.controler {
padding: 0 50px;
margin: 50px auto;
width: 100%;
display: flex;
justify-content: space-around !important;
}
.controler .fa {
font-size: 25px;
align-self: center;
justify-content: center;
color: #777;
filter: drop-shadow(0 1.2rem 3rem 0.5rem rgba(0, 0, 0, 0.4));
padding: 10px;
margin: 10px;
transition: all 0.5s ease-in-out;
}
.controler .fa:hover {
transform: translateY(-2px);
color: rgba(0, 0, 255, 0.856);
}
.music_player h2 {
text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.233);
font-weight: 700;
margin-bottom: 05px;
}
.music_player span {
margin-top: 0px;
color: #ccc;
margin-bottom: 20px;
}
.animate {
animation: rotateplayer 5s linear infinite;
}
@keyframes rotateplayer {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.alert {
display: none;
}
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
Post a Comment