diff --git a/bower.json b/bower.json index feef1b4642..b3aa4eddab 100644 --- a/bower.json +++ b/bower.json @@ -28,7 +28,7 @@ "angular-bindonce": "~0.2.1", "bootstrap": "~3.1.0", "bootstrap-datepicker": "1.3.0", - "bootstrap-growl": "~1.1.0", + "bootstrap-growl": "git://github.com/ifightcrime/bootstrap-growl.git#master", "bootstrap-tour": "~0.8.1", "habitrpg-shared": "git://github.com/HabitRPG/habitrpg-shared.git#develop", "BrowserQuest": "https://github.com/mozilla/BrowserQuest.git", diff --git a/public/css/alerts.styl b/public/css/alerts.styl index 4b765329b1..1893e93389 100644 --- a/public/css/alerts.styl +++ b/public/css/alerts.styl @@ -16,6 +16,16 @@ .wide-popover max-width: 400px +#notification-area + position: fixed + top: 0 + right: 0px + z-index: 1061 + + .alert + padding-top: 8px + padding-bottom: 8px + // variables gpColor = #FBEFC0 @@ -86,6 +96,8 @@ borderDarken = 20% background-size: 18px width: 14px height: 14px + display: inline-block + vertical-align: middle .icon-silver background: url("/bower_components/habitrpg-shared/img/coin_single_silver.png") no-repeat @@ -93,6 +105,8 @@ borderDarken = 20% background-size: 18px width: 14px height: 14px + display: inline-block + vertical-align: middle .icon-death background: url("/bower_components/habitrpg-shared/img/sprites/dead.png") no-repeat @@ -100,7 +114,8 @@ borderDarken = 20% background-size: 14px width: 14px height: 14px - + display: inline-block + vertical-align: middle .undo-button z-index: 3000 diff --git a/public/css/index.styl b/public/css/index.styl index 85f913b1f4..129b692a25 100644 --- a/public/css/index.styl +++ b/public/css/index.styl @@ -146,11 +146,6 @@ div.tooltip-inner { #reset-modal z-index:1500 -#notification-area - position: fixed - top: 0 - right: 0px - z-index: 1061 a cursor: pointer diff --git a/public/js/controllers/notificationCtrl.js b/public/js/controllers/notificationCtrl.js index d72a11546f..775ab060c7 100644 --- a/public/js/controllers/notificationCtrl.js +++ b/public/js/controllers/notificationCtrl.js @@ -128,7 +128,8 @@ habitrpg.controller('NotificationCtrl', $rootScope.openModal('questCompleted', 'InventoryCtrl'); }); - $rootScope.$watch('party.quest.key && !party.quest.active && !questHold && party.quest.members[user._id] == undefined', function(after, before){ + // Quest invitation modal + $rootScope.$watch('party.quest.key && !party.quest.active && party.quest.members[user._id] == undefined', function(after, before){ if (after == before || after != true) return; $rootScope.openModal('questInvitation'); }); diff --git a/public/js/services/notificationServices.js b/public/js/services/notificationServices.js index 7b4a48c817..1ce793794e 100644 --- a/public/js/services/notificationServices.js +++ b/public/js/services/notificationServices.js @@ -6,11 +6,11 @@ angular.module("notificationServices", []) function growl(html, type) { $.bootstrapGrowl(html, { ele: '#notification-area', - type: type, //(null, 'text', 'error', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit') + type: type || 'warning', //('info', 'text', 'error', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit') top_offset: 20, align: 'right', //('left', 'right', or 'center') width: 250, //(integer, or 'auto') - delay: 7000, + delay: 700000000, allow_dismiss: true, stackup_spacing: 10 // spacing between consecutive stacecked growls. }); @@ -25,11 +25,11 @@ angular.module("notificationServices", []) gold = Math.floor(absolute); silver = Math.floor((absolute - gold) * 100); if (gold && silver > 0) { - return "" + gold + " " + silver + " "; + return "" + gold + " " + silver + " "; } else if (gold > 0) { - return "" + gold + " "; + return "" + gold + " "; } else if (silver > 0) { - return "" + silver + " "; + return "" + silver + " "; } }; @@ -45,11 +45,11 @@ angular.module("notificationServices", []) coins: coins, hp: function(val) { // don't show notifications if user dead - growl(" " + sign(val) + " " + round(val) + " HP", 'hp'); + growl("  " + sign(val) + " " + round(val) + " HP", 'hp'); }, exp: function(val) { if (val < -50) return; // don't show when they level up (resetting their exp) - growl(" " + sign(val) + " " + round(val) + " XP", 'xp'); + growl("  " + sign(val) + " " + round(val) + " XP", 'xp'); }, gp: function(val, bonus) { growl(sign(val) + " " + coins(val - bonus), 'gp'); @@ -58,22 +58,22 @@ angular.module("notificationServices", []) growl(val); }, lvl: function(){ - growl(' Level Up!', 'lvl'); + growl('  Level Up!', 'lvl'); }, death: function(){ - growl(" Respawn!", "death"); + growl("  Respawn!", "death"); }, error: function(error){ - growl(" " + error, "error"); + growl("  " + error, "error"); }, mp: function(val) { - growl(" " + sign(val) + " " + round(val) + " MP", 'mp'); + growl("  " + sign(val) + " " + round(val) + " MP", 'mp'); }, crit: function(val) { - growl(" Critical Hit! Bonus: " + Math.round(val) + "%", 'crit'); + growl("  Critical Hit! Bonus: " + Math.round(val) + "%", 'crit'); }, drop: function(val) { - growl(" " + val, 'drop'); + growl("  " + val, 'drop'); } }; }