chen 2021-11-25 09:27:45 +08:00
commit 571c3112e8
21 changed files with 7 additions and 15 deletions

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 KiB

After

Width:  |  Height:  |  Size: 602 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -31,7 +31,7 @@ function getEvent(name) {
// 随机选择镜头 // 随机选择镜头
function scale() { 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) { $.get('https://bili.scdxtc.cn', function (res) {
musicList = res musicList = res
if (musicList.length > 0) { 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) function receiveMessage(event)
{ {
console.log(event.data, '接受信息')
// console.log(event.data, '接受弹幕')
// 我们能信任信息来源吗? // 我们能信任信息来源吗?
if (event.origin !== "https://live.bilibili.com") { if (event.origin !== "https://live.bilibili.com") {
return false return false
@ -155,24 +156,15 @@ function receiveMessage(event)
// custom.js中 每条弹幕的处理 放到了此处 // custom.js中 每条弹幕的处理 放到了此处
// -------------------- 每条弹幕处理 begin ----------------------- // -------------------- 每条弹幕处理 begin -----------------------
let random2 = Math.floor(Math.random() + 0.5)
// 获取领舞信息 // 获取领舞信息
let leaderInfo = sessionStorage.getItem('leader') let leaderInfo = sessionStorage.getItem('leader')
let isLeader = data.uname == leaderInfo ? 1 : 0 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, let dm = {text: data.danmaku, uid: data.uid, uname: data.uname,
event: getEvent(getFirstEventKeyword(data.danmaku)), event: getEvent(data.danmaku),
is_new: isNew, is_admin: 0, is_exit: random2, is_leader: isLeader} is_new: isNew, is_admin: 0, is_leader: isLeader}
// TODO 测试后 删除领舞随机 console.log(data.danmaku, '弹幕')
// let leaderRandomEvent = getEvent(getFirstEventKeyword(data.danmaku+randomEvent))
let leader = { let leader = {
// uid: 0, uname: leaderInfo, text: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)), event: leaderRandomEvent
uid: 0, uname: leaderInfo, text: '', event: '' uid: 0, uname: leaderInfo, text: '', event: ''
} }
if (isLeader) { if (isLeader) {