-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
496 lines (426 loc) · 17.1 KB
/
index.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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="img/13.jpg" type="image/x-icon">
<link rel="stylesheet" href="bootstrap-5.1.3-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<title>Music Station B13</title>
</head>
<body>
<header>
<a href="index.html" class="logo">Music X-B13</a>
<nav class="navigation">
<a href="#Home">Home</a>
<a href="#Services">Services</a>
<a href="#Music">Music</a>
<a href="#Contacts">Contacts</a>
</nav>
<div> <button type="button" class="log-in"> <a href="login.html"> log in </a> </button></div>
<div> <button type="button" class="sign-up"> <a href="signup.html"> Sign Up</a> </button></div>
</header>
<section class="main" id="Home">
<div>
<h2> <br><span> Music Distribution for Artists </span></h2>
<h3> Distribute your music to Spotify, Apple Music, Google Play, Amazon Music and more. (Made BOLIVAR)</h3>
<a href="" class="main-btn"> </a>
<div class="social-icons">
<a href="https://www.reddit.com/user/logan_bng" style="color: orangered;" > <i class="fab fa-reddit" ></i></a>
<a href="https://github.com/Bolivar13" style="color: gray;"><i class="fab fa-github"></i></a>
<a href="https://open.spotify.com/user/31sfebkgy25mh7bqud6wjnvm2omq " style="color: #1ed760; " ><i class="fab fa-spotify"></i></a>
<a href="https://twitter.com/th13teen_x"style=" color: rgb(29, 155, 240); " ><i class="fab fa-twitter"></i></a>
<!----------- button start ---------->
<div class="start" >
<a href="signup.html"> Get Started </a>
</div>
</div>
</div>
</section>
<section class="music" id="Music">
<center>
<script src="https://cdn.lordicon.com/lusqsztk.js"></script>
---- <lord-icon
src="https://cdn.lordicon.com/xqndcrvb.json"
trigger="loop"
style="width:100px;height:100px">
</lord-icon> ----
</center>
<h2 class="title">Music</h2>
<div class="player">
<div class="player__header">
<div class="player__img player__img--absolute slider">
<button class="player__button player__button--absolute--nw playlist">
<img src="http://physical-authority.surge.sh/imgs/icon/playlist.svg" alt="playlist-icon">
</button>
<button class="player__button player__button--absolute--center play">
<img src="http://physical-authority.surge.sh/imgs/icon/play.svg" alt="play-icon">
<img src="http://physical-authority.surge.sh/imgs/icon/pause.svg" alt="pause-icon">
</button>
<div class="slider__content">
<!-- <img class="img slider__img" src="img/mouden.jpg" alt="cover"> -->
<!-- <img class="img slider__img" src="img/wesh.jpg" alt="cover"> -->
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/1.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/2.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/3.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/4.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/5.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/6.jpg" alt="cover">
<img class="img slider__img" src="http://physical-authority.surge.sh/imgs/7.jpg" alt="cover">
</div>
</div>
<div class="player__controls">
<button class="player__button back">
<!------------------------img----------------------------->
<img class="img" src="img/back .png" alt="back-icon">
</button>
<p class="player__context slider__context">
<strong class="slider__name"></strong>
<span class="player__title slider__title"></span>
</p>
<button class="player__button next">
<img class="img" src="img/next.png" alt="next-icon">
</button>
<div class="progres">
<div class="progres__filled"></div>
</div>
</div>
</div>
<ul class="player__playlist list">
<li class="player__song">
<img class="player__img img" src="img/no-time.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name">no time</b>
<span class="flex">
<span class="player__title">lastlings</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/1.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/weeknd.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name">blinding lights</b>
<span class="flex">
<span class="player__title">the weeknd</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/2.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/enrasta.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name">джованна</b>
<span class="flex">
<span class="player__title">enrasta</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/3.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/a man.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name">a man</b>
<span class="flex">
<span class="player__title">travis scott</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/4.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/zaxx.jpg" alt="cover">
<p class="player__context ">
<b class="player__song-name">unforgetting</b>
<span class="flex">
<span class="player__title">zaxx</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/5.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/waharan.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name">waharan</b>
<span class="flex">
<span class="player__title">Randall</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/6.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/starlight.jpg" alt="cover">
<p class="player__context ">
<b class="player__song-name">starlight feat mr gabriel <span class="uppercase">4am</span> remix</b>
<span class="flex">
<span class="player__title">jai wolf</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="http://physical-authority.surge.sh/music/7.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/mouden.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name"> Music 1 </b>
<span class="flex">
<span class="player__title">Artist 1</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="aud/Yemma.mp3"></audio>
</li>
<li class="player__song">
<img class="player__img img" src="img/wesh.jpg" alt="cover">
<p class="player__context">
<b class="player__song-name"> Music 2 </b>
<span class="flex">
<span class="player__title">Artist 2</span>
<span class="player__song-time"></span>
</span>
</p>
<audio class="audio" src="aud/wesh.mp3"></audio>
</li>
<!---------------------------end img--------------------->
</ul>
</div>
</section>
<section class="cards contact" id="Contacts">
<center> ---- <script src="https://cdn.lordicon.com/lusqsztk.js">
</script>
<lord-icon
src="https://cdn.lordicon.com/jnlncdtk.json"
trigger="loop"
style="width:100px;height:100px">
</lord-icon> ----
</center>
<h2 class="title">Contacts</h2>
<div class="content">
<div class="card">
<div class="icon">
<i class="fas fa-phone"></i>
</div>
<div class="info">
<h3>Phone</h3>
<p type="phone">+212689901798</p>
</div>
</div>
<div class="card">
<div class="icon">
<i class="fas fa-envelope"></i>
</div>
<div class="info">
<h3>Email</h3>
<p type="email">[email protected]</p>
</div>
</div>
</div>
</section>
<footer class="footer">
<p class="footer-title">Copyrights ©
<span>Mohamed BENGRA</span></p>
<div class="social-icons">
<a href=" https://github.com/Bolivar13" style="color: grey; "><i class="fab fa-github"></i></a>
<a href="https://twitter.com/th13teen_x?t=LgUBbkimI_Du1POHV4DK5Q&s=09" style=" color: rgb(29, 155, 240);"><i class="fab fa-twitter"></i></a>
<a href="https://instagram.com/th13teen.web?utm_medium=copy_link" style="color: rgb(225,48,108) " ><i class="fab fa-instagram"></i></a>
<a href="https://youtube.com/channel/UCzs2-VPY-s65GgOEBZUDb2g" style="color: red; " ><i class="fab fa-youtube"></i></a>
</div>
</footer>
<!----------JavaScript----------->
<script>
// Original image: https://dribbble.com/shots/6957353-Music-Player-Widget
"use strict";
const bgBody = ["#e5e7e9", "#ff4545", "#f8ded3", "#ffc382", "#f5eda6", "#ffcbdc", "#dcf3f3"];
const body = document.body;
const player = document.querySelector(".player");
const playerHeader = player.querySelector(".player__header");
const playerControls = player.querySelector(".player__controls");
const playerPlayList = player.querySelectorAll(".player__song");
const playerSongs = player.querySelectorAll(".audio");
const playButton = player.querySelector(".play");
const nextButton = player.querySelector(".next");
const backButton = player.querySelector(".back");
const playlistButton = player.querySelector(".playlist");
const slider = player.querySelector(".slider");
const sliderContext = player.querySelector(".slider__context");
const sliderName = sliderContext.querySelector(".slider__name");
const sliderTitle = sliderContext.querySelector(".slider__title");
const sliderContent = slider.querySelector(".slider__content");
const sliderContentLength = playerPlayList.length - 1;
const sliderWidth = 100;
let left = 0;
let count = 0;
let song = playerSongs[count];
let isPlay = false;
const pauseIcon = playButton.querySelector("img[alt = 'pause-icon']");
const playIcon = playButton.querySelector("img[alt = 'play-icon']");
const progres = player.querySelector(".progres");
const progresFilled = progres.querySelector(".progres__filled");
let isMove = false;
// creatE functions :
function openPlayer() {
playerHeader.classList.add("open-header");
playerControls.classList.add("move");
slider.classList.add("open-slider");
}
function closePlayer() {
playerHeader.classList.remove("open-header");
playerControls.classList.remove("move");
slider.classList.remove("open-slider");
}
function next(index) {
count = index || count;
if (count == sliderContentLength) {
count = count;
return;
}
left = (count + 1) * sliderWidth;
left = Math.min(left, (sliderContentLength) * sliderWidth);
sliderContent.style.transform = `translate3d(-${left}%, 0, 0)`;
count++;
run();
}
function back(index) {
count = index || count;
if (count == 0) {
count = count;
return;
}
left = (count - 1) * sliderWidth;
left = Math.max(0, left);
sliderContent.style.transform = `translate3d(-${left}%, 0, 0)`;
count--;
run();
}
function changeSliderContext() {
sliderContext.style.animationName = "opacity";
sliderName.textContent = playerPlayList[count].querySelector(".player__title").textContent;
sliderTitle.textContent = playerPlayList[count].querySelector(".player__song-name").textContent;
if (sliderName.textContent.length > 16) {
const textWrap = document.createElement("span");
textWrap.className = "text-wrap";
textWrap.innerHTML = sliderName.textContent + " " + sliderName.textContent;
sliderName.innerHTML = "";
sliderName.append(textWrap);
}
if (sliderTitle.textContent.length >= 18) {
const textWrap = document.createElement("span");
textWrap.className = "text-wrap";
textWrap.innerHTML = sliderTitle.textContent + " " + sliderTitle.textContent;
sliderTitle.innerHTML = "";
sliderTitle.append(textWrap);
}
}
function changeBgBody() {
body.style.backgroundColor = bgBody[count];
}
function selectSong() {
song = playerSongs[count];
for (const item of playerSongs) {
if (item != song) {
item.pause();
item.currentTime = 0;
}
}
if (isPlay) song.play();
}
function run() {
changeSliderContext();
changeBgBody();
selectSong();
}
function playSong() {
if (song.paused) {
song.play();
playIcon.style.display = "none";
pauseIcon.style.display = "block";
}else{
song.pause();
isPlay = false;
playIcon.style.display = "";
pauseIcon.style.display = "";
}
}
function progresUpdate() {
const progresFilledWidth = (this.currentTime / this.duration) * 100 + "%";
progresFilled.style.width = progresFilledWidth;
if (isPlay && this.duration == this.currentTime) {
next();
}
if (count == sliderContentLength && song.currentTime == song.duration) {
playIcon.style.display = "block";
pauseIcon.style.display = "";
isPlay = false;
}
}
function scurb(e) {
// If we use e.offsetX, we have trouble setting the song time, when the mousemove is running
const currentTime = ( (e.clientX - progres.getBoundingClientRect().left) / progres.offsetWidth ) * song.duration;
song.currentTime = currentTime;
}
function durationSongs() {
let min = parseInt(this.duration / 60);
if (min < 10) min = "0" + min;
let sec = parseInt(this.duration % 60);
if (sec < 10) sec = "0" + sec;
const playerSongTime = `${min}:${sec}`;
this.closest(".player__song").querySelector(".player__song-time").append(playerSongTime);
}
changeSliderContext();
// add events
sliderContext.addEventListener("click", openPlayer);
sliderContext.addEventListener("animationend", () => sliderContext.style.animationName ='');
playlistButton.addEventListener("click", closePlayer);
nextButton.addEventListener("click", () => {
next(0)
});
backButton.addEventListener("click", () => {
back(0)
});
playButton.addEventListener("click", () => {
isPlay = true;
playSong();
});
playerSongs.forEach(song => {
song.addEventListener("loadeddata" , durationSongs);
song.addEventListener("timeupdate" , progresUpdate);
});
progres.addEventListener("pointerdown", (e) => {
scurb(e);
isMove = true;
});
document.addEventListener("pointermove", (e) => {
if (isMove) {
scurb(e);
song.muted = true;
}
});
document.addEventListener("pointerup", () => {
isMove = false;
song.muted = false;
});
playerPlayList.forEach((item, index) => {
item.addEventListener("click", function() {
if (index > count) {
next(index - 1);
return;
}
if (index < count) {
back(index + 1);
return;
}
});
});
</script>
</body>
</html>
</script>
</body>
</html>