mirror of
https://github.com/exane/not-gwent-online
synced 2024-11-23 19:36:53 +00:00
add proper templates
This commit is contained in:
parent
16dfa9f2b2
commit
63320bad55
@ -9,245 +9,6 @@
|
|||||||
<script src="Config.js"></script>
|
<script src="Config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
<script src="build/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,19 +8,6 @@ var $ = require("jquery");
|
|||||||
|
|
||||||
window.$ = $;
|
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({
|
var App = Backbone.Router.extend({
|
||||||
routes: {
|
routes: {
|
||||||
"lobby": "lobbyRoute",
|
"lobby": "lobbyRoute",
|
||||||
@ -90,15 +77,8 @@ var App = Backbone.Router.extend({
|
|||||||
|
|
||||||
var SideView = Backbone.View.extend({
|
var SideView = Backbone.View.extend({
|
||||||
el: ".container",
|
el: ".container",
|
||||||
template: Handlebars.compile('<div class="card{{#if _disabled}} disabled{{/if}}" data-key="{{_key}}" data-id="{{_id}}">' +
|
template: require("../templates/cards.handlebars"),
|
||||||
'<img src="../assets/cards/{{_data.img}}.png">' +
|
templateCards: require("../templates/multipleCards.handlebars"),
|
||||||
'</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}}'),
|
|
||||||
initialize: function(options){
|
initialize: function(options){
|
||||||
var self = this;
|
var self = this;
|
||||||
this.side = options.side;
|
this.side = options.side;
|
||||||
@ -231,8 +211,8 @@ var calculateCardMargin = function($selector, totalWidth, cardWidth, n){
|
|||||||
|
|
||||||
var BattleView = Backbone.View.extend({
|
var BattleView = Backbone.View.extend({
|
||||||
className: "container",
|
className: "container",
|
||||||
template: Handlebars.compile($("#battle-template").html()),
|
template: require("../templates/battle.handlebars"),
|
||||||
templatePreview: Handlebars.compile($("#preview-template").html()),
|
templatePreview: require("../templates/preview.handlebars"),
|
||||||
initialize: function(options){
|
initialize: function(options){
|
||||||
var self = this;
|
var self = this;
|
||||||
var user = this.user = options.user;
|
var user = this.user = options.user;
|
||||||
@ -481,7 +461,7 @@ var BattleView = Backbone.View.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var Modal = Backbone.Modal.extend({
|
var Modal = Backbone.Modal.extend({
|
||||||
template: Handlebars.compile($("#modal-template").html()),
|
template: require("../templates/modal.handlebars"),
|
||||||
cancelEl: ".bbm-close",
|
cancelEl: ".bbm-close",
|
||||||
cancel: function(){
|
cancel: function(){
|
||||||
this.model.set("openDiscard", false);
|
this.model.set("openDiscard", false);
|
||||||
@ -489,7 +469,7 @@ var Modal = Backbone.Modal.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var MedicModal = Modal.extend({
|
var MedicModal = Modal.extend({
|
||||||
template: Handlebars.compile($("#modal-medic-template").html()),
|
template: require("../templates/modal.medic.handlebars"),
|
||||||
events: {
|
events: {
|
||||||
"click .card": "onCardClick"
|
"click .card": "onCardClick"
|
||||||
},
|
},
|
||||||
@ -608,7 +588,7 @@ var Lobby = Backbone.View.extend({
|
|||||||
},
|
},
|
||||||
className: "container",
|
className: "container",
|
||||||
|
|
||||||
template: Handlebars.compile($("#matchmaker-template").html()),
|
template: require("../templates/lobby.handlebars"),
|
||||||
initialize: function(options){
|
initialize: function(options){
|
||||||
this.user = options.user;
|
this.user = options.user;
|
||||||
this.app = options.app;
|
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 babelify = require("babelify");
|
||||||
var livereload = require("gulp-livereload");
|
var livereload = require("gulp-livereload");
|
||||||
var sass = require("gulp-sass");
|
var sass = require("gulp-sass");
|
||||||
|
var handlebars = require("browserify-handlebars");
|
||||||
livereload({start: true});
|
livereload({start: true});
|
||||||
|
|
||||||
//fast install
|
//fast install
|
||||||
@ -13,6 +14,7 @@ livereload({start: true});
|
|||||||
|
|
||||||
gulp.task('browserify', function(){
|
gulp.task('browserify', function(){
|
||||||
browserify('./client/js/main.js', {standalone: "app", debug: true})
|
browserify('./client/js/main.js', {standalone: "app", debug: true})
|
||||||
|
.transform(handlebars)
|
||||||
.transform(babelify)
|
.transform(babelify)
|
||||||
.bundle().on("error", function(err){
|
.bundle().on("error", function(err){
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babelify": "^6.1.2",
|
"babelify": "^6.1.2",
|
||||||
"browserify": "^10.2.4",
|
"browserify": "^10.2.4",
|
||||||
|
"browserify-handlebars": "^1.0.0",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
"gulp-livereload": "^3.8.0",
|
"gulp-livereload": "^3.8.0",
|
||||||
"gulp-sass": "^2.0.1",
|
"gulp-sass": "^2.0.1",
|
||||||
|
@ -9,245 +9,6 @@
|
|||||||
<script src="Config.js"></script>
|
<script src="Config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
<script src="build/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -61,9 +61,20 @@ var Battle = (function(){
|
|||||||
this.p2.setLeadercard();
|
this.p2.setLeadercard();
|
||||||
this.p1.draw(10);
|
this.p1.draw(10);
|
||||||
this.p2.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.p1.hand.add(Card("commanders_horn"));
|
||||||
this.p2.hand.add(Card("commanders_horn"));
|
|
||||||
this.p1.hand.add(Card("commanders_horn"));
|
this.p1.hand.add(Card("commanders_horn"));
|
||||||
this.p2.hand.add(Card("commanders_horn"));*/
|
this.p2.hand.add(Card("commanders_horn"));*/
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user