Compare commits
No commits in common. "3d71b732be30952b00fac20c7369183597c9fd23" and "f87a786e7c31e5586aec6475079c86777595f71e" have entirely different histories.
3d71b732be
...
f87a786e7c
33
js/custom.js
33
js/custom.js
|
@ -37,6 +37,7 @@ function allDancing(dangcing){
|
|||
}
|
||||
})
|
||||
setTimeout(()=>{
|
||||
clearInterval(actionTimer);
|
||||
startIndex = 0;
|
||||
var allPeople = $('.dance-floor').find('.people-img').length;
|
||||
suiDanTimer = setInterval(()=>{
|
||||
|
@ -52,7 +53,7 @@ function allDancing(dangcing){
|
|||
}
|
||||
// 随机舞
|
||||
function randomDancing(id){
|
||||
var actionTimer = setInterval(()=>{
|
||||
actionTimer = setInterval(()=>{
|
||||
actionArr.forEach((item,index)=>{
|
||||
// var chooseIdex = Math.floor(Math.random()*num);
|
||||
var haveDan = $(`.data${id} .people-img`).is(`.${item}`);
|
||||
|
@ -64,19 +65,24 @@ function randomDancing(id){
|
|||
},3000)
|
||||
}
|
||||
// 个人动作舞
|
||||
function peopleAction(id,aevent){
|
||||
actionArr.forEach((item,index)=>{
|
||||
// var chooseIdex = Math.floor(Math.random()*num);
|
||||
var haveDan = $(`.data${id} .people-img`).is(`.${item}`);
|
||||
if(haveDan){
|
||||
$(`.data${id} .people-img`).removeClass(item);
|
||||
$(`.data${id} .people-img`).addClass(aevent);
|
||||
}
|
||||
})
|
||||
function peopleAction(id,actionVal){
|
||||
actionTimer = setInterval(()=>{
|
||||
actionArr.forEach((item,index)=>{
|
||||
// var chooseIdex = Math.floor(Math.random()*num);
|
||||
var haveDan = $(`.data${id} .people-img`).is(`.${item}`);
|
||||
if(haveDan){
|
||||
$(`.data${id} .people-img`).removeClass(item);
|
||||
$(`.data${id} .people-img`).addClass(actionVal);
|
||||
}
|
||||
})
|
||||
},3000)
|
||||
}
|
||||
// 随机位移
|
||||
function moveEv(id){
|
||||
console.log(id,'9999999');
|
||||
// var odiv = document.getElementById(`${id}`);
|
||||
var typeMove = Math.floor(Math.random()*4);
|
||||
console.log(typeMove,'typeMove');
|
||||
switch (typeMove){
|
||||
case 0:
|
||||
upMove(id);
|
||||
|
@ -160,9 +166,8 @@ function exitEv(id){
|
|||
// 进入广场
|
||||
function peopleObj(name,uid,say,action){
|
||||
// 开始说话
|
||||
sayIng(peopleId);
|
||||
// 随机舞
|
||||
randomDancing(peopleId);
|
||||
sayIng(uid);
|
||||
randomDancing(uid);
|
||||
let yspHtml = '';
|
||||
let yspData = [
|
||||
{
|
||||
|
@ -179,7 +184,7 @@ function peopleObj(name,uid,say,action){
|
|||
]
|
||||
$.each(yspData, function (commentIndex, comment) {
|
||||
yspHtml += `
|
||||
<div id="${comment.uid}" class="dance-people data${comment.peopleId}" style="top: ${comment.top}; left: ${comment.left};">
|
||||
<div id="${comment.uid}" class="dance-people data${comment.uid}" style="top: ${comment.top}; left: ${comment.left};">
|
||||
<div class="speak ">${comment.say}</div>
|
||||
<div class="people-img ${comment.peopleImg} ${comment.dancin}">
|
||||
<div class="stick ${comment.ying_guang}"></div>
|
||||
|
|
|
@ -187,6 +187,8 @@ function receiveMessage(event)
|
|||
$(`#${userId} .speak`).addClass("dn");
|
||||
},3000)
|
||||
peopleAction(`${userId}`,dm.event);
|
||||
// upMove();//上移
|
||||
// downMove();//下移
|
||||
}
|
||||
}
|
||||
num++;
|
||||
|
|
Loading…
Reference in New Issue