expo cartel is moving

This commit is contained in:
2020-01-07 17:41:10 +01:00
parent 4cb1ded556
commit 7c5bc8e053
6 changed files with 99 additions and 6 deletions
@@ -1966,8 +1966,32 @@
if(window.location.hash == '#black'){
$('body').addClass('expo-black');
}
_$body.on('map-node-opened', checkExpoPlayerPositionning);
_randomPlayer.start();
}
function checkExpoPlayerPositionning(e){
console.log('checkExpoPlayerPositionning', e.node);
switch(true){
case e.node.x > window.innerWidth-800 && e.node.y < 200:
_audioPlayer.$container.attr('pos', 'bottom-left');
break;
case e.node.x > window.innerWidth-800:
_audioPlayer.$container.attr('pos', 'top-left');
break;
case e.node.y < 200:
_audioPlayer.$container.attr('pos', 'bottom-right');
break;
default:
_audioPlayer.$container.attr('pos', 'top-right');
}
_audioPlayer.$container.css({
'display':"block",
'left':e.node.x+"px",
'top':e.node.y+"px",
});
}
// ___ _ _
// / __|_ _(_)__| |