Show resonator status (level/energy) of selected portal in status bar on smartphones

This commit is contained in:
fkloft 2013-07-13 00:14:02 +02:00
parent 5bf8eb7333
commit 39ce9102e8
2 changed files with 47 additions and 0 deletions

View File

@ -83,6 +83,28 @@ window.smartphoneInfo = function(data) {
t += ' ' + percentage + ' '; t += ' ' + percentage + ' ';
t += d.portalV2.descriptiveText.TITLE; t += d.portalV2.descriptiveText.TITLE;
var l,v,max,perc;
for(var i=0;i<8;i++)
{
var reso = d.resonatorArray.resonators[i];
if(reso) {
l = parseInt(reso.level);
v = parseInt(reso.energyTotal);
max = RESO_NRG[l];
perc = v/max*100;
}
else {
l = 0;
v = 0;
max = 0;
perc = 0;
}
t += '<div class="resonator '+TEAM_TO_CSS[getTeam(d)]+'" style="border-top-color: '+COLORS_LVL[l]+';left: '+(100*i/8.0)+'%;">';
t += '<div class="filllevel" style="width:'+perc+'%;"></div>';
t += '</div>'
}
$('#mobileinfo').html(t); $('#mobileinfo').html(t);
} }

View File

@ -51,6 +51,31 @@ body {
color: #FFF; color: #FFF;
} }
#mobileinfo .resonator {
position: absolute;
width: 12%; /* a little less that 1/8 to have a small distance */
height: 100%;
top: 0;
border-top: 3px solid red;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
#mobileinfo .filllevel {
position: absolute;
bottom: 0;
height: 3px;
}
#mobileinfo .enl .filllevel {
background-color: #03fe03 !important;
}
#mobileinfo .res .filllevel {
background-color: #00c5ff !important;
}
#sidebar, #chatcontrols, #chat, #chatinput { #sidebar, #chatcontrols, #chat, #chatinput {
background: #0B3351 !important; background: #0B3351 !important;
} }