master
chen 2021-11-26 21:03:06 +08:00
parent 454e66451d
commit f21adf06bf
3 changed files with 19 additions and 17 deletions

View File

@ -153,7 +153,7 @@ body{
display: none;
}
.fireworks{
display: block;
display: block!important;
}
.Lighting{
position: fixed;

View File

@ -11,12 +11,10 @@
<body>
<!--增加 class=" scale-right" 可使用从右向左镜头效果scale-left scale-bottom-left scale-bottom-right -->
<div class=" ground-bg">
<div class="ground-bg">
<div class="scale-body">
<!--灯光-->
<div class="Lighting">
</div>
<div class="Lighting"></div>
<!--地面灯光-->
<div class="ground-light">
<div class="ground-animate"></div>

View File

@ -21,10 +21,12 @@ let eventTextList = ['切歌', '跳', '向左', '向右', '左抖腿', '右抖
let allEventList = ['切歌', '一起跳', '一起向左', '一起向右', '一起左抖腿', '一起右抖腿', '一起抖动', '一起喊', '镜头']
// 镜头列表
let list = ['scale-left', 'scale-right', 'scale-bottom-left', 'scale-bottom-right']
// 烟花次数
let firTimes = 0;
// 根据事件文字 获取事件名
function getEvent(name) {
let map = {
'烟花':fireworks(),
'烟花':'fireworks',
'切歌' : 'change_song',
'跳' : 'dancing-down',
'向左' : 'dancing-left',
@ -42,7 +44,7 @@ function getEvent(name) {
// 根据事件文字 获取领舞者事件名
function getLeaderEvent(name) {
let map = {
'烟花':fireworks(),
'烟花':'fireworks',
'切歌' : 'change_song',
'一起跳' : 'dancing-down',
'一起向左' : 'dancing-left',
@ -61,12 +63,6 @@ function getLeaderEvent(name) {
function scale() {
return list[Math.floor(Math.random() * 3)];
}
function fireworks() {
// $('.lighting-bg').css('display','block');
// setTimeout(()=>{
// $('.lighting-bg').css('display','none');
// },5000)
}
// 字符串包含的事件 (仅取第一个)
function getFirstEventKeyword(name) {
let event = ''
@ -134,7 +130,7 @@ function delExpireDiv() {
let delList = $(".dance-people").filter(function() {
return $(this).attr("data-time") < timestamp - speakExpireTime;
})
console.log(delList.length, speakExpireTime+'秒未说话人数')
// console.log(delList.length, speakExpireTime+'秒未说话人数')
delList.remove();
}
@ -152,6 +148,7 @@ function receiveMessage(event)
// 目前硬编码大航海列表
// let adminList = dataList.admin
adminList = ['流域_墨绿绿'];
// adminList = ['饺子吃肉肉'];
if (data.length <= 0) {
return false
@ -205,7 +202,6 @@ function receiveMessage(event)
// 记录uid最近弹幕时间
uidObj[data.uid] = data.ts
// console.log(isNew, data.uname + ' 是否存在')
// custom.js中 每条弹幕的处理 放到了此处
// -------------------- 每条弹幕处理 begin -----------------------
@ -258,7 +254,6 @@ function receiveMessage(event)
if (!isLeader) {
return false
}
// console.log(leader, '领舞人信息')
if(leader.event=='scale-left' || leader.event=='scale-right' || leader.event=='scale-bottom-left' || leader.event=='scale-bottom-right'){
// 领舞喊镜头
@ -287,8 +282,17 @@ function receiveMessage(event)
if(leader.text=="切歌"){
changeMusic();
}
if(leader.text==="烟花"){
if(firTimes==0){
firTimes++;
$('.lighting-bg').addClass('fireworks');
setTimeout(()=>{
$('.lighting-bg').removeClass('fireworks');
firTimes = 0;
},5000)
}
}
// 领舞喊一起喊
// leader.text.slice(0,3);
if (leader.text.length >= 4) {
if(leader.text.slice(0,4)=="一起喊:" || leader.text.slice(0,4)=="一起喊:"){
allSay(leader.text.slice(4));