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

@@ -1,43 +0,0 @@
.abilityDetails {
background-color: #ebe2d5;
position: absolute;
top: 0px;
height: 300px;
right: 0px;
width: 160px;
z-index: 10;
background-color: #ebe2d5;
transition: right 0.3s ease;
}
.stubHolder {
display: flex;
flex-direction: column;
justify-content: space-around;
position: absolute;
top: 0px;
bottom: 0px;
width: 40px;
left: -40px;
}
.abilityStub {
text-align: center;
cursor: pointer;
background-color: #ebe2d5;
}
.abilityDetails.collapse{
right: -160px;
}
.abilityDetails.expand{
right: 0px;
}

View File

@@ -1,62 +0,0 @@
<template name="sideAbilities">
<div class="abilityDetails {{expanded}}">
<table>
{{#if selected "strength"}}
{{> skillRow name="Save" skill="strengthSave"}}
{{> skillRow name="Athletics" skill="athletics"}}
{{/if}}
{{#if selected "dexterity"}}
{{> skillRow name="Save" skill="dexteritySave"}}
{{> skillRow name="Acrobatics" skill="acrobatics"}}
{{> skillRow name="Sleight of Hand" skill="sleightOfHand"}}
{{> skillRow name="Stealth" skill="stealth"}}
{{/if}}
{{#if selected "constitution"}}
{{> skillRow name="Save" skill="constitutionSave"}}
{{/if}}
{{#if selected "intelligence"}}
{{> skillRow name="Save" skill="intelligenceSave"}}
{{> 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"}}
{{/if}}
{{#if selected "wisdom"}}
{{> skillRow name="Save" skill="wisdomSave"}}
{{> skillRow name="Animal Handling" skill="animalHandling"}}
{{> skillRow name="Insight" skill="insight"}}
{{> skillRow name="Medicine" skill="medicine"}}
{{> skillRow name="Perception" skill="perception"}}
{{> skillRow name="Survival" skill="survival"}}
{{/if}}
{{#if selected "charisma"}}
{{> skillRow name="Save" skill="charismaSave"}}
{{> skillRow name="Deception" skill="deception"}}
{{> skillRow name="Intimidation" skill="intimidation"}}
{{> skillRow name="Performance" skill="performance"}}
{{> skillRow name="Persuasion" skill="persuasion"}}
{{/if}}
</table>
<div class="stubHolder">
<div class="strengthStub abilityStub">
Str<br>{{abilityMod "strength"}}
</div>
<div class="dexterityStub abilityStub">
Dex<br>{{abilityMod "dexterity"}}
</div>
<div class="constitutionStub abilityStub">
Con<br>{{abilityMod "constitution"}}
</div>
<div class="intelligenceStub abilityStub">
Int<br>{{abilityMod "intelligence"}}
</div>
<div class="wisdomStub abilityStub">
Wis<br>{{abilityMod "wisdom"}}
</div>
<div class="charismaStub abilityStub">
Cha<br>{{abilityMod "charisma"}}
</div>
</div>
</div>
</template>

View File

@@ -1,38 +0,0 @@
Template.sideAbilities.created = function(){
Template.instance().openedAbility = new ReactiveVar(null);
};
Template.sideAbilities.helpers({
openedAbility: function(){
Template.instance().openedAbility.get();
},
selected: function(string){
return Template.instance().openedAbility.get() === string;
},
expanded: function(){
if(Template.instance().openedAbility.get() === null){
return "collapse";
} else{
return "expand";
}
}
});
var abilityOpener = function(ability){
return function(){
if(Template.instance().openedAbility.get() === ability){
Template.instance().openedAbility.set(null);
} else{
Template.instance().openedAbility.set(ability);
}
};
};
Template.sideAbilities.events({
"click .strengthStub": abilityOpener("strength"),
"click .dexterityStub": abilityOpener("dexterity"),
"click .constitutionStub": abilityOpener("constitution"),
"click .intelligenceStub": abilityOpener("intelligence"),
"click .wisdomStub": abilityOpener("wisdom"),
"click .charismaStub": abilityOpener("charisma")
});

View File

@@ -1,18 +1,3 @@
<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">
<div class="subhead skillRow">
{{> ripple}}

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";
}
})
}
});

View File

@@ -1,14 +0,0 @@
<template name="characterName">
<div id="level">
{{experience.level}}
</div>
<div id="name">
{{name}}
</div>
<div id="role">
{{alignment}} {{gender}} {{race}}
</div>
<div>
{{> healthBar}}
</div>
</template>

View File

@@ -1,28 +0,0 @@
.flexItem.abilities {
flex-grow: 1;
width: 100px;
max-width: 400px;
}
.floatBox.ability {
width: 85px;
text-align: center;
display: inline-block;
}
.abilityName {
}
.abilityScore {
font-size: 2em;
}
.abilityMod {
margin: 0 auto -15px;
padding: 2px;
border: 2px solid black;
border-radius: 5px;
background: white;
width: 40px;
}

View File

@@ -1,32 +0,0 @@
<template name = "bigAbilities">
<div class="ability">
{{> bigAbility name="Strength" ability="strength"}}
</div>
<div class="ability">
{{> bigAbility name="Dexterity" ability="dexterity"}}
</div>
<div class="ability">
{{> bigAbility name="Constitution" ability="constitution"}}
</div>
<div class="ability">
{{> bigAbility name="Intelligence" ability="intelligence"}}
</div>
<div class="ability">
{{> bigAbility name="Wisdom" ability="wisdom"}}
</div>
<div class="ability">
{{> bigAbility name="Charisma" ability="charisma"}}
</div>
</template>
<template name="bigAbility">
<div class ="abilityName">
{{name}}
</div>
<div class="abilityScore">
{{../attributeValue ability}}
</div>
<div class="abilityMod">
{{../abilityMod ability}}
</div>
</template>

View File

@@ -1,24 +0,0 @@
<template name="persona">
<div class="flexItem floatBox">
<h2>Description</h2>
{{> textField character=this field="description"}}
</div>
<div class="flexItem floatBox">
<h2>Personality</h2>
{{> textField character=this field="personality"}}
<h2>Ideals</h2>
{{> textField character=this field="ideals"}}
<h2>Bonds</h2>
{{> textField character=this field="bonds"}}
<h2>Flaws</h2>
{{> textField character=this field="flaws"}}
</div>
<div class="flexItem floatBox">
<h2>Backstory</h2>
{{> textField character=this field="backstory"}}
</div>
<div class="flexItem floatBox">
<h2>Notes</h2>
{{> textField character=this field="notes"}}
</div>
</template>

View File

@@ -1,22 +0,0 @@
<template name="resources">
<div>
{{#if hasSlots}}
{{slotSummary}}
{{/if}}
</div>
<div>
{{#if hasKi}}
{{attributeValue attributes.ki}}
{{/if}}
</div>
<div>
{{#if hasSorceryPoints}}
{{attributeValue attributes.sorceryPoints}}
{{/if}}
</div>
<div>
{{#if hasRages}}
{{attributeValue attributes.rages}}
{{/if}}
</div>
</template>

View File

@@ -1,36 +0,0 @@
Template.resources.helpers({
hasSlots: function(){
var slots = 0;
for(var i = 1; i < 9; i++){
var attribute = this.attributes["level"+i+"SpellSlots"]
if(attribute.base != 0) return true;
if(attribute.add.length != 0) return true;
}
},
hasKi: function(){
var slots = 0;
var attribute = this.attributes.ki;
if(attribute.base != 0) return true;
if(attribute.add.length != 0) return true;
},
hasSorceryPoints: function(){
var slots = 0;
var attribute = this.attributes.sorceryPoints;
if(attribute.base != 0) return true;
if(attribute.add.length != 0) return true;
},
hasRages: function(){
var slots = 0;
var attribute = this.attributes.rages;
if(attribute.base != 0) return true;
if(attribute.add.length != 0) return true;
},
slotSummary: function(){
var slots = "";
for(var i = 1; i < 9; i++){
if (i > 0) slots += " "
slots += this.attributeValue(this.attributes["level"+i+"SpellSlots"]);
}
return slots;
}
});

View File

@@ -1,75 +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(){
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";
}
})
}
});

View File

@@ -1,7 +0,0 @@
#textOutput.notEditing{
cursor: pointer;
}
.textField {
min-height: 32px;
}

View File

@@ -1,9 +0,0 @@
<template name="textField">
{{#if editing}}
<div id="textInput" class="textField {{outputClass}}" contenteditable=true>{{input}}</div>
{{else}}
<div id="textOutput" class="textField {{outputClass}}">
{{output}}
</div>
{{/if}}
</template>

View File

@@ -1,46 +0,0 @@
Template.textField.created = function(){
Template.instance().editing = new ReactiveVar(false);
document.execCommand('defaultParagraphSeparator', false, 'div');
}
Template.textField.helpers({
editing: function(){
return Template.instance().editing.get();
},
input: function(){
var text = this.character.getField(this.field);
if (_.isString(text)) return Spacebars.SafeString(text);
return text;
},
output: function(){
var html = evaluateString(this.character._id, this.character.getField(this.field));
if (_.isString(html)) return Spacebars.SafeString(html);
return html;
},
outputClass: function(){
if(Template.instance().editing.get()){
return "editing";
} else{
return "notEditing"
}
}
})
Template.textField.events({
"blur #textInput": function(){
Template.instance().editing.set(false);
var text = $("#textInput").html();
if(!_.isString(text)) text = "";
//TODO sanitise the html
var setter = {};
setter[this.field] = text;
Characters.update(this.character._id, {$set: setter}, {removeEmptyStrings: false});
},
"click #textOutput": function(){
Template.instance().editing.set(true);
Tracker.afterFlush(function(){
$("#textInput").focus();
placeCaretAtEnd($("#textInput"));
});
}
})

View File

@@ -1,67 +0,0 @@
/* LESS - http://lesscss.org style sheet */
/* Palette color codes */
/* Palette URL: http://paletton.com/#uid=7000K0kDPzIFM9PC5lZm-D39kMT */
/* Feel free to copy&paste color codes to your application */
/* MIXINS */
/* As hex codes */
@color-primary-0: #FF0000; /* Main Primary color */
@color-primary-1: #4E0000;
@color-primary-2: #AF0000;
@color-primary-3: #FF4B4B;
@color-primary-4: #FFB5B5;
@color-secondary-1-0: #0961B0; /* Main Secondary color (1) */
@color-secondary-1-1: #021C33;
@color-secondary-1-2: #063F71;
@color-secondary-1-3: #4182BC;
@color-secondary-1-4: #9DBCD7;
@color-secondary-2-0: #FF9500; /* Main Secondary color (2) */
@color-secondary-2-1: #4E2E00;
@color-secondary-2-2: #AF6700;
@color-secondary-2-3: #FFB54B;
@color-secondary-2-4: #FFE0B5;
@color-complement-0: #00D200; /* Main Complement color */
@color-complement-1: #003F00;
@color-complement-2: #008C00;
@color-complement-3: #40D940;
@color-complement-4: #A5E9A5;
/* As RGBa codes */
@rgba-primary-0: rgba(255, 0, 0,1); /* Main Primary color */
@rgba-primary-1: rgba( 78, 0, 0,1);
@rgba-primary-2: rgba(175, 0, 0,1);
@rgba-primary-3: rgba(255, 75, 75,1);
@rgba-primary-4: rgba(255,181,181,1);
@rgba-secondary-1-0: rgba( 9, 97,176,1); /* Main Secondary color (1) */
@rgba-secondary-1-1: rgba( 2, 28, 51,1);
@rgba-secondary-1-2: rgba( 6, 63,113,1);
@rgba-secondary-1-3: rgba( 65,130,188,1);
@rgba-secondary-1-4: rgba(157,188,215,1);
@rgba-secondary-2-0: rgba(255,149, 0,1); /* Main Secondary color (2) */
@rgba-secondary-2-1: rgba( 78, 46, 0,1);
@rgba-secondary-2-2: rgba(175,103, 0,1);
@rgba-secondary-2-3: rgba(255,181, 75,1);
@rgba-secondary-2-4: rgba(255,224,181,1);
@rgba-complement-0: rgba( 0,210, 0,1); /* Main Complement color */
@rgba-complement-1: rgba( 0, 63, 0,1);
@rgba-complement-2: rgba( 0,140, 0,1);
@rgba-complement-3: rgba( 64,217, 64,1);
@rgba-complement-4: rgba(165,233,165,1);
/* Generated by Paletton.com © 2002-2014 */
/* http://paletton.com */

View File

@@ -1,48 +0,0 @@
<template name="publicHeader">
<core-toolbar class="toolbar toolbar-primary">
<a class="header-logo" href="/">
<img src="/img/white-logo.png"/>
</a>
<div flex></div>
<div class="visible-md wide">
<div layout horizontal>
{{> headerItems}}
</div>
</div>
<paper-menu-button class="hidden-md narrow">
<paper-icon-button icon="menu" role="button"></paper-icon-button>
<paper-dropdown class="dropdown" halign="right">
<core-menu class="menu">
{{> headerItems}}
</core-menu>
</paper-dropdown>
</paper-menu-button>
</core-toolbar>
</template>
<template name="headerItems">
<paper-item class="toolbar-item">
<a href="{{pathFor route='pricing'}}">
Pricing
</a>
</paper-item>
<paper-item class="toolbar-item">
<a href="{{pathFor route='accounts.signUp'}}">
Sign Up
</a>
</paper-item>
<paper-item class="toolbar-item">
<a href="{{pathFor route='accounts.signIn'}}">
Sign In
</a>
</paper-item>
</template>

View File

@@ -1,6 +0,0 @@
<template name="clickCard">
<paper-shadow animated class="clickCard {{class}}" z="1" id={{id}}>
{{> ripple}}
{{> UI.contentBlock}}
</paper-shadow>
</template>

View File

@@ -1,8 +0,0 @@
Template.clickCard.events({
"click paper-shadow ": function(event){
event.currentTarget.setZ(2);
_.delay(function(){
event.currentTarget.setZ(1);
}, 300)
}
})

View File

@@ -7,20 +7,18 @@ standardItems = [
equipmentSlot: "armor",
weight: 8,
value: 5,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 11,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 11,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Leather Armor",
@@ -30,15 +28,13 @@ standardItems = [
equipmentSlot: "armor",
weight: 10,
value: 10,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 11,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 11,
}
]
},
{
name: "Studded leather Armor",
@@ -48,15 +44,13 @@ standardItems = [
equipmentSlot: "armor",
weight: 13,
value: 45,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 12,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 12,
}
]
},
{
name: "Hide Armor",
@@ -66,20 +60,18 @@ standardItems = [
equipmentSlot: "armor",
weight: 12,
value: 10,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 12,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 12,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
},
{
name: "Chain Shirt",
@@ -89,20 +81,18 @@ standardItems = [
equipmentSlot: "armor",
weight: 20,
value: 50,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 13,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 13,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
},
{
name: "Scale Mail",
@@ -112,25 +102,24 @@ standardItems = [
equipmentSlot: "armor",
weight: 45,
value: 50,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Breastplate",
@@ -140,20 +129,18 @@ standardItems = [
equipmentSlot: "armor",
weight: 20,
value: 400,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
}
]
},
{
name: "Half Plate",
@@ -163,25 +150,23 @@ standardItems = [
equipmentSlot: "armor",
weight: 40,
value: 750,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 15,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 15,
},
{
stat: "dexterityArmor",
operation: "max",
value: 2,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Ring Mail",
@@ -191,25 +176,23 @@ standardItems = [
equipmentSlot: "armor",
weight: 40,
value: 30,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 14,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Chain Mail",
@@ -219,25 +202,23 @@ standardItems = [
equipmentSlot: "armor",
weight: 55,
value: 75,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 16,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 16,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Splint Armor",
@@ -247,25 +228,23 @@ standardItems = [
equipmentSlot: "armor",
weight: 60,
value: 200,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 17,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 17,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Plate Armor",
@@ -275,25 +254,23 @@ standardItems = [
equipmentSlot: "armor",
weight: 65,
value: 1500,
feature: {
effects: [
{
stat: "armor",
operation: "base",
value: 18,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
}
effects: [
{
stat: "armor",
operation: "base",
value: 18,
},
{
stat: "dexterityArmor",
operation: "max",
value: 0,
},
{
stat: "stealth",
operation: "disadvantage",
value: 1,
}
]
},
{
name: "Shield",
@@ -303,14 +280,12 @@ standardItems = [
equipmentSlot: "held",
weight: 6,
value: 10,
feature: {
effects: [
{
stat: "armor",
operation: "add",
value: 2,
}
]
}
effects: [
{
stat: "armor",
operation: "add",
value: 2,
}
]
},
]