From 1fcbf0b99632caa2616a518f5e9944244eea218c Mon Sep 17 00:00:00 2001 From: devfake Date: Wed, 24 Jun 2015 20:34:35 +0200 Subject: [PATCH] deck view --- assets/data/deck.js | 1 + .../deck-builder/components/deck-builder.js | 33 ++++- .../deck-builder/views/deck-builder.html | 120 +++++++++++++++++- site/client/assets/sass/_base.scss | 2 +- site/client/assets/sass/_shame_cards.scss | 19 +++ 5 files changed, 160 insertions(+), 15 deletions(-) diff --git a/assets/data/deck.js b/assets/data/deck.js index 27a979d..54a3866 100644 --- a/assets/data/deck.js +++ b/assets/data/deck.js @@ -1,6 +1,7 @@ module.exports = { "northern_realm": [ + "redanian_foot_soldier", "redanian_foot_soldier", "poor_fucking_infantry", "redanian_foot_soldier", diff --git a/site/client/app/modules/deck-builder/components/deck-builder.js b/site/client/app/modules/deck-builder/components/deck-builder.js index fa2244b..6f36998 100644 --- a/site/client/app/modules/deck-builder/components/deck-builder.js +++ b/site/client/app/modules/deck-builder/components/deck-builder.js @@ -8,7 +8,7 @@ module.exports = { data: function() { return { cards: [], - deck: [], + deck: {}, leaders: [], leader: null, @@ -18,12 +18,8 @@ module.exports = { }, ready: function() { - // filter over leaders and store them separately. - this.cards = $.map(cards, (n) => { - if(n.type != 3) return n; - - this.leaders.push(n); - }); + this.initCards(); + this.initDeck(); }, methods: { @@ -31,11 +27,34 @@ module.exports = { // todo: load animation $('.all-cards').addClass('remove'); this.factionFilter = deck; + this.initDeck(); $('.all-cards').scrollTop(0); setTimeout(function() { $('.all-cards').removeClass('remove'); }, 500); + }, + + // Filter for leaders and store them separately. + initCards: function() { + this.cards = $.map(cards, (n) => { + if(n.type != 3) return n; + + this.leaders.push(n); + }); + }, + + initDeck: function() { + this.deck = {}; + + deck[this.factionFilter].forEach((x) => { + this.deck[x] = (this.deck[x] || 0) + 1; + }); + }, + + // test + removeCard: function(el) { + } } }; \ No newline at end of file diff --git a/site/client/app/modules/deck-builder/views/deck-builder.html b/site/client/app/modules/deck-builder/views/deck-builder.html index d1d73a8..e63f0e3 100644 --- a/site/client/app/modules/deck-builder/views/deck-builder.html +++ b/site/client/app/modules/deck-builder/views/deck-builder.html @@ -1,7 +1,13 @@
- Northern Realm - Scoia'tael - Monster + + +
+ My Deck +
@@ -20,8 +26,111 @@
+
+
+ +
+ +
+
+
+
+
{{ $value }}x Blue Stripes Commando
+ + Power: 5 (Close Combat) + + Delete +
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/site/client/assets/sass/_base.scss b/site/client/assets/sass/_base.scss index d14a489..507e8cd 100644 --- a/site/client/assets/sass/_base.scss +++ b/site/client/assets/sass/_base.scss @@ -10,7 +10,7 @@ body { body { width: 100%; - min-width: 1000px; + min-width: 1200px; overflow: hidden; font-family: 'Titillium Web', sans-serif; } diff --git a/site/client/assets/sass/_shame_cards.scss b/site/client/assets/sass/_shame_cards.scss index 8578306..9685f76 100644 --- a/site/client/assets/sass/_shame_cards.scss +++ b/site/client/assets/sass/_shame_cards.scss @@ -219,6 +219,24 @@ background: linear-gradient(to bottom, rgba(8,13,20,1) 0%,rgba(8,13,20,1) 36%,rgba(8,13,20,0.85) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#080d14', endColorstr='#d9080d14',GradientType=0 ); + .heading-decks { + float: left; + width: 53%; + } + + .heading-my-deck { + float: left; + width: 47%; + } + + span { + float: left; + font-size: 17px; + color: #435365; + font-weight: 600; + margin: 0 0 0 20px; + } + a { font-size: 17px; color: #435365; @@ -229,6 +247,7 @@ &.active { color: #c3cdd8; } + } }