master
yin5th 2021-11-23 12:15:38 +08:00
parent 9b3a9f9070
commit 71d9802c11
3 changed files with 29 additions and 6 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -5,7 +5,6 @@
<title></title> <title></title>
<link rel="stylesheet" type="text/css" href="css/animate.css" /> <link rel="stylesheet" type="text/css" href="css/animate.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/style-jq.css" />
<script src="js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script> <script src="js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/custom.js" type="text/javascript" charset="utf-8"></script> <script src="./js/custom.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/handle.js" type="text/javascript" charset="utf-8"></script> <script src="./js/handle.js" type="text/javascript" charset="utf-8"></script>
@ -25,14 +24,16 @@
<video id="mousedown" loop autoplay muted src="image/vd.mp4" ></video> <video id="mousedown" loop autoplay muted src="image/vd.mp4" ></video>
</div> </div>
<!--音乐--> <!--音乐-->
<audio controls autoplay loop muted style="z-index: 999; position: fixed;display: none;"> <audio id="music" controls autoplay loop style="z-index: 999; position: fixed;display: none;">
<source src="muz/机械 Dubstep 潮电0.1.mp3" type="audio/mpeg"> <source src="http://bili.scdxtc.cn/music/顶级 Slow 气派炸街5.0.mp3" type="audio/mp3">
</audio> </audio>
<!--点击播放音乐--> <!--点击播放音乐-->
<script> <script>
document.body.addEventListener('mousedown', function(){ document.body.addEventListener('mousedown', function(){
var vdo = $("audio")[0]; //jquery // console.log('3333','sss')
vdo.muted = false; // var vdo = $("audio")[0]; //jquery
$('#music')[0].play()
}, false); }, false);
</script> </script>
<!----> <!---->

View File

@ -1,4 +1,6 @@
let uidObj = {} let uidObj = {}
// 歌曲列表
var musicList = []
// 领舞人领舞时间 秒 // 领舞人领舞时间 秒
let leaderTime = 10 let leaderTime = 10
@ -56,6 +58,26 @@ function getLeader() {
return res return res
} }
function music() {
$.get('http://bili.scdxtc.cn', function (res) {
musicList = res
console.log($('#music')[0], '3333')
if (musicList.length > 0) {
$('#music').data('song', musicList[0])
// $('#music')[0].attr('src', 'http://bili.scdxtc.cn/music/'+musicList[0])
}
})
}
function changeMusic() {
$.get('http://bili.scdxtc.cn', function (res) {
musicList = res
if (musicList.length > 0) {
$('#music')[0].attr('src', musicList[0])
}
})
}
// 接受消息处理 // 接受消息处理
function receiveMessage(event) function receiveMessage(event)
{ {
@ -146,7 +168,6 @@ function receiveMessage(event)
leader.event = dm.event leader.event = dm.event
} }
// console.log(dm, '弹幕')
// console.log(leader, '当前领舞') // console.log(leader, '当前领舞')
// console.log(leaderRandomEvent, '领舞随机事件') // console.log(leaderRandomEvent, '领舞随机事件')
let actionIndex = Math.floor(Math.random()*actionArr.length); let actionIndex = Math.floor(Math.random()*actionArr.length);
@ -202,4 +223,5 @@ function receiveMessage(event)
} }
music();
window.addEventListener("message", receiveMessage, false); window.addEventListener("message", receiveMessage, false);