Added Health Bar

This commit is contained in:
Thaum
2015-02-20 11:26:54 +00:00
parent f599bc4a46
commit 08f02d9b36
5 changed files with 34 additions and 6 deletions

View File

@@ -19,12 +19,12 @@
</core-toolbar>
<div fit>
<core-animated-pages id="tabPages" selected={{selectedTab}} transitions="slide-from-right" fit>
<swipe-detect touch-action="pan-y" flex>{{> stats}}</swipe-detect>
<swipe-detect touch-action="pan-y" flex>{{> features}}</swipe-detect>
<swipe-detect touch-action="pan-y" flex>{{> inventory}}</swipe-detect>
<swipe-detect touch-action="pan-y" flex>{{> spells}}</swipe-detect>
<swipe-detect touch-action="pan-y" flex>{{> persona}}</swipe-detect>
<swipe-detect touch-action="pan-y" flex>{{> journal}}</swipe-detect>
<section flex>{{> stats}}</section>
<section flex>{{> features}}</section>
<section flex>{{> inventory}}</section>
<section flex>{{> spells}}</section>
<section flex>{{> persona}}</section>
<section flex>{{> journal}}</section>
</core-animated-pages>
</div>
</template>

View File

@@ -17,3 +17,17 @@
.containerMain.featureDescription {
white-space: pre-line;
}
.resourceCards paper-shadow.healthCard {
width: 100%;
padding: 0 16px 0 0;
}
.healthCard paper-slider{
width: 100%;
}
#hitPointSlider::shadow #sliderBar::shadow #activeProgress {
background-color: #0f9d58;
height: 50px;
}

View File

@@ -2,6 +2,14 @@
<div fit>
<div class="scroll-y" fit>
<div class="resourceCards" layout horizontal wrap>
<paper-shadow class="card container healthCard" hero-id="main" {{detailHero}} layout vertical>
<paper-slider id="hitPointSlider"
value={{attributeValue "hitPoints"}}
max={{attributeBase "hitPoints"}}
editable pin
role="slider"
></paper-slider>
</paper-shadow>
<!--Armor-->
<paper-shadow class="card container statCard" hero-id="main" {{detailHero}} layout horizontal>
<div class="containerLeft">

View File

@@ -39,6 +39,11 @@ Template.features.events({
"tap .resetFeature": function(event){
var featureId = this._id;
Features.update(featureId, {$set: {used: 0}});
},
"change #hitPointSlider": function(event){
var value = event.currentTarget.value;
var adjustment = value - this.attributeBase("hitPoints");
Characters.update(this._id, {$set: {"hitPoints.adjustment": adjustment}});
}
});

View File

@@ -29,6 +29,7 @@
<link rel="import" href="/components/paper-item/paper-item.html">
<link rel="import" href="/components/paper-menu-button/paper-menu-button.html">
<link rel="import" href="/components/paper-shadow/paper-shadow.html">
<link rel="import" href="/components/paper-slider-diff/paper-slider.html">
<link rel="import" href="/components/paper-spinner/paper-spinner.html">
<link rel="import" href="/components/paper-tabs/paper-tabs.html">
<link rel="import" href="/components/paper-toggle-button/paper-toggle-button.html">