Add css and js implementation of previously naïve approach
Bonus: Learned some meteor :)
This commit is contained in:
@@ -14,3 +14,17 @@
|
||||
min-width: 72px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.stat-card .skill-mod.advantage{
|
||||
background-image: url(/png/advantage/greenUp.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.stat-card .skill-mod.disadvantage{
|
||||
background-image: url(/png/advantage/redDown.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
@@ -6,4 +6,10 @@ Template.statCard.helpers({
|
||||
)
|
||||
);
|
||||
},
|
||||
advantage: function(){
|
||||
var charId = Template.parentData()._id;
|
||||
var advantage = Characters.calculate.advantage(charId, this.stat);
|
||||
if (advantage > 0) return "advantage";
|
||||
if (advantage < 0) return "disadvantage";
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user