Merge branch 'master' of http://git.scdxtc.com/chen/squareDancing
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 528 B |
BIN
image/img_02.png
Before Width: | Height: | Size: 671 KiB After Width: | Height: | Size: 602 KiB |
BIN
image/img_03.png
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 180 KiB |
BIN
image/img_04.png
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
BIN
image/img_05.png
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 7.7 KiB |
BIN
image/img_06.png
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 5.9 KiB |
BIN
image/img_07.png
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
image/img_08.png
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
image/img_09.png
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.3 KiB |
BIN
image/img_0x.png
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 369 KiB |
BIN
image/img_10.png
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 6.3 KiB |
BIN
image/img_11.png
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
image/img_12.png
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
image/img_13.png
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
image/img_14.png
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
image/img_15.png
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 3.3 KiB |
22
js/handle.js
|
@ -31,7 +31,7 @@ function getEvent(name) {
|
|||
|
||||
// 随机选择镜头
|
||||
function scale() {
|
||||
return list[Math.floor(Math.random() * list.length)];
|
||||
return list[Math.floor(Math.random() * 3)];
|
||||
}
|
||||
|
||||
// 字符串包含的事件 (仅取第一个)
|
||||
|
@ -65,7 +65,7 @@ function music() {
|
|||
$.get('https://bili.scdxtc.cn', function (res) {
|
||||
musicList = res
|
||||
if (musicList.length > 0) {
|
||||
$('#music source').attr('src', 'https://bili.scdxtc.cn/music/'+musicList[15])
|
||||
$('#music source').attr('src', 'https://bili.scdxtc.cn/music/'+musicList[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -93,7 +93,8 @@ function dancer(val){
|
|||
// 接受消息处理
|
||||
function receiveMessage(event)
|
||||
{
|
||||
console.log(event.data, '接受信息')
|
||||
|
||||
// console.log(event.data, '接受弹幕')
|
||||
// 我们能信任信息来源吗?
|
||||
if (event.origin !== "https://live.bilibili.com") {
|
||||
return false
|
||||
|
@ -155,24 +156,15 @@ function receiveMessage(event)
|
|||
|
||||
// custom.js中 每条弹幕的处理 放到了此处
|
||||
// -------------------- 每条弹幕处理 begin -----------------------
|
||||
let random2 = Math.floor(Math.random() + 0.5)
|
||||
|
||||
// 获取领舞信息
|
||||
let leaderInfo = sessionStorage.getItem('leader')
|
||||
|
||||
let isLeader = data.uname == leaderInfo ? 1 : 0
|
||||
// 给弹幕加上随机事件
|
||||
let mathIndex = Math.floor(Math.random()*15)
|
||||
// console.log(mathIndex, '随机因子')
|
||||
let randomEvent = eventTextList[mathIndex] ? eventTextList[mathIndex] : ''
|
||||
// TODO 测试后 删除弹幕随机附加事件
|
||||
let dm = {text: data.danmaku, uid: data.uid, uname: data.uname,
|
||||
event: getEvent(getFirstEventKeyword(data.danmaku)),
|
||||
is_new: isNew, is_admin: 0, is_exit: random2, is_leader: isLeader}
|
||||
// TODO 测试后 删除领舞随机
|
||||
// let leaderRandomEvent = getEvent(getFirstEventKeyword(data.danmaku+randomEvent))
|
||||
event: getEvent(data.danmaku),
|
||||
is_new: isNew, is_admin: 0, is_leader: isLeader}
|
||||
console.log(data.danmaku, '弹幕')
|
||||
let leader = {
|
||||
// uid: 0, uname: leaderInfo, text: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)), event: leaderRandomEvent
|
||||
uid: 0, uname: leaderInfo, text: '', event: ''
|
||||
}
|
||||
if (isLeader) {
|
||||
|
|