forked from Lakshita018/Web-Vida-Sample-Domains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmusicplayer.html
107 lines (95 loc) · 2.6 KB
/
musicplayer.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Music Player</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f8f8f8;
color: #333;
margin: 0;
}
.navbar {
background: #ff6600;
padding: 35px;
display: block;
text-align: center;
}
.navbar a {
color: white;
text-decoration: none;
padding: 10px 20px;
display: inline-block;
}
.container {
margin: 50px auto;
padding: 20px;
width: 60%;
background: white;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.footer {
background: #ff6600;
color: white;
text-align: center;
padding: 10px;
position: fixed;
width: 100%;
bottom: 0;
}
.logo-container {
position: absolute;
top: 20px;
left: 20px;
}
.logo {
width: auto;
height: 80px;
border-radius: 8px;
transition: transform 0.3s;
}
</style>
</head>
<body>
<div class="navbar">
<div class="logo-container">
<img src="ISTE-logo.png" alt="Logo" class="logo">
</div>
<a href="#">Home</a>
<a href="#">Playlist</a>
<a href="#">Albums</a>
<a href="#">Artists</a>
<a href="#">Contact</a>
</div>
<h1>Welcome to My Music Player</h1>
<div class="container">
<h2>Now Playing</h2>
<p id="song-title">Song Title - Artist</p>
<audio id="audio-player" controls>
<source src="song.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<h2>Playlist</h2>
<ul>
<li onclick="playSong('song1.mp3', 'Song 1 - Artist A')">Song 1 - Artist A</li>
<li onclick="playSong('song2.mp3', 'Song 2 - Artist B')">Song 2 - Artist B</li>
<li onclick="playSong('song3.mp3', 'Song 3 - Artist C')">Song 3 - Artist C</li>
</ul>
</div>
<div class="footer">
© 2025 My Music Player. All rights reserved.
</div>
<script>
function playSong(songSrc, title) {
let player = document.getElementById("audio-player");
let songTitle = document.getElementById("song-title");
player.src = songSrc;
songTitle.innerText = title;
player.play();
}
</script>
</body>
</html>