-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
221 lines (209 loc) · 11.8 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
window.addEventListener("DOMContentLoaded", function () {
var banner = document.querySelector(".banner");
var bannerImage = document.querySelector(".banner .left-img");
var bannerHeading = document.querySelector(".banner .heading h1");
var bannerTexwindow.addEventListener("DOMContentLoaded", function () {
var banner = document.querySelector(".banner");
var bannerImage = document.querySelector(".banner .left-img");
var bannerHeading = document.querySelector(".banner .heading h1");
var bannerText = document.querySelector(".banner .heading p");
// Set the default banner image and text
banner.style.backgroundImage = "url(images/banner1.svg)";
bannerImage.setAttribute("src", "images/image.png");
bannerHeading.textContent = "Deep Focus";
bannerText.textContent = "Keep your focus and enjoy the serenity";
});
function playAll(songNumber){
var audioElement= document.getElementById("song");
var playBtn=document.getElementById("play-pause");
var songFileName = "music/"+songNumber+".mp3";
var currentRow= document.getElementById("song"+songNumber);
var banner = document.querySelector(".banner");
var bannerImage = document.querySelector(".banner .left-img");
var bannerHeading = document.querySelector(".banner .heading h1");
var bannerText = document.querySelector(".banner .heading p");
if(audioElement.getAttribute("src")==songFileName && !audioElement.paused){
audioElement.pause();
playBtn.innerHTML='<img src="images/play-button.svg">';
banner.style.backgroundImage = "url(images/banner1.svg)";
bannerImage.setAttribute("src", "images/image.png");
bannerHeading.textContent = "Deep Focus";
bannerText.textContent = "Keep your focus and enjoy the serenity";
}
else{
audioElement.setAttribute("src",songFileName);
audioElement.play();
playBtn.innerHTML='<img src="images/pause-button.svg">';
if (songNumber === 1) {
banner.style.backgroundImage = "url(images/b01.png)";
bannerImage.setAttribute("src", "images/image 1.png");
bannerHeading.textContent = "Mike Posner - I took a pill in Ibiza (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
} else if (songNumber === 2) {
banner.style.backgroundImage = "url(images/b02.png)";
bannerImage.setAttribute("src", "images/image 2.png");
bannerHeading.textContent = "Ghar (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 3) {
banner.style.backgroundImage = "url(images/b03.png)";
bannerImage.setAttribute("src", "images/image 3.png");
bannerHeading.textContent = "Kahi to hogi woh (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 4) {
banner.style.backgroundImage = "url(images/b04.png)";
bannerImage.setAttribute("src", "images/image 4.jpg");
bannerHeading.textContent = "Kasoor (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 5) {
banner.style.backgroundImage = "url(images/b05.png)";
bannerImage.setAttribute("src", "images/image 5.png");
bannerHeading.textContent = "Tu Hai Kahan";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 6) {
banner.style.backgroundImage = "url(images/b06.png)";
bannerImage.setAttribute("src", "images/image 6.png");
bannerHeading.textContent = "Baarishein - Anuv Jain (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 7) {
banner.style.backgroundImage = "url(images/b07.png)";
bannerImage.setAttribute("src", "images/image 7.png");
bannerHeading.textContent = "Waqt Ki Baatein (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 8) {
banner.style.backgroundImage = "url(images/b08.png)";
bannerImage.setAttribute("src", "images/image 8.png");
bannerHeading.textContent = "Lovely feat. Anika Vidyarthi (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 9) {
banner.style.backgroundImage = "url(images/b09.png)";
bannerImage.setAttribute("src", "images/image 9.png");
bannerHeading.textContent = "Let me down slowly - Alec Benjamin (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 10) {
banner.style.backgroundImage = "url(images/b010.png)";
bannerImage.setAttribute("src", "images/image 10.png");
bannerHeading.textContent = "Jee Le Zara - (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
}
}
function playaudio(){
var audio=document.getElementById("song");
var playBtn=document.getElementById("play-pause");
if(audio.paused){
audio.play();
playBtn.innerHTML='<img src="images/pause-button.svg">';
}
else{
audio.pause();
playBtn.innerHTML='<img src="images/play-button.svg">';
}
}t = document.querySelector(".banner .heading p");
// Set the default banner image and text
banner.style.backgroundImage = "url(images/banner1.svg)";
bannerImage.setAttribute("src", "images/image.png");
bannerHeading.textContent = "Deep Focus";
bannerText.textContent = "Keep your focus and enjoy the serenity";
});
function playAll(songNumber){
var audioElement= document.getElementById("song");
var playBtn=document.getElementById("play-pause");
var songFileName = "music/"+songNumber+".mp3";
var currentRow= document.getElementById("song"+songNumber);
var banner = document.querySelector(".banner");
var bannerImage = document.querySelector(".banner .left-img");
var bannerHeading = document.querySelector(".banner .heading h1");
var bannerText = document.querySelector(".banner .heading p");
if(audioElement.getAttribute("src")==songFileName && !audioElement.paused){
audioElement.pause();
playBtn.innerHTML='<img src="images/play-button.svg">';
banner.style.backgroundImage = "url(images/banner1.svg)";
bannerImage.setAttribute("src", "images/image.png");
bannerHeading.textContent = "Deep Focus";
bannerText.textContent = "Keep your focus and enjoy the serenity";
}
else{
audioElement.setAttribute("src",songFileName);
audioElement.play();
playBtn.innerHTML='<img src="images/pause-button.svg">';
if (songNumber === 1) {
banner.style.backgroundImage = "url(images/b01.png)";
bannerImage.setAttribute("src", "images/image 1.png");
bannerHeading.textContent = "Mike Posner - I took a pill in Ibiza (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
} else if (songNumber === 2) {
banner.style.backgroundImage = "url(images/b02.png)";
bannerImage.setAttribute("src", "images/image 2.png");
bannerHeading.textContent = "Ghar (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 3) {
banner.style.backgroundImage = "url(images/b03.png)";
bannerImage.setAttribute("src", "images/image 3.png");
bannerHeading.textContent = "Kahi to hogi woh (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 4) {
banner.style.backgroundImage = "url(images/b04.png)";
bannerImage.setAttribute("src", "images/image 4.jpg");
bannerHeading.textContent = "Kasoor (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 5) {
banner.style.backgroundImage = "url(images/b05.png)";
bannerImage.setAttribute("src", "images/image 5.png");
bannerHeading.textContent = "Tu Hai Kahan";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 6) {
banner.style.backgroundImage = "url(images/b06.png)";
bannerImage.setAttribute("src", "images/image 6.png");
bannerHeading.textContent = "Baarishein - Anuv Jain (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 7) {
banner.style.backgroundImage = "url(images/b07.png)";
bannerImage.setAttribute("src", "images/image 7.png");
bannerHeading.textContent = "Waqt Ki Baatein (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 8) {
banner.style.backgroundImage = "url(images/b08.png)";
bannerImage.setAttribute("src", "images/image 8.png");
bannerHeading.textContent = "Lovely feat. Anika Vidyarthi (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 9) {
banner.style.backgroundImage = "url(images/b09.png)";
bannerImage.setAttribute("src", "images/image 9.png");
bannerHeading.textContent = "Let me down slowly - Alec Benjamin (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
else if (songNumber === 10) {
banner.style.backgroundImage = "url(images/b010.png)";
bannerImage.setAttribute("src", "images/image 10.png");
bannerHeading.textContent = "Jee Le Zara - (Cover)";
bannerText.textContent = "By Ishaan Kaushik";
}
}
}
function playaudio(){
var audio=document.getElementById("song");
var playBtn=document.getElementById("play-pause");
if(audio.paused){
audio.play();
playBtn.innerHTML='<img src="images/pause-button.svg">';
}
else{
audio.pause();
playBtn.innerHTML='<img src="images/play-button.svg">';
}
}