master
chen 2021-11-23 21:54:58 +08:00
parent 30e1323441
commit 78c95bca52
2 changed files with 25 additions and 8 deletions

View File

@ -3,7 +3,7 @@ var num = 0;
var timer = null;
var actionTimer = null;
var moveTimer = null;
var dancerTimer = null;
// 动作
var actionArr = ['dancing-left','dancing-right','dancing-down','dancing-up','dancing-wobble','dancing-wobble-right'];
// 人物位移动画
@ -194,7 +194,7 @@ function peopleObj(name,uid,say,action){
// 执行退出事件
// exitEv(`#peopleId${peopleId-1}`)
}
// 领舞者的动作
// 领舞者个人说话的动作
function dancerOwn(dancing){
actionArr.forEach((item,index)=>{
var haveDan = $(`.leading-dancer`).is(`.${item}`);
@ -203,10 +203,14 @@ function dancerOwn(dancing){
$(`.leading-dancer`).addClass(dancing);
}
})
setTimeout(()=>{
dancerRandom();
},6000)
}
$(function(){
// 领舞者随机的动作
function dancerRandom(){
// 领舞者随机动效
setInterval(()=>{
dancerTimer = setInterval(()=>{
actionArr.forEach((item,index)=>{
var haveDan = $(`.leading-dancer`).is(`.${item}`);
if(haveDan){
@ -215,6 +219,9 @@ $(function(){
}
})
},4000)
}
$(function(){
dancerRandom();
// 自动切歌
changeMusic();
var audio=document.getElementById('music');

View File

@ -8,7 +8,7 @@ let leaderTime = 15*60
// 事件列表-中文
let eventTextList = ['切歌', '跳跃', '向左', '向右', '左抖腿', '右抖腿', '抖动', '一起喊', '镜头']
let allEventList = ['切歌', '一起跳跃', '一起向左', '一起向右', '一起左抖腿', '一起右抖腿', '一起抖动', '一起喊', '镜头']
let list = ['scale-left', 'scale-right', 'scale-bottom-left', 'scale-bottom-right']
// 根据事件文字 获取事件名
function getEvent(name) {
let map = {
@ -28,7 +28,6 @@ function getEvent(name) {
// 随机选择镜头
function scale() {
let list = ['scale-left', 'scale-right', 'scale-bottom-left', 'scale-bottom-right']
return list[Math.floor(Math.random() * list.length)];
}
@ -109,7 +108,8 @@ function receiveMessage(event)
if (data.ct === '') {
return false
}
adminList = ['内有猛犬小心','热心市民阿狄呐','流域_墨绿绿'];
// adminList = ['内有猛犬小心','热心市民阿狄呐','流域_墨绿绿'];
adminList = ['饺子吃肉肉'];
// 大航海列表
if (adminList.length > 0) {
// 获取当前领舞人
@ -201,9 +201,18 @@ function receiveMessage(event)
num++;
$('.lingname').text(leader.uname);
console.log(leader.event,'镜头');
if(leader.event=='scale-left' || leader.event=='scale-right' || leader.event=='scale-bottom-left' || leader.event=='scale-bottom-right'){
// 镜头
$('.ground-bg').addClass(leader.event);
list.forEach(item=>{
var haveDan = $(`.ground-bg`).is(`.${item}`);
if(haveDan) {
$('.ground-bg').removeClass(item);
}
})
setTimeout(()=>{
$('.ground-bg').addClass(leader.event);
},2000)
} else {
// 显示领舞说话
if (leader.text.length>0) {
@ -217,6 +226,7 @@ function receiveMessage(event)
changeMusic();
}
if(peopleHan(dm.text)){
clearInterval(dancerTimer);
dancerOwn(leader.event);
}
if(dancer(leader.text)){