-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
99 lines (91 loc) · 3.81 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
<!DOCTYPE html>
<html>
<head>
<title>MusicPlayerv0.1</title>
<meta name="author" content="TSilver">
<meta name="revised" content="11/17/2016">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script src="js/music.js"></script>
</head>
<body class="wholepage">
<div class="container">
<div class="music">
<div class="header">
<h1>MusicPlayer <small>v0.1</small></h1>
</div>
<div class="cover-page">
<img src="img/IMG_0001.JPG" id="music-img" alt="封面">
</div>
<div id="title">
Hello World!
</div>
<audio id="audio">
<source title="童话镇" data-img="img/tonghuazhen_chenyifa.jpg"
src="music/陈一发儿 - 童话镇.mp3" type="audio/mpeg">
<source title="不醉不会" data-img="img/buzuibuhui_tianfuzhen.jpg"
src="music/田馥甄 - 不醉不会.flac" type="audio/mpeg">
<source title="易燃易爆炸" data-img="img/yiranyibaozha_chenli.jpg"
src="music/陈粒 - 易燃易爆炸.mp3" type="audio/mpeg">
<source title="Blank Space" data-img="img/Blank Space_Taylor Swift.jpg"
src="music/Taylor Swift - Blank Space.flac" type="audio/mpeg">
</audio>
<div class="progress">
<span id="music-bar">
<span id="load-bar"></span>
<span id="played-bar"></span>
</span>
<span id="voice-bar">
<span id="voiced-bar"></span>
</span>
<div id="time">
<span id="current-time">0:00</span>
<!-- 当前时间 -->
<span id="total-time"></span>
</div>
</div>
<div class="controls">
<a id="xunhuan" href="javascript:;">循环</a>
<!-- 去除a的超链接改为自己的js事件,javascript:是表示在触发<a>默认动作时,执行一段JavaScript代码,而 javascript:; 表示什么都不执行,这样点击<a>时就没有任何反应。-->
<a id="prev" href="javascript:;"> < </a>
<!-- 上一首 -->
<a id="play" href="javascript:;">Play</a>
<a id="next" href="javascript:;"> > </a>
<!-- 下一首 -->
<a id="mute" href="javascript:;">静音</a>
</div>
</div>
<div class="music-list">
<div class="title">播放列表</div>
<div class="list">
<ul>
<li>童话镇</li>
<li>不醉不会</li>
<li>易燃易爆炸</li>
<li>Blank Space</li>
</ul>
</div>
</div>
</div>
<div id="footer">
<!-- -->
</div>
<script src="js/music.js">
</script>
<script>
function jsonpcallback(rs) {
var resultHtml = '歌曲:<strong>' + rs.result.songs[0].name + '</strong>' +
'歌手:<strong>' + rs.result.songs[0].artists[0].name + '</strong>' +
'<a href="javascript:;" id="to-play">立即播放</a>';
result.innerHTML = resultHtml;
result.setAttribute('data-audio', rs.result.songs[0].audio);
result.setAttribute('data-img', rs.result.songs[0].album.picUrl);
result.setAttribute('data-music', rs.result.songs[0].name);
result.setAttribute('data-singer', rs.result.songs[0].artists[0].name);
result.style.opacity = '1';
};
//回调函数
</script>
</body>
</html>