forked from sonal-alt/musiic.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeriMeriLadayi.html
445 lines (331 loc) · 8.07 KB
/
TeriMeriLadayi.html
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>favoplayer-Teri Bhabhi song </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" href="cd.png" type="image">
<meta name='viewport'
content='width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0'>
</head>
<body>
<style>
body {
font-size: 15pt;
}
*{
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}
body{
background: linear-gradient(to right, #5D6D7E, #566573);}
#title{
text-align: center;
font-weight:bold;
font-size:20px;
color:white;
color: #fff;
}
#track_image{
height: 200px;
width: auto;
margin:0px auto;
margin-left:auto;
margin-right:auto;
display: block;
box-shadow: 1px 0px 20px 12px rgba(20,2,240,0.2);
border-radius:5px;
margin-top:22px;
margin-bottom:12px;
}
input[type="range"] {
-webkit-appearance: none;
outline: none;
height: 2px;
}
input[type="range"]::-webkit-slider-thumb{
-webkit-appearance: none;
height: 10px;
width: 10px;
background: #FF8A65;
border-radius: 50%;
cursor: pointer;
}
.duration{
width: 300px;
margin:6px;
}
.right button:hover{
background: #FF8A65;
margin:8 px;
}
.right i:before{
color: #fff;
font-size: 20px;
}
.right .middle{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.right .middle button{
border: none;
height: 70px;
width: 70px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
outline: none;
transition: 0.5s;
background: rgba(255,255,255,0.1);
word-spacing: space;
}
.right #auto{
font-size: 18px;
cursor: pointer;
margin-top: 45px;
border: none;
padding: 10px 14px;
color: #fff;
background: rgba(255,255,255,0.2);
outline: none;
border-radius: 10px;
}
.right #auto i{
margin-left: 8px;
}
#play{
background: #FF8A65;
}
.right button:hover{
background: #FF8A65;
}
.right i:before{
color: #fff;
font-size: 20px;
}
.right{
position: fixed;
bottom:0;
justify-content: center;
background: linear-gradient(to right, #5D6D7E, #566573);
}
.down{
position: fixed;
bottom:0;
background: linear-gradient(to right, #5D6D7E, #566573);
height:103px;
width:500px;
}
hr{
color: black;
}
.lyrics{
margin-left:12px;
margin-right:12px;
display: block;
color:white;
box-shadow: 1px 0px 20px 12px rgba(20,2,240,0.2);
border-radius:5px;
margin-top:302px;
margin-bottom:12px;
border: 3px solid red;
margin-bottom:120px;
}
.stop{position:fixed;
background: linear-gradient(to right, #5D6D7E, #566573);
border-radius:5px;
}
</style>
<body>
<div class="stop">
<div class="main">
</div>
<p id="title"></p>
<!--- left part --->
<div class="left">
<!--- song img --->
<img id="track_image">
</div>
</div>
<hr/>
<div class="lyrics">
<p id="artist">
</p>
</div>
<hr/>
<div class="volume">
<!--<p id="volume_show">90</p>
<i class="fa fa-volume-up" aria-hidden="true" onclick="mute_sound()" id="volume_icon"></i>-->
<!-- <input type="range" min="0" max="100" value="90" onchange="volume_change()" id="volume"> -->
</div>
</div>
<!--- right part --->
<div class="right">
<!--- song title & artist name --->
<!--- middle part --->
<div class="down">
<div class="middle">
<button onclick="previous_song()" id="pre"><i class="fa fa-step-backward" aria-hidden="true"></i></button>
<button onclick="justplay()" id="play"><i class="fa fa-play" aria-hidden="true"></i></button>
<button onclick="next_song()" id="next"><i class="fa fa-step-forward" aria-hidden="true"></i></button>
</div>
<!--- song duration part --->
<div class="duration">
<input type="range" min="0" max="100" value="0" id="duration_slider" onchange="change_duration()"
>
</div>
</div>
</div>
<div class="show_song_no">
<!-- <button id="auto" onclick="autoplay_switch()">Auto play <i class="fa fa-circle-o-notch" aria-hidden="true"></i></button>-->
</div>
</div>
</body>
<script>
console.log('Hello World!');
let previous = document.querySelector('#pre');
let play = document.querySelector('#play');
let next = document.querySelector('#next');
let title = document.querySelector('#title');
let recent_volume= document.querySelector('#volume');
let volume_show = document.querySelector('#volume_show');
let slider = document.querySelector('#duration_slider');
let show_duration = document.querySelector('#show_duration');
let track_image = document.querySelector('#track_image');
let auto_play = document.querySelector('#auto');
let present = document.querySelector('#present');
let total = document.querySelector('#total');
let artist = document.querySelector('#artist');
let timer;
let autoplay = 0;
let index_no = 0;
let Playing_song = false;
//create a audio Element
let track = document.createElement('audio');
//All songs list
let All_song = [
{
name: "LaalChunariya song by Akull",
path: "Laal Chunariya - Akull.mp3",
img: "LaalChunariya.jpeg",
singer: "e"
},
]
// All functions
// function load the track
function load_track(index_no){
clearInterval(timer);
reset_slider();
track.src = All_song[index_no].path;
title.innerHTML = All_song[index_no].name;
track_image.src = All_song[index_no].img;
artist.innerHTML = All_song[index_no].singer;
track.load();
timer = setInterval(range_slider ,1000);
total.innerHTML = All_song.length;
present.innerHTML = index_no + 1;
}
load_track(index_no);
//mute sound function
function mute_sound(){
track.volume = 0;
volume.value = 0;
volume_show.innerHTML = 0;
}
// checking.. the song is playing or not
function justplay(){
if(Playing_song==false){
playsong();
}else{
pausesong();
}
}
// reset song slider
function reset_slider(){
slider.value = 0;
}
// play song
function playsong(){
track.play();
Playing_song = true;
play.innerHTML = '<i class="fa fa-pause" aria-hidden="true"></i>';
}
//pause song
function pausesong(){
track.pause();
Playing_song = false;
play.innerHTML = '<i class="fa fa-play" aria-hidden="true"></i>';
}
// next song
function next_song(){
if(index_no < All_song.length - 1){
index_no += 1;
load_track(index_no);
playsong();
}else{
index_no = 0;
load_track(index_no);
playsong();
}
}
// previous song
function previous_song(){
if(index_no > 0){
index_no -= 1;
load_track(index_no);
playsong();
}else{
index_no = All_song.length;
load_track(index_no);
playsong();
}
}
// change volume
function volume_change(){
volume_show.innerHTML = recent_volume.value;
track.volume = recent_volume.value / 100;
}
// change slider position
function change_duration(){
slider_position = track.duration * (slider.value / 100);
track.currentTime = slider_position;
}
// autoplay function
function autoplay_switch(){
if (autoplay==1){
autoplay = 0;
auto_play.style.background = "rgba(255,255,255,0.2)";
}else{
autoplay = 1;
auto_play.style.background = "#FF8A65";
}
}
function range_slider(){
let position = 0;
// update slider position
if(!isNaN(track.duration)){
position = track.currentTime * (100 / track.duration);
slider.value = position;
}
// function will run when the song is over
if(track.ended){
play.innerHTML = '<i class="fa fa-play" aria-hidden="true"></i>';
if(autoplay==1){
index_no += 1;
load_track(index_no);
playsong();
}
}
}
</script>
</html>