mirror of
https://github.com/exane/not-gwent-online
synced 2024-12-23 21:03:14 +00:00
add proper templates
This commit is contained in:
parent
16dfa9f2b2
commit
63320bad55
@ -9,245 +9,6 @@
|
||||
<script src="Config.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script id="info-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
{{#health}}
|
||||
{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="battle-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-3 left-side">
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name"></div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
<i class="ruby"></i>
|
||||
<i class="ruby"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 field field-weather">
|
||||
field
|
||||
</div>
|
||||
<div class="col-xs-12 game-info game-info-player player">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
{{#health lives}}{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<button class="button-pass">Pass</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 battleside battleside-foe foe">
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 mid-line"></div>
|
||||
<div class="col-xs-12 battleside battleside-player player">
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.close}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 field field-hand">
|
||||
{{#each cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src='../assets/cards/{{_data.img}}.png'>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<div class="col-xs-12 card-preview">
|
||||
<!--<img src="{{preview}}">-->
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-foe foe">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-player player">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="matchmaker-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Gwent</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<input type="text" class="name-input" value="{{name}}">
|
||||
<select id="deckChoice">
|
||||
<option value="northern_realm">Deck: Northern Realms</option>
|
||||
<option value="scoiatael">Deck: Scoia'tael</option>
|
||||
<option value="monster">Deck: Monster</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<button type="button" class="btn btn-primary create-room">Create Room</button>
|
||||
<button type="button" class="btn btn-primary join-room">Join Room</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="game-info-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
<!--<i class="ruby"></i>-->
|
||||
{{#health lives}}{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<button class="button-pass">Pass</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="modal-template">
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each openDiscard.discard}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="modal-medic-template">
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Choose one card from your discard</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each medicDiscard.cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="preview-template">
|
||||
<img src="{{src}}">
|
||||
</script>
|
||||
<script src="build/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,19 +8,6 @@ var $ = require("jquery");
|
||||
|
||||
window.$ = $;
|
||||
|
||||
Handlebars.registerHelper("health", function(lives, options){
|
||||
var out = "";
|
||||
|
||||
for(var i = 0; i < 2; i++) {
|
||||
out += "<i";
|
||||
if(i < lives){
|
||||
out += " class='ruby'";
|
||||
}
|
||||
out += "></i>";
|
||||
}
|
||||
return out;
|
||||
});
|
||||
|
||||
var App = Backbone.Router.extend({
|
||||
routes: {
|
||||
"lobby": "lobbyRoute",
|
||||
@ -90,15 +77,8 @@ var App = Backbone.Router.extend({
|
||||
|
||||
var SideView = Backbone.View.extend({
|
||||
el: ".container",
|
||||
template: Handlebars.compile('<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">' +
|
||||
'<img src="../assets/cards/{{_data.img}}.png">' +
|
||||
'</div>'),
|
||||
templateCards: Handlebars.compile('{{#each this}}' +
|
||||
'<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">' +
|
||||
'{{#if boost}}<span>+{{boost}}</span>{{/if}}' +
|
||||
'<img src="../assets/cards/{{_data.img}}.png">' +
|
||||
'</div>' +
|
||||
'{{/each}}'),
|
||||
template: require("../templates/cards.handlebars"),
|
||||
templateCards: require("../templates/multipleCards.handlebars"),
|
||||
initialize: function(options){
|
||||
var self = this;
|
||||
this.side = options.side;
|
||||
@ -231,8 +211,8 @@ var calculateCardMargin = function($selector, totalWidth, cardWidth, n){
|
||||
|
||||
var BattleView = Backbone.View.extend({
|
||||
className: "container",
|
||||
template: Handlebars.compile($("#battle-template").html()),
|
||||
templatePreview: Handlebars.compile($("#preview-template").html()),
|
||||
template: require("../templates/battle.handlebars"),
|
||||
templatePreview: require("../templates/preview.handlebars"),
|
||||
initialize: function(options){
|
||||
var self = this;
|
||||
var user = this.user = options.user;
|
||||
@ -481,7 +461,7 @@ var BattleView = Backbone.View.extend({
|
||||
});
|
||||
|
||||
var Modal = Backbone.Modal.extend({
|
||||
template: Handlebars.compile($("#modal-template").html()),
|
||||
template: require("../templates/modal.handlebars"),
|
||||
cancelEl: ".bbm-close",
|
||||
cancel: function(){
|
||||
this.model.set("openDiscard", false);
|
||||
@ -489,7 +469,7 @@ var Modal = Backbone.Modal.extend({
|
||||
});
|
||||
|
||||
var MedicModal = Modal.extend({
|
||||
template: Handlebars.compile($("#modal-medic-template").html()),
|
||||
template: require("../templates/modal.medic.handlebars"),
|
||||
events: {
|
||||
"click .card": "onCardClick"
|
||||
},
|
||||
@ -608,7 +588,7 @@ var Lobby = Backbone.View.extend({
|
||||
},
|
||||
className: "container",
|
||||
|
||||
template: Handlebars.compile($("#matchmaker-template").html()),
|
||||
template: require("../templates/lobby.handlebars"),
|
||||
initialize: function(options){
|
||||
this.user = options.user;
|
||||
this.app = options.app;
|
||||
|
128
client/templates/battle.handlebars
Normal file
128
client/templates/battle.handlebars
Normal file
@ -0,0 +1,128 @@
|
||||
<div class="col-xs-3 left-side">
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name"></div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
<i class="ruby"></i>
|
||||
<i class="ruby"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 field field-weather">
|
||||
field
|
||||
</div>
|
||||
<div class="col-xs-12 game-info game-info-player player">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<button class="button-pass">Pass</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 battleside battleside-foe foe">
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 mid-line"></div>
|
||||
<div class="col-xs-12 battleside battleside-player player">
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.close}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 field field-hand">
|
||||
{{#each cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src='../assets/cards/{{_data.img}}.png'>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<div class="col-xs-12 card-preview">
|
||||
<!--<img src="{{preview}}">-->
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-foe foe">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-player player">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
3
client/templates/cards.handlebars
Normal file
3
client/templates/cards.handlebars
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
23
client/templates/info.handlebars
Normal file
23
client/templates/info.handlebars
Normal file
@ -0,0 +1,23 @@
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
{{#health}}
|
||||
{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
23
client/templates/lobby.handlebars
Normal file
23
client/templates/lobby.handlebars
Normal file
@ -0,0 +1,23 @@
|
||||
<div class="col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Gwent</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<input type="text" class="name-input" value="{{name}}">
|
||||
<select id="deckChoice">
|
||||
<option value="northern_realm">Deck: Northern Realms</option>
|
||||
<option value="scoiatael">Deck: Scoia'tael</option>
|
||||
<option value="monster">Deck: Monster</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<button type="button" class="btn btn-primary create-room">Create Room</button>
|
||||
<button type="button" class="btn btn-primary join-room">Join Room</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
13
client/templates/modal.handlebars
Normal file
13
client/templates/modal.handlebars
Normal file
@ -0,0 +1,13 @@
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each openDiscard.discard}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
13
client/templates/modal.medic.handlebars
Normal file
13
client/templates/modal.medic.handlebars
Normal file
@ -0,0 +1,13 @@
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Choose one card from your discard</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each medicDiscard.cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
6
client/templates/multipleCards.handlebars
Normal file
6
client/templates/multipleCards.handlebars
Normal file
@ -0,0 +1,6 @@
|
||||
{{#each this}}
|
||||
<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">
|
||||
{{#if boost}}<span>+{{boost}}</span>{{/if}}
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
1
client/templates/preview.handlebars
Normal file
1
client/templates/preview.handlebars
Normal file
@ -0,0 +1 @@
|
||||
<img src="{{src}}">
|
@ -5,6 +5,7 @@ var fs = require("fs");
|
||||
var babelify = require("babelify");
|
||||
var livereload = require("gulp-livereload");
|
||||
var sass = require("gulp-sass");
|
||||
var handlebars = require("browserify-handlebars");
|
||||
livereload({start: true});
|
||||
|
||||
//fast install
|
||||
@ -13,6 +14,7 @@ livereload({start: true});
|
||||
|
||||
gulp.task('browserify', function(){
|
||||
browserify('./client/js/main.js', {standalone: "app", debug: true})
|
||||
.transform(handlebars)
|
||||
.transform(babelify)
|
||||
.bundle().on("error", function(err){
|
||||
console.log(err);
|
||||
|
@ -16,6 +16,7 @@
|
||||
"devDependencies": {
|
||||
"babelify": "^6.1.2",
|
||||
"browserify": "^10.2.4",
|
||||
"browserify-handlebars": "^1.0.0",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-livereload": "^3.8.0",
|
||||
"gulp-sass": "^2.0.1",
|
||||
|
@ -9,245 +9,6 @@
|
||||
<script src="Config.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script id="info-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
{{#health}}
|
||||
{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="battle-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-3 left-side">
|
||||
<div class="col-xs-12 game-info game-info-foe foe">
|
||||
<div class="col-xs-12 info-name"></div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">0</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
<i class="ruby"></i>
|
||||
<i class="ruby"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 field field-weather">
|
||||
field
|
||||
</div>
|
||||
<div class="col-xs-12 game-info game-info-player player">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
{{#health lives}}{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<button class="button-pass">Pass</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 battleside battleside-foe foe">
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 mid-line"></div>
|
||||
<div class="col-xs-12 battleside battleside-player player">
|
||||
<div class="col-xs-2 field-horn field-horn-close">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.close}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-close"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-range">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-range"></div>
|
||||
</div>
|
||||
<div class="col-xs-2 field-horn field-horn-siege">
|
||||
</div>
|
||||
<div class="col-xs-10 field{{#if active.range}} active{{/if}}">
|
||||
<div class="col-xs-1 large-field-counter">0</div>
|
||||
<div class="col-xs-11 field-siege"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 field field-hand">
|
||||
{{#each cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src='../assets/cards/{{_data.img}}.png'>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<div class="col-xs-12 card-preview">
|
||||
<!--<img src="{{preview}}">-->
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-foe foe">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 right-side right-side-player player">
|
||||
<div class="col-xs-5 field-discard field-single">
|
||||
discard deck
|
||||
</div>
|
||||
<div class="col-xs-5 field-single field-deck pull-right">
|
||||
main deck
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="matchmaker-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Gwent</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<input type="text" class="name-input" value="{{name}}">
|
||||
<select id="deckChoice">
|
||||
<option value="northern_realm">Deck: Northern Realms</option>
|
||||
<option value="scoiatael">Deck: Scoia'tael</option>
|
||||
<option value="monster">Deck: Monster</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<button type="button" class="btn btn-primary create-room">Create Room</button>
|
||||
<button type="button" class="btn btn-primary join-room">Join Room</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script id="game-info-template" type="text/x-handlebars-template">
|
||||
<div class="col-xs-12 info-name">{{name}}</div>
|
||||
<div class="col-xs-6 field-single field-leader"></div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Points:</div>
|
||||
<div class="col-xs-6 score">{{score}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">Hand:</div>
|
||||
<div class="col-xs-6 hand-card">{{hand}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 gwent-lives">
|
||||
<!--<i class="ruby"></i>-->
|
||||
{{#health lives}}{{/health}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 passing">Passed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<button class="button-pass">Pass</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="modal-template">
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each openDiscard.discard}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="modal-medic-template">
|
||||
<div class="bbm-modal__topbar">
|
||||
<h3 class="bbm-modal__title">Choose one card from your discard</h3>
|
||||
</div>
|
||||
<div class="bbm-modal__section">
|
||||
{{#each medicDiscard.cards}}
|
||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
||||
<img src="../assets/cards/{{_data.img}}.png">
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="bbm-modal__bottombar">
|
||||
<div class="bbm-button bbm-close">close</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/template" id="preview-template">
|
||||
<img src="{{src}}">
|
||||
</script>
|
||||
<script src="build/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -61,9 +61,20 @@ var Battle = (function(){
|
||||
this.p2.setLeadercard();
|
||||
this.p1.draw(10);
|
||||
this.p2.draw(10);
|
||||
/*this.p1.hand.add(Card("commanders_horn"));
|
||||
this.p2.hand.add(Card("commanders_horn"));
|
||||
this.p1.hand.add(Card("milva"));
|
||||
this.p2.hand.add(Card("milva"));
|
||||
this.p1.hand.add(Card("havekar_healer"));
|
||||
this.p2.hand.add(Card("havekar_healer"));
|
||||
this.p1.hand.add(Card("toruviel"));
|
||||
this.p2.hand.add(Card("toruviel"));
|
||||
this.p1.hand.add(Card("vrihedd_brigade_recruit"));
|
||||
this.p2.hand.add(Card("vrihedd_brigade_recruit"));
|
||||
this.p1.hand.add(Card("impenetrable_fog"));
|
||||
this.p2.hand.add(Card("impenetrable_fog"));*/
|
||||
/*
|
||||
this.p1.hand.add(Card("commanders_horn"));
|
||||
this.p2.hand.add(Card("commanders_horn"));
|
||||
this.p1.hand.add(Card("commanders_horn"));
|
||||
this.p2.hand.add(Card("commanders_horn"));*/
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user