Status bar color now changes to match displayed content/context

Some minor CSS tweaks and improvements
master
Skylar Ittner 8 years ago
parent fd19981013
commit ff79fcd1ca

@ -177,7 +177,7 @@ body {
#energybar { #energybar {
width: 0%; width: 0%;
background: green; background: rgba(0, 128, 0, 1.0);
} }
#energybar-label { #energybar-label {
@ -386,12 +386,23 @@ body {
#munzeeoauth { #munzeeoauth {
position: absolute; position: absolute;
top: 0px; top: 0px;
padding-top: 15px;
left: 0px; left: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 0px; border: 0px;
} }
#munzeeoauth-header-grad {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 20px;
background: -webkit-linear-gradient(to bottom, #009444 0%, #ffffff 100%);
background: linear-gradient(to bottom, #009444 0%, rgba(255,255,255,0) 100%);
}
#shopmessage { #shopmessage {
position: fixed; position: fixed;
z-index: 9999; z-index: 9999;

@ -42,7 +42,7 @@ function logout() {
localStorage.setItem("password", ''); localStorage.setItem("password", '');
username = null; username = null;
password = null; password = null;
$('#content-zone').load("screens/login.html"); openscreen('login');
} else { } else {
navigator.notification.alert("Server did not properly acknowledge logout. You might have problems for the next few hours if you switch accounts.", null, "Error", 'Dismiss'); navigator.notification.alert("Server did not properly acknowledge logout. You might have problems for the next few hours if you switch accounts.", null, "Error", 'Dismiss');
} }
@ -78,6 +78,7 @@ function loginOK() {
localStorage.setItem("username", username); localStorage.setItem("username", username);
localStorage.setItem("password", password); localStorage.setItem("password", password);
navigator.splashscreen.hide(); navigator.splashscreen.hide();
updateStatusBarColor();
checkUserHasTeamOpenChooserIfNot(username); checkUserHasTeamOpenChooserIfNot(username);
} }
@ -145,6 +146,7 @@ function dosignup() {
} }
function dologin() { function dologin() {
updateStatusBarColor();
if (authOpInProgress) { if (authOpInProgress) {
return; return;
} }

@ -179,6 +179,7 @@ function hideLoading() {
if (lockGot && terrainGot && gpsaccuracy < requiredaccuracy && $('#loading').css('display') !== 'none') { if (lockGot && terrainGot && gpsaccuracy < requiredaccuracy && $('#loading').css('display') !== 'none') {
$('#loading').fadeOut('slow', function () { $('#loading').fadeOut('slow', function () {
$('#loading').css('display', 'none'); $('#loading').css('display', 'none');
updateStatusBarColor();
}); });
} }
} }

@ -36,7 +36,6 @@ $(document).ready(function () {
}); });
function onDeviceReady() { function onDeviceReady() {
StatusBar.backgroundColorByHexString("#324150");
openscreen("login"); openscreen("login");
if (navigator.network.connection.type === Connection.NONE) { if (navigator.network.connection.type === Connection.NONE) {
navigator.notification.alert("You need an Internet connection to continue.", function () { navigator.notification.alert("You need an Internet connection to continue.", function () {
@ -82,10 +81,12 @@ function compareVersions(a, b) {
function serverProblemsDialog(errmsg) { function serverProblemsDialog(errmsg) {
StatusBar.backgroundColorByHexString("#324150");
window.location = "servererror.html?errmsg=" + errmsg; window.location = "servererror.html?errmsg=" + errmsg;
} }
function clientProblemsDialog(errmsg) { function clientProblemsDialog(errmsg) {
StatusBar.backgroundColorByHexString("#324150");
window.location = "clienterror.html?errmsg=" + errmsg; window.location = "clienterror.html?errmsg=" + errmsg;
} }
@ -105,23 +106,40 @@ function mkApiUrl(action, server) {
} }
} }
function changeStatusBarColorForScreen(screenname) { /**
StatusBar.backgroundColorByHexString("#324150"); // Splash background color * Update the status bar color depending on context.
/*switch (screenname) { * @returns {undefined}
case 'login': */
case 'signup': function updateStatusBarColor() {
case 'chooseteam': if (currentscreen == 'munzeelink') {
StatusBar.backgroundColorByHexString("#060606"); StatusBar.backgroundColorByHexString("#009444");
break; return;
case 'menu': }
StatusBar.backgroundColorByHexString("#060606"); if (currentscreen == 'login') {
break; if ($('#loading').css('display') == 'none') {
case 'home': StatusBar.backgroundColorByHexString("#060606");
StatusBar.backgroundColorByHexString("#008000"); } else {
break; StatusBar.backgroundColorByHexString("#324150");
default: }
StatusBar.backgroundColorByHexString("#324150"); // Splash background color return;
}*/ }
if (currentscreen == 'chooseteam' || currentscreen == 'signup') {
StatusBar.backgroundColorByHexString("#060606");
return;
}
if (currentscreen == 'home') {
if ($('#loading').css('display') != 'none') {
StatusBar.backgroundColorByHexString("#324150");
} else {
if ($('#overlay-main').css('display') == 'block') {
StatusBar.backgroundColorByHexString("#060606");
} else {
StatusBar.backgroundColorByHexString("#008000");
}
}
return;
}
StatusBar.backgroundColorByHexString("#324150");
} }
/** /**
@ -147,6 +165,7 @@ function openscreen(screenname, effect) {
$('#content-zone').load("screens/" + screenname + ".html"); $('#content-zone').load("screens/" + screenname + ".html");
} }
currentscreen = screenname; currentscreen = screenname;
updateStatusBarColor();
} }
/** /**
@ -250,6 +269,7 @@ function closeMain() {
$('#overlay-main').slideDown(100, function () { $('#overlay-main').slideDown(100, function () {
$('#overlay-main').css('display', 'none'); $('#overlay-main').css('display', 'none');
$('#main-content').html(""); $('#main-content').html("");
updateStatusBarColor();
}); });
} }

@ -121,6 +121,7 @@ function openProfile(user) {
$('#main-content').load("screens/profile.html", null, function (x) { $('#main-content').load("screens/profile.html", null, function (x) {
$('#overlay-main').css('display', 'block'); $('#overlay-main').css('display', 'block');
loadProfile(user); loadProfile(user);
updateStatusBarColor();
}); });
} }
@ -139,5 +140,6 @@ function openMenu(topage) {
if (topage !== '') { if (topage !== '') {
$('#' + topage + '-tab').tab('show'); $('#' + topage + '-tab').tab('show');
} }
updateStatusBarColor();
}); });
} }

@ -127,6 +127,8 @@
$('#found-box-2').click(function (e) { $('#found-box-2').click(function (e) {
$('#found-box').fadeOut('fast'); $('#found-box').fadeOut('fast');
}); });
updateStatusBarColor();
</script> </script>
<script src="js/location.js"></script> <script src="js/location.js"></script>
<script src="js/user.js"></script> <script src="js/user.js"></script>

@ -117,12 +117,15 @@
dologin(); dologin();
} else { } else {
$('#loading').css('display', 'none'); $('#loading').css('display', 'none');
updateStatusBarColor();
} }
}).fail(function () { }).fail(function () {
$('#loading').css('display', 'none'); $('#loading').css('display', 'none');
updateStatusBarColor();
}); });
} else { } else {
$('#loading').css('display', 'none'); $('#loading').css('display', 'none');
updateStatusBarColor();
} }
navigator.splashscreen.hide(); navigator.splashscreen.hide();
</script> </script>

@ -17,6 +17,8 @@
--> -->
<iframe id="munzeeoauth" src="about:blank" style="background-color: white;" seamless='seamless'></iframe> <iframe id="munzeeoauth" src="about:blank" style="background-color: white;" seamless='seamless'></iframe>
<div id="munzeeoauth-header-grad"></div>
<script> <script>
$('#munzeeoauth').attr('src', 'https://api.munzee.com/oauth?response_type=code&client_id=' $('#munzeeoauth').attr('src', 'https://api.munzee.com/oauth?response_type=code&client_id='
+ MUNZEE_CLIENT_ID + MUNZEE_CLIENT_ID