diff --git a/src/app/index.coffee b/src/app/index.coffee index a15ad9759e..4ddcc5b007 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -57,6 +57,15 @@ view.fn 'taskClasses', (type, completed) -> classes = type classes += " completed" if completed return classes + +view.fn "round", (num) -> + Math.round num + +view.fn "gold", (num) -> + num.toFixed(1).split('.')[0] + +view.fn "silver", (num) -> + num.toFixed(1).split('.')[1] ## CONTROLLER FUNCTIONS ## @@ -86,7 +95,10 @@ ready (model) -> # Also, note that refList index arguments can either be an index # or the item's id property list.pass(ignore: domId).move {id}, to - + + $("#tnl-bar" ).progressbar value: model.at('_user.exp')/model.at('_tnl') * 100 + $("#hp-bar" ).progressbar value: model.at('_user.hp')/50 * 100 + exports.addTask = (e, el, next) -> type = $(el).attr('data-task-type') list = model.at "_#{type}List" diff --git a/views/app/index.html b/views/app/index.html index f221f994c2..d0874d5d6c 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -63,14 +63,14 @@
-
{_user.lvl}
+
Lvl: {_user.lvl}
- {_user.hp} + HP: {round(_user.hp)}
- {_tnl} + Exp: {round(_user.exp)} / {_tnl}
@@ -105,6 +105,7 @@ + {gold(_user.money)} {silver(_user.money)} {#each _rewardList}{/}