Changes
This commit is contained in:
parent
da09e7072a
commit
a42f34825b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.vscode
|
||||
@ -48,7 +48,7 @@
|
||||
border: 1px solid #4da7fe;
|
||||
}
|
||||
|
||||
#btngreen{
|
||||
#btnorange{
|
||||
background-color: #ff6e06;
|
||||
border: 1px solid #ff6e06;
|
||||
border-radius: 5px;
|
||||
@ -58,7 +58,17 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#btngreen:hover{
|
||||
#btnred{
|
||||
background-color: #ff3d40;
|
||||
border: 1px solid #ff3d40;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#btnorange:hover{
|
||||
background-color: #ffa632;
|
||||
border: 1px solid #ffa632;
|
||||
}
|
||||
|
||||
14
index.html
14
index.html
@ -15,11 +15,15 @@
|
||||
<input type="text" id="search-song">
|
||||
<button type="button" onclick="getsongs()" id="searchbtn">搜索</button>
|
||||
</div>
|
||||
<button type="button" onclick="getplaylist()" id="btngreen">查看列表</button>
|
||||
<button type="button" onclick="playthelist()" id="btngreen">播放列表</button>
|
||||
<button type="button" onclick="playnext()" id="btngreen">立即切歌</button>
|
||||
<button type="button" onclick="gethistory()" id="btngreen">播放历史</button>
|
||||
<button type="button" onclick="ClearList()" id="btngreen">清空记录</button>
|
||||
<button type="button" onclick="getplaylist()" id="btnorange">查看列表</button>
|
||||
<button type="button" onclick="playthelist()" id="btnorange">播放列表</button>
|
||||
<button type="button" onclick="playnext()" id="btnorange">立即切歌</button>
|
||||
<button type="button" onclick="gethistory()" id="btnorange">播放历史</button>
|
||||
<button type="button" onclick="ClearList()" id="btnorange">清空记录</button>
|
||||
<br />
|
||||
<input type="text" placeholder="列表ID" name="listID" id="listid"/>
|
||||
<button type="button" onclick="" id="btnred">接收云列表</button>
|
||||
<button type="button" onclick="" id="btnred">上传云列表</button>
|
||||
<div>
|
||||
<div id="nowplaystat">Now Playing: <span id="nowplay">None</span></div>
|
||||
<audio src="#" controls id="Player"></audio>
|
||||
|
||||
30
js/main.js
30
js/main.js
@ -266,9 +266,39 @@ function ClearthePlaylist(){
|
||||
// 推送到云播放列表
|
||||
function PushToCloud(){
|
||||
// Cloud Prepareing...
|
||||
var server_api = "";
|
||||
var xhr = new XMLHttpRequest();
|
||||
var historyList = JSON.parse(localStorage.getItem("historyList"));
|
||||
msg = JSON.stringify({
|
||||
"length": historyList.length,
|
||||
"payload": historyList
|
||||
});
|
||||
xhr.open("POST", server_api, true);
|
||||
xhr.send();
|
||||
xhr.onreadystatechange = function(){
|
||||
var obj = JSON.parse(xhr.responseText);
|
||||
if(obj.statusCode == 0){
|
||||
console.log("Success!");
|
||||
}else{
|
||||
console.log("Send Failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拉取云播放列表
|
||||
function PullToCloud(){
|
||||
// Cloud Prepareing...
|
||||
var listid = document.getElementById("listid").value;
|
||||
var server_api = `http://localhost:12345/getMusicList?listid=${listid}`;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", server_api, true);
|
||||
xhr.send();
|
||||
xhr.onreadystatechange = function(){
|
||||
var obj = JSON.parse(xhr.responseText);
|
||||
if(true){
|
||||
;
|
||||
}else{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user