Cleaned up old code, removed outdated files

This commit is contained in:
Thaum
2015-02-03 07:35:34 +00:00
parent 18a870171a
commit 4377da5275
23 changed files with 212 additions and 777 deletions

View File

@@ -0,0 +1,34 @@
.card.double {
display: flex;
}
.card.double > div{
vertical-align: top;
padding: 16px;
}
.abilityScore {
width: 70px;
text-align: center;
background-color: #D50000;
padding: 16px;
position: relative;
border-radius: 2px 0 0 2px;
}
#stats .card {
padding: 0;
}
.abilityCardRight {
flex-grow: 1;
padding-right: 0;
}
.abilityCardRight hr{
margin: 8px 0 8px -16px;
}
.abilityCardRight h1{
margin-bottom: 8px;
}

View File

@@ -0,0 +1,135 @@
<template name="abilityCards">
{{> strengthCard}}
{{> dexterityCard}}
{{> constitutionCard}}
{{> intelligenceCard}}
{{> wisdomCard}}
{{> charismaCard}}
</template>
<template name="strengthCard">
<paper-shadow class="card double">
<div class="abilityScore red white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "strength"}}</h1>
<h2>{{abilityMod "strength"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Strength</h1>
{{> skillRow name="Save" skill="strengthSave"}}
<hr>
{{> skillRow name="Athletics" skill="athletics"}}
</div>
</paper-shadow>
</template>
<template name="dexterityCard">
<paper-shadow class="card double">
<div class="abilityScore green white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "dexterity"}}</h1>
<h2>{{abilityMod "dexterity"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Dexterity</h1>
{{> skillRow name="Save" skill="dexteritySave"}}
{{> skillRow name="Initiative" skill="initiative"}}
<hr>
{{> skillRow name="Acrobatics" skill="acrobatics"}}
{{> skillRow name="Sleight of Hand" skill="sleightOfHand"}}
{{> skillRow name="Stealth" skill="stealth"}}
</div>
</paper-shadow>
</template>
<template name="constitutionCard">
<paper-shadow class="card double">
<div class="abilityScore deep-orange white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "constitution"}}</h1>
<h2>{{abilityMod "constitution"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Constitution</h1>
{{> skillRow name="Save" skill="constitutionSave"}}
<hr>
<h1 class="attribute" hero-id="d6HitDice">
{{> hitDice hitDice="d6HitDice" d="6"}}
</h1>
<h1 class="attribute" hero-id="d8HitDice">
{{> hitDice hitDice="d8HitDice" d="8"}}
</h1>
<h1 class="attribute" hero-id="d10HitDice">
{{> hitDice hitDice="d10HitDice" d="10"}}
</h1>
<h1 class="attribute" hero-id="d12HitDice">
{{> hitDice hitDice="d12HitDice" d="12"}}
</h1>
</div>
</paper-shadow>
</template>
<template name="intelligenceCard">
<paper-shadow class="card double">
<div class="abilityScore indigo white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "intelligence"}}</h1>
<h2>{{abilityMod "intelligence"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Intelligence</h1>
{{> skillRow name="Save" skill="intelligenceSave"}}
<hr>
{{> skillRow name="Arcana" skill="arcana"}}
{{> skillRow name="History" skill="history"}}
{{> skillRow name="Investigation" skill="investigation"}}
{{> skillRow name="Nature" skill="nature"}}
{{> skillRow name="Religion" skill="religion"}}
</div>
</paper-shadow>
</template>
<template name="wisdomCard">
<paper-shadow class="card double">
<div class="abilityScore purple white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "wisdom"}}</h1>
<h2>{{abilityMod "wisdom"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Wisdom</h1>
{{> skillRow name="Save" skill="wisdomSave"}}
<hr>
{{> skillRow name="Animal Handling" skill="animalHandling"}}
{{> skillRow name="Insight" skill="insight"}}
{{> skillRow name="Medicine" skill="medicine"}}
{{> skillRow name="Perception" skill="perception" showPassive="true"}}
{{> skillRow name="Survival" skill="survival"}}
</div>
</paper-shadow>
</template>
<template name="charismaCard">
<paper-shadow class="card double">
<div class="abilityScore pink white-text">
{{> ripple color="#eee"}}
<h1 class="display1">{{attributeValue "charisma"}}</h1>
<h2>{{abilityMod "charisma"}}</h2>
</div>
<div class="abilityCardRight">
<h1>Charisma</h1>
{{> skillRow name="Save" skill="charismaSave"}}
<hr>
{{> skillRow name="Deception" skill="deception"}}
{{> skillRow name="Intimidation" skill="intimidation"}}
{{> skillRow name="Performance" skill="performance"}}
{{> skillRow name="Persuasion" skill="persuasion"}}
</div>
</paper-shadow>
</template>
<template name="hitDice">
{{# if ../attributeBase hitDice}}
{{../attributeValue hitDice}}d{{d}} {{../abilityMod "constitution"}}
{{/if}}
</template>

View File

@@ -0,0 +1,54 @@
.skillRow {
height: 32px;
display: flex;
align-items: center;
position: relative;
}
.skillRow:hover{
background: #FFEBEE;
}
.profIcon{
display: inline-block;
width: 40px;
height: 26px;
background-size: contain;
background-repeat: no-repeat;
/*TODO fix the actual images and remove inversion*/
-webkit-filter: invert(100%);
opacity: 0.54;
pointer-events: none;
}
.skillMod {
width: 20px;
text-align: right;
}
.skillName, .skillMod{
display: inline-block;
vertical-align: top;
margin-right: 8px;
}
.fail.skillMod {
color: #D50000;
}
.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: "*";
}

View File

@@ -0,0 +1,17 @@
<template name="skillRow">
<div class="subhead skillRow">
{{> ripple}}
<div class="profIcon" style="background-image: url(/png/profIcons/{{profIcon skill}})"></div>
{{#if failSkill}}
<div class="fail skillMod">fail</div>
{{else}}
<div class="{{advantage}} skillMod">{{../skillMod skill}}</div>
{{/if}}
<div class="{{conditionals}} skillName">
{{name}}
{{#if showPassive}}
({{../passiveSkill skill}})
{{/if}}
</div>
</div>
</template>

View File

@@ -0,0 +1,40 @@
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(){
var skill = Template.parentData(1).getField(this.skill);
_.each(skill.effets, function(effect){
if (effect.operation === "fail"){
return true;
}
})
return false;
},
advantage: function(){
var adv = 0;
var disadv = 0;
var skill = Template.parentData(1).getField(this.skill);
_.each(skill.effets, function(effect){
if (effect.operation === "advantage"){
adv ++;
} else if (effect.operation === "disadvantage") {
disadv ++;
}
})
if(adv > 0 && disadv === 0) return "advantage";
if(disadv > 0 && adv === 0) return "disadvantage";
},
conditionals: function(){
var skill = Template.parentData(1).getField(this.skill);
_.each(skill.effets, function(effect){
if (effect.operation === "conditional"){
return "conditionals";
}
})
}
});