PROJECT
PROJECT
Bachelor of Technology
In
Computer Science & Engineering
(Batch: 2019-23)
------------------------------------------------------------------------------------------------
KIIT College of Engineering, Gurugram
(Affiliated to MDU, Rohtak, Approved by AICTE, New Delhi)
KIIT Campus, Gurugram- Sohna Road,Gurugram-122102 (Haryana)
June, 2022
STUDENT’s DECLARATION
I,Mohit student of B. Tech (CSE)-VI Semester, Batch 2019-23 hereby declare that
this project report on, “Online Music Website”, which is being submitted in partial
fulfillment for the program in B. Tech (CSE), is the record of authentic work carried
out by me during the period from 20 May 2022 to 20 June 2022 under the guidance
of Mr. Sharvan Kumar and Dr. Atul Kumar.
The work presented does not infringe any patented work and has not been submitted
to any other University or anywhere else for the award of any degree or any
professional diploma.
Date :
CERTIFICATE FROM INTERNAL GUIDE
This is to certify that Mohit of CSE 6th Semester, 2019-2023, KIIT College of
Engineering, Gurugram has successfully completed the project work entitled
“Online Music Website” in partial fulfillment of requirement for the completion of
Bachelor of Technology (Computer Science and Engineering) as prescribed by the
Maharishi Dayanand University, Rohtak.
This project report is the record of authentic work carried out by him during the
period from 20 May 2022 to 20 June 2022.
I have taken efforts in this project. However, it would not have been possible without
the kind support and help of many individuals. I would like to extend my sincere
thanks to all of them.
I wish to express my sense of gratitude to our Project Supervisors, Dr. Atul Kumar
and Mr. Shravan Kumar for his guidance and useful suggestions, which helped me
in completing the project work, in time.
Finally, yet importantly, I would like to express my heartfelt thanks to our beloved
parents for their blessings, our friends/classmates for their help and wishes for the
successful completion of this project. Any omission in this brief acknowledgement
does not mean lack of gratitude.
Name: Mohit
Registration No.: 191270017
ABSTRACT
This website is designed in a way so that anyone on the web can access it
and enjoy music on the web. And at the same time can receive the
benefits of listening music.
TABLE OF CONTENTS
PAGE
S. No. TOPICS
NO
1. Title page i
2. Declaration ii
3. Certificate from internal Guide iii
4. Acknowledgement iv
5. Abstract v
6. List of Figures vi
Chapter - 1: INTRODUCTION
7. 1.1 Objective of the Project 1
1.2 Features of the Project
Chapter – 2: SYSTEM REQUIREMENT AND ANALYSIS
2.1 Hardware Requirements
8. 2.2 Software Requirements 2 - 10
2.3 Introduction to Technology used
2.4 Software Description
Chapter – 3: IMPLEMENTATION
3.1 System Implementation
9. 11 - 13
3.2 Flow Chart
3.3 Website
Chapter – 4:CONCLUSION AND FUTURE ENHANCEMENT
10. 4.1 Conclusion 14
4.2 Scope for future development
11. Bibliography 15
12. Appendix 15 - 40
List Of Figures
2.1 Windows OS 2
2.2 Linux OS 2
2.3 Mac OS 3
3.5 Website 13
CHAPTER - 1
INTRODUCTION
The sole intention behind the consideration of this Project is to generate and manage a
simple online music website. The motivation of this project comes from my desire to
learn the increasingly growing field of Web Development. This project is developed
considering context of the customer in mind. Here, I have used the HTML, CSS and
JavaScript to design this website.
This website is designed in a way so that anyone on the web can access it and enjoy
music on the web. And at the same time can receive the benefits of listening to music.
Hyper Text: HyperText simply means "Text within Text." A text has a link within it,
is a hypertext. Whenever you click on a link which brings you to a new webpage, you
have clicked on a hypertext. HyperText is a way to link two or more web pages
(HTML documents) with each other.
Web Page: A web page is a document which is commonly written in HTML and
translated by a web browser. A web page can be identified by entering an URL. A
Web page can be of the static or dynamic type. With the help of HTML only, we
can create static web pages.
Hence, HTML is a markup language which is used for creating attractive web pages
with the help of styling, and which looks in a nice format on a web browser. An
HTML document is made of many HTML tags and each HTML tag contains different
content.
Tim Berners-Lee is known as the father of HTML. The first available description of
HTML was a document called "HTML Tags" proposed by Tim in late 1991. The
latest version of HTML is HTML5, which we will learn later in this tutorial.
Since the time HTML was invented there are lots of HTML versions in market, the
brief introduction about the HTML version is given below:
HTML 1.0: The first version of HTML was 1.0, which was the barebones version of
HTML language, and it was released in1991.
HTML 2.0: This was the next version which was released in 1995, and it was
standard language version for website design. HTML 2.0 was able to support extra
features such as form-based file upload, form elements such as text box, option
button, etc.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This version
was capable of creating tables and providing support for extra options for form
elements. It can also support a web page with complex mathematical equations. It
became an official standard for any browser till January 1997. Today it is practically
supported by most of the browsers.
HTML 4.01: HTML 4.01 version was released on December 1999, and it is a very
stable version of HTML language. This version is the current official standard, and it
provides added support for stylesheets (CSS) and scripting ability for various
multimedia elements.
HTML5 : HTML5 is the newest version of HyperText Markup language. The first
draft of this version was announced in January 2008. There are two major
organizations one is W3C (World Wide Web Consortium), and another one is
WHATWG( Web Hypertext Application Technology Working Group) which are
involved in the development of HTML 5 version, and still, it is under development.
4) It facilitates programmers to add a link on the web pages (by html anchor tag), so it
enhances the interest of browsing of the user.
CSS is designed to make style sheets for the web. It is independent of HTML and
can be used with any XML-based markup language. Now let’s try to break the
acronym:
1996: CSS was published on 17th November with influencer Bert Bos
Device Compatibility
Easily maintainable
Consistent and spontaneous changes
Ability to re-position
2.3.3 JAVASCRIPT
2.3.3.1 INTRODUCTION
Although, JavaScript has no connectivity with Java programming language. The name
was suggested and provided in the times when Java was gaining popularity in the
market. In addition to web browsers, databases such as CouchDB and MongoDB uses
JavaScript as their scripting and query language.
In 1993, Mosaic, the first popular web browser, came into existence. In the year
1994, Netscape was founded by Marc Andreessen. He realized that the web needed
to become more dynamic. Thus, a 'glue language' was believed to be provided to
HTML to make web designing easy for designers and part-time programmers.
Consequently, in 1995, the company recruited Brendan Eich intending to implement
and embed Scheme programming language to the browser. But, before Brendan could
start, the company merged with Sun Microsystems for adding Java into its Navigator
so that it could compete with Microsoft over the web technologies and platforms.
Now, two languages were there: Java and the scripting language. Further, Netscape
decided to give a similar name to the scripting language as Java's. It led to 'Javascript'.
Finally, in May 1995, Marc Andreessen coined the first code of Javascript named
'Mocha'. Later, the marketing team replaced the name with 'LiveScript'. But, due to
trademark reasons and certain other reasons, in December 1995, the language was
finally renamed to 'JavaScript'. From then, JavaScript came into existence.
You can install the latest version of Visual Studio Code from their official website.
After installation, you can run the editor by entering the code -n command into the
terminal. This will prompt VS Code to start and display a fresh instance. If you want
to continue working from where you left off in the previous coding session, enter
the code command without the -n flag. If you want to open VS Code in a certain
directory, navigate to the directory and enter the code -r command. You are now on
your way to writing powerful code on your VS Code environment!
VS Code supports a wide array of programming languages from Java, C++, and
Python to CSS, Go, and Dockerfile. Moreover, VS Code allows you to add on and
even creating new extensions including code linters, debuggers, and cloud and web
development support.
The VS Code user interface allows for a lot of interaction compared to other text
editors. To simplify user experience, VS Code is divided into five main regions:
CHAPTER – 3
IMPLEMENTATION
3.1 SYSTEM IMPLEMENTATION
System implementation is the important stage of project when the theoretical design is
tuned into practical system. The main stages in the implementation are as follows:
Planning
System Development
Testing
Planning is the first task in the system implementation. At the time of implementation
of any system people from different departments and system analysis involve. They
are confirmed to practical problem of controlling various activities of people outside
their own data processing departments. The line managers controlled through an
implementation coordinating committee.
4.1 CONCLUSION
The website designed is very interactive, user friendly and easy to help.
At the same time helps in the development of skills of the user. Music can
benefit in various areas like Brain growth, Language skills, Math skills,
Memory, Attention and Concentration, Co-ordination, Discipline, Joy of
life and many more.
Recommendations are more and more website like these should be
designed as it improves the skills and at the same time easy to use.
Anyone can access it on web without downloading it.
1. HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="style.css">
<title>Music App</title>
</head>
<body>
<header>
<div class="menu_side">
<h1>Playlist</h1>
<div class="playlist">
<h4 class="active"><span></span><i class="bi bi-music-note-beamed"></i> Playlist</h4>
<h4 ><span></span><i class="bi bi-music-note-beamed"></i> Last Listening</h4>
<h4 ><span></span><i class="bi bi-music-note-beamed"></i> Recommended</h4>
</div>
<div class="menu_song">
<li class="songItem">
<span>01</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="1"></i>
</li>
<li class="songItem">
<span>02</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="2"></i>
</li>
<li class="songItem">
<span>03</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="3"></i>
</li>
<li class="songItem">
<span>04</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="4"></i>
</li>
<li class="songItem">
<span>05</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="5"></i>
</li>
<li class="songItem">
<span>06</span>
<img src="img/1.jpg" alt="Alan">
<h5>
On My Way
<div class="subtitle">Alan Walker</div>
</h5>
<i class="bi playListPlay bi-play-circle-fill" id="6"></i>
</li>
</div>
</div>
<div class="song_side">
<nav>
<ul>
<li>Discover <span></span></li>
<li>MY LIBRARY</li>
<li>RADIO</li>
</ul>
<div class="search">
<i class="bi bi-search"></i>
<input type="text" placeholder="Search Music...">
</div>
<div class="user">
<img src="img/logo.png" alt="User" title="Musico">
</div>
</nav>
<div class="content">
<h1>Alen Walker-Fade</h1>
<p>
You were the shadow to my light Did you feel us Another start You fade
<br>
Away afraid our aim is out of sight Wanna see us Alive
</p>
<div class="buttons">
<button>PLAY</button>
<button>FOLLOW</button>
</div>
</div>
<div class="popular_song">
<div class="h4">
<h4>Popular Song</h4>
<div class="btn_s">
<i id="left_scroll" class="bi bi-arrow-left-short"></i>
<i id="right_scroll" class="bi bi-arrow-right-short"></i>
</div>
</div>
<div class="pop_song">
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="7"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="8"></i>
<!-- change All id -->
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="9"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="10"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="11"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="12"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="13"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="14"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
<li class="songItem">
<div class="img_play">
<img src="img/1.jpg" alt="alan">
<i class="bi playListPlay bi-play-circle-fill" id="15"></i>
</div>
<h5>On My Way
<br>
<div class="subtitle">Alan Walker</div>
</h5>
</li>
</div>
</div>
<div class="popular_artists">
<div class="h4">
<h4>Popular Artists</h4>
<div class="btn_s">
<i id="left_scrolls" class="bi bi-arrow-left-short"></i>
<i id="right_scrolls" class="bi bi-arrow-right-short"></i>
</div>
</div>
<div class="item">
<li>
<img src="img/arjit.jpg" alt="Arjit Singh" title="Arjit Singh">
</li>
<li>
<img src="img/alan.jpg" alt="Alan Walker" title="Alan Walker">
</li>
<li>
<img src="img/atif.jpg" alt="Atif Aslam" title="Atif Aslam">
</li>
<li>
<img src="img/guru.jpg" alt="Guru RAndawa" title="Guru Randawa">
</li>
<li>
<img src="img/dhvani.jpg" alt="Dhvani" title="Dhvani">
</li>
<li>
<img src="img/Diljit_Dosanjh.jpg" alt="Diljit Dosanjh" title="Diljit Dosanjh">
</li>
<li>
<img src="img/jubin Nautiyal.jpg" alt="Jubin Nautiyal" title="Jubin Nautiyal">
</li>
<li>
<img src="img/neha.jpg" alt="Neha Kakker" title="Neha Kakker">
</li>
<li>
<img src="img/justin-bieber-lede.jpg" alt="Justin Bieber" title="Justin Bieber">
</li>
<li>
<img src="img/honey.jpg" alt="Honey Singh" title="Honey Singh">
</li>
<li>
<img src="img/akhil.jpg" alt="Akhil" title="Akhil">
</li>
<!-- change all img -->
</div>
</div>
</div>
<div class="master_play">
<div class="wave">
<div class="wave1"></div>
<div class="wave1"></div>
<div class="wave1"></div>
</div>
<img src="img/26th.jpg" alt="Alan" id="poster_master_play">
<h5 id="title">Vande Mataram<br>
<div class="subtitle">Bankim Chandra</div>
</h5>
<div class="icon">
<i class="bi bi-skip-start-fill" id="back"></i>
<i class="bi bi-play-fill" id="masterPlay"></i>
<i class="bi bi-skip-end-fill" id="next"></i>
</div>
<span id="currentStart">0:00</span>
<div class="bar">
<input type="range" id="seek" min="0" value="0" max="100">
<div class="bar2" id="bar2"></div>
<div class="dot"></div>
</div>
<span id="currentEnd">0:00</span>
<div class="vol">
<i class="bi bi-volume-down-fill" id="vol_icon"></i>
<input type="range" id="vol" min="0" value="30" max="100">
<div class="vol_bar"></div>
<div class="dot" id="vol_dot"></div>
</div>
</div>
</header>
<script src="app.js"></script>
</body>
</html>
2. CSS
/* Google Font 'Poppins' */
@import url('https://fonts.googleapis.com/css2?
family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
*{
padding: 0%;
margin: 0%;
box-sizing: border-box;
}
body {
width: 100%;
height: 100vh;
background-color: #131312;
font-family: 'Poppins' , sans-serif;
display: flex;
align-items: center;
justify-content: center;
}
header {
width: 85%;
height: 95%;
/* border: 1px solid #fff; */
display: flex;
flex-wrap: wrap;
overflow: hidden;
}
header .song_side {
width: 75%;
background: #0b1320;
}
header .master_play {
width: 100%;
height: 10%;
background: #111727;
box-shadow: 0px 3px 8px #090f1f;
}
header .menu_side h1 {
font-size: 20px;
margin: 15px 0px 0px 20px;
font-weight: 500;
}
header .menu_side .playlist {
margin: 40px 0px 0px 20px;
}
header .master_play {
display: flex;
align-items: center;
padding: 0px 20px;
}
header .master_play .wave{
width: 30px;
height: 30px;
/* border: 1px solid #fff; */
padding-bottom: 5px;
display: flex;
align-items: flex-end;
margin-right: 10px;
}
header .master_play .wave .wave1{
width: 3px;
height: 10px;
margin-right: 3px ;
border-radius: 10px 10px 0px 0px ;
background: #36e2ec;
animation: unset;
}
header .master_play .wave .wave1:nth-child(2){
height: 13px;
/* animation-delay: .4s; */
}
header .master_play .wave .wave1:nth-child(3){
height: 8px;
/* animation-delay: .8s; */
}
/* javascript class wave */
header .master_play .active2 .wave1{
animation: wave .5s linear infinite;
}
header .master_play .active2 .wave1:nth-child(2){
animation-delay: .4s;
}
header .master_play .active2 .wave1:nth-child(3){
animation-delay: .8s;
}
@keyframes wave {
0%{
height: 10px;
}
50%{
height: 15px;
}
100%{
height: 10px;
}
}
header .song_side {
z-index: 2;
}
header .song_side::before{
content: '';
position: absolute;
width: 100%;
height: 300px;
background: url('bg.png');
z-index: -1;
}
header .song_side nav{
width: 90%;
height: 10%;
margin: auto;
/* border: 1px solid #fff; */
display: flex;
align-items: center;
justify-content: space-between;
}
header .song_side nav ul{
display: flex;
}
header .song_side nav ul li{
position: relative;
list-style-type: none;
font-size: 13px;
color: #4c5262;
margin-right: 25px;
cursor: pointer;
transition: .3s linear;
}
header .song_side nav ul li:hover{
color: #fff;
}
header .song_side nav ul li:nth-child(1){
color: #fff;
}
header .song_side nav ul li span{
position: absolute;
width: 100%;
height: 2.5px;
background: #36e2ec;
bottom: -5px;
left: 0;
border-radius: 20px;
}
header .song_side nav .search{
position: relative;
width: 40%;
padding: 1px 10px;
border-radius: 20px;
color: gray;
}
header .song_side nav .search::before{
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 20px;
background: rgb(184, 184, 184,.1);
backdrop-filter: blur(5px);
z-index: -1;
}
header .song_side nav .search .bi{
font-size: 13px;
padding: 3px 0px 0px 10px;
}
header .song_side nav .search input{
background: none;
outline: none;
border: none;
padding: 0px 10px;
color: #fff;
font-size: 12px;
}
header .song_side nav .user{
position: relative;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
}
header .song_side nav .user img{
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
box-shadow: 2px 2px 8px #131312;
}
// create Array
const songs = [
{
id:'1',
songName:` On My Way <br>
<div class="subtitle">Alan Walker</div>`,
poster: "img/1.jpg"
},
{
id:'2',
songName:` Alan Walker-Fade <br>
<div class="subtitle">Alan Walker</div>`,
poster: "img/2.jpg"
},
// all object type
{
id:"3",
songName: `Cartoon - On & On <br><div class="subtitle"> Daniel Levi</div>`,
poster: "img/3.jpg",
},
{
id:"4",
songName: `Warriyo - Mortals <br><div class="subtitle">Mortals</div>`,
poster: "img/4.jpg",
},
{
id:"5",
songName: `Ertugrul Gazi <br><div class="subtitle">Ertugrul</div>`,
poster: "img/5.jpg",
},
{
id:"6",
songName: `Electronic Music <br><div class="subtitle">Electro</div>`,
poster: "img/6.jpg",
},
{
id:"7",
songName: `Agar Tum Sath Ho <br><div class="subtitle">Tamashaa</div>`,
poster: "img/7.jpg",
},
{
id:"8",
songName: `Suna Hai <br><div class="subtitle">Neha Kakker</div>`,
poster: "img/8.jpg",
},
{
id:"9",
songName: `Dilber <br><div class="subtitle">Satyameva Jayate</div>`,
poster: "img/9.jpg",
},
{
id:"10",
songName: `Duniya <br><div class="subtitle">Luka Chuppi</div>`,
poster: "img/10.jpg",
},
{
id:"11",
songName: `Lagdi Lahore Di <br><div class="subtitle">Street Dancer 3D</div>`,
poster: "img/11.jpg",
},
{
id:"12",
songName: `Putt Jatt Da <br><div class="subtitle">Putt Jatt Da</div>`,
poster: "img/12.jpg",
},
{
id:"13",
songName: `Baarishein <br><div class="subtitle">Atif Aslam</div>`,
poster: "img/13.jpg",
},
{
id:"14",
songName: `Vaaste <br><div class="subtitle">Dhvani Bhanushali</div>`,
poster: "img/14.jpg",
},
{
id:"15",
songName: `Lut Gaye <br><div class="subtitle">Jubin Nautiyal</div>`,
poster: "img/15.jpg",
},
]
Array.from(document.getElementsByClassName('songItem')).forEach((element, i)=>{
element.getElementsByTagName('img')[0].src = songs[i].poster;
element.getElementsByTagName('h5')[0].innerHTML = songs[i].songName;
})
let masterPlay = document.getElementById('masterPlay');
let wave = document.getElementsByClassName('wave')[0];
masterPlay.addEventListener('click',()=>{
if (music.paused || music.currentTime <=0) {
music.play();
masterPlay.classList.remove('bi-play-fill');
masterPlay.classList.add('bi-pause-fill');
wave.classList.add('active2');
} else {
music.pause();
masterPlay.classList.add('bi-play-fill');
masterPlay.classList.remove('bi-pause-fill');
wave.classList.remove('active2');
}
})
let index = 0;
let poster_master_play = document.getElementById('poster_master_play');
let title = document.getElementById('title');
Array.from(document.getElementsByClassName('playListPlay')).forEach((element)=>{
element.addEventListener('click', (e)=>{
index = e.target.id;
makeAllPlays();
e.target.classList.remove('bi-play-circle-fill');
e.target.classList.add('bi-pause-circle-fill');
music.src = `audio/${index}.mp3`;
poster_master_play.src =`img/${index}.jpg`;
music.play();
let song_title = songs.filter((ele)=>{
return ele.id == index;
})
song_title.forEach(ele =>{
let {songName} = ele;
title.innerHTML = songName;
})
masterPlay.classList.remove('bi-play-fill');
masterPlay.classList.add('bi-pause-fill');
wave.classList.add('active2');
music.addEventListener('ended',()=>{
masterPlay.classList.add('bi-play-fill');
masterPlay.classList.remove('bi-pause-fill');
wave.classList.remove('active2');
})
makeAllBackgrounds();
Array.from(document.getElementsByClassName('songItem'))[`${index-1}`].style.background = "rgb(105, 105,
170, .1)";
})
})
music.addEventListener('timeupdate',()=>{
let music_curr = music.currentTime;
let music_dur = music.duration;
seek.addEventListener('change', ()=>{
music.currentTime = seek.value * music.duration/100;
})
music.addEventListener('ended', ()=>{
masterPlay.classList.add('bi-play-fill');
masterPlay.classList.remove('bi-pause-fill');
wave.classList.remove('active2');
})
vol.addEventListener('change', ()=>{
if (vol.value == 0) {
vol_icon.classList.remove('bi-volume-down-fill');
vol_icon.classList.add('bi-volume-mute-fill');
vol_icon.classList.remove('bi-volume-up-fill');
}
if (vol.value > 0) {
vol_icon.classList.add('bi-volume-down-fill');
vol_icon.classList.remove('bi-volume-mute-fill');
vol_icon.classList.remove('bi-volume-up-fill');
}
if (vol.value > 50) {
vol_icon.classList.remove('bi-volume-down-fill');
vol_icon.classList.remove('bi-volume-mute-fill');
vol_icon.classList.add('bi-volume-up-fill');
}
back.addEventListener('click', ()=>{
index -= 1;
if (index < 1) {
index = Array.from(document.getElementsByClassName('songItem')).length;
}
music.src = `audio/${index}.mp3`;
poster_master_play.src =`img/${index}.jpg`;
music.play();
let song_title = songs.filter((ele)=>{
return ele.id == index;
})
song_title.forEach(ele =>{
let {songName} = ele;
title.innerHTML = songName;
})
makeAllPlays()
document.getElementById(`${index}`).classList.remove('bi-play-fill');
document.getElementById(`${index}`).classList.add('bi-pause-fill');
makeAllBackgrounds();
Array.from(document.getElementsByClassName('songItem'))[`${index-1}`].style.background = "rgb(105, 105,
170, .1)";
})
next.addEventListener('click', ()=>{
index -= 0;
index += 1;
if (index > Array.from(document.getElementsByClassName('songItem')).length) {
index = 1;
}
music.src = `audio/${index}.mp3`;
poster_master_play.src =`img/${index}.jpg`;
music.play();
let song_title = songs.filter((ele)=>{
return ele.id == index;
})
song_title.forEach(ele =>{
let {songName} = ele;
title.innerHTML = songName;
})
makeAllPlays()
document.getElementById(`${index}`).classList.remove('bi-play-fill');
document.getElementById(`${index}`).classList.add('bi-pause-fill');
makeAllBackgrounds();
Array.from(document.getElementsByClassName('songItem'))[`${index-1}`].style.background = "rgb(105, 105,
170, .1)";
})
left_scroll.addEventListener('click', ()=>{
pop_song.scrollLeft -= 330;
})
right_scroll.addEventListener('click', ()=>{
pop_song.scrollLeft += 330;
})
let left_scrolls = document.getElementById('left_scrolls');
let right_scrolls = document.getElementById('right_scrolls');
let item = document.getElementsByClassName('item')[0];
left_scrolls.addEventListener('click', ()=>{
item.scrollLeft -= 330;
})
right_scrolls.addEventListener('click', ()=>{
item.scrollLeft += 330;
})