1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-12-23 21:03:14 +00:00
This commit is contained in:
exane 2015-06-10 16:25:27 +02:00
commit 253f60d0ba
8 changed files with 6882 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules
.idea
build

48
gulpfile.js Normal file
View File

@ -0,0 +1,48 @@
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var fs = require("fs");
var babelify = require("babelify");
var livereload = require("gulp-livereload");
var sass = require("gulp-sass");
livereload({start: true});
//fast install
//npm i --save-dev browserify vinyl-source-stream babelify gulp-livereload gulp gulp-sass
gulp.task('browserify', function(){
browserify('./public/js/main.js', {standalone: "app", debug: true})
.transform(babelify)
.bundle().on("error", function(err){
console.log(err);
})
.pipe(source('app.js').on("error", function(err){
console.log(err);
}))
.pipe(gulp.dest('./build/').on("error", function(err){
console.log(err);
}));
});
gulp.task('sass', function(){
gulp.src('./public/scss/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on("error", function(err){
console.log(err);
}))
.pipe(gulp.dest('./build/').on("error", function(err){
console.log(err);
}))
.pipe(livereload().on("error", function(err){
console.log(err);
}));
});
gulp.task("watch", function(){
gulp.watch("./public/js/*", ["browserify"]);
gulp.watch("./public/scss/*", ["sass"]);
})
gulp.task("default", ["watch", "browserify", "sass"]);

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "gwent",
"version": "0.0.1",
"description": "",
"main": "gulpfile.js",
"dependencies": {
"babelify": "^6.1.2",
"backbone": "^1.2.1",
"browserify": "^10.2.4",
"gulp": "^3.9.0",
"gulp-livereload": "^3.8.0",
"gulp-sass": "^2.0.1",
"socket.io": "^1.3.5",
"vinyl-source-stream": "^1.1.0",
"socket.io-client": "^1.3.5"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "exane",
"license": "ISC"
}

6584
public/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

125
public/index.html Normal file
View File

@ -0,0 +1,125 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>Gwent</title>
<meta name="description" content="">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="../build/main.css">
</head>
<body>
<div class="container board">
<div class="col-xs-3 left-side">
<div class="col-xs-12 game-info game-info-enemy enemy">
<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"></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></i>
</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-enemy enemy">
<div class="col-xs-12 field">
<div class="col-xs-1 large-field-counter">0</div>
<div class="col-xs-11 field-siege"></div>
</div>
<div class="col-xs-12 field">
<div class="col-xs-1 large-field-counter">0</div>
<div class="col-xs-11 field-range"></div>
</div>
<div class="col-xs-12 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-12 field">
<div class="col-xs-1 large-field-counter">0</div>
<div class="col-xs-11 field-close"></div>
</div>
<div class="col-xs-12 field">
<div class="col-xs-1 large-field-counter">0</div>
<div class="col-xs-11 field-range"></div>
</div>
<div class="col-xs-12 field">
<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">
</div>
</div>
</div>
<div class="col-xs-3">
<div class="col-xs-12 card-preview"></div>
<div class="col-xs-12 right-side right-side-enemy enemy">
<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>
</div>
<script src="../build/app.js"></script>
</body>
</html>

3
public/js/main.js Normal file
View File

@ -0,0 +1,3 @@
(function main(){
})();

96
public/scss/main.scss Normal file
View File

@ -0,0 +1,96 @@
$height: 600px;
$game-height: 800px;
.board {
height: $game-height;
border: 1px solid black;
}
.battleside {
width: 100%;
height: $height/2;
border: 1px solid black;
}
.field {
width: 100%;
height: 100px;
border: 1px solid black;
}
.field:hover, .field-single:hover {
box-shadow: 0px 0px 10px #000;
}
.field-hand {
margin-top: 20px;
.card {
margin-left: -20px;
&:hover {
position: relative;
z-index: 10;
transform: scale(1.25,1.25);
}
}
}
.passing {
display: none;
}
.field-single {
border: 1px solid black;
height: 150px;
width: 85px;
margin: 5px;
}
.left-side {
//height: $game-height;
}
.game-info {
height: $game-height/2 - 100px;
width: 100%;
border: 1px solid black;
}
.mid-line {
width: 100%;
height: 1px;
border: 1px solid black;
margin: 5px;
}
.right-side {
border: 1px solid black;
height: $game-height/2;
}
.card {
border: 2px solid black;
float: left;
margin: 3px;
height: 90px;
overflow: hidden;
img {
height: 120px;
}
}
.card-preview {
position: absolute;
display: none;
z-index: 10;
}
i {
display: block;
float: left;
height: 40px;
width: 40px;
background: url("../../assets/ruby-grey.png");
&.ruby {
background: url("../../assets/ruby.png");
}
}

0
server/server.js Normal file
View File