Finished colourful ability score cards
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
.profIcon{
|
||||
display: inline-block;
|
||||
width: 23px;
|
||||
height: 14px;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
position: relative;
|
||||
top: 1px;
|
||||
|
||||
/*TODO fix the actual images and remove inversion*/
|
||||
-webkit-filter: invert(100%);
|
||||
opacity: 0.54;
|
||||
}
|
||||
|
||||
table.skillTable td:nth-of-type(2) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.skillTable td:nth-of-type(3) {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
td.fail {
|
||||
color: #AF0000;
|
||||
}
|
||||
|
||||
.advantage{
|
||||
background-image: url(/png/advantage/greenUp.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.disadvantage{
|
||||
background-image: url(/png/advantage/redDown.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
td.conditionals::after{
|
||||
content: "*";
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<template name="skills">
|
||||
<h2>Saving Throws</h2>
|
||||
<table class="skillTable">
|
||||
{{#each saveList}}
|
||||
{{> skillRow}}
|
||||
{{/each}}
|
||||
</table>
|
||||
<h2>Skills</h2>
|
||||
<table class="skillTable">
|
||||
{{#each skillList}}
|
||||
{{> skillRow}}
|
||||
{{/each}}
|
||||
</table>
|
||||
</template>
|
||||
|
||||
<template name="skillRow">
|
||||
<tr>
|
||||
<td><div class="profIcon" style="background-image: url(/png/profIcons/{{profIcon skill}})"></div></td>
|
||||
{{#if failSkill}}
|
||||
<td class="fail">fail</td>
|
||||
{{else}}
|
||||
<td class="{{advantage}}">{{../skillMod skill}}</td>
|
||||
{{/if}}
|
||||
<td class={{conditionals}}>{{name}}</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -1,58 +0,0 @@
|
||||
Template.skills.helpers({
|
||||
saveList: function(){
|
||||
return [
|
||||
{name: "Strength", skill: "strengthSave"},
|
||||
{name: "Dexterity", skill: "dexteritySave"},
|
||||
{name: "Constitution", skill: "constitutionSave"},
|
||||
{name: "Intelligence", skill: "intelligenceSave"},
|
||||
{name: "Wisdom", skill: "wisdomSave"},
|
||||
{name: "Charisma", skill: "charismaSave"}
|
||||
];
|
||||
},
|
||||
skillList: function(){
|
||||
return [
|
||||
{name: "Acrobatics", skill: "acrobatics"},
|
||||
{name: "Animal Handling", skill: "animalHandling"},
|
||||
{name: "Arcana", skill: "arcana"},
|
||||
{name: "Athletics", skill: "athletics"},
|
||||
{name: "Deception", skill: "deception"},
|
||||
{name: "History", skill: "history"},
|
||||
{name: "Insight", skill: "insight"},
|
||||
{name: "Intimidation", skill: "intimidation"},
|
||||
{name: "Investigation", skill: "investigation"},
|
||||
{name: "Medicine", skill: "medicine"},
|
||||
{name: "Nature", skill: "nature"},
|
||||
{name: "Perception", skill: "perception"},
|
||||
{name: "Performance", skill: "performance"},
|
||||
{name: "Persuasion", skill: "persuasion"},
|
||||
{name: "Religion", skill: "religion"},
|
||||
{name: "Sleight of Hand", skill: "sleightOfHand"},
|
||||
{name: "Stealth", skill: "stealth"},
|
||||
{name: "Survival", skill: "survival"}
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
Template.skillRow.helpers({
|
||||
profIcon: function(skill){
|
||||
var prof = Template.parentData(1).proficiency(this.skill);
|
||||
if(prof > 0 && prof < 1) return "profHalf.png";
|
||||
if(prof === 1) return "profSingle.png";
|
||||
if(prof > 1) return "profDouble.png";
|
||||
return "profNone.png";
|
||||
},
|
||||
failSkill: function(){
|
||||
return Template.parentData(1).getField(this.skill).fail.length > 0;
|
||||
},
|
||||
advantage: function(){
|
||||
var adv = Template.parentData(1).getField(this.skill).advantage.length;
|
||||
var disadv = Template.parentData(1).getField(this.skill).disadvantage.length;
|
||||
if(adv > 0 && disadv === 0) return "advantage";
|
||||
if(disadv > 0 && adv === 0) return "disadvantage";
|
||||
},
|
||||
conditionals: function(){
|
||||
if(Template.parentData(1).getField(this.skill).conditional.length > 0){
|
||||
return "conditionals";
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user