1
0
mirror of https://github.com/exane/not-gwent-online synced 2025-09-02 14:07:31 +00:00

prepare vue and little styling

This commit is contained in:
devfake
2015-06-21 13:09:29 +02:00
parent c29e398eb7
commit 9d7f473e76
18 changed files with 149 additions and 68 deletions

24
site/client/app/app.js Normal file
View File

@@ -0,0 +1,24 @@
var Vue = require('vue');
var router = require('./routes');
Vue.use(require('vue-resource'));
Vue.http.headers.common['X-CSRF-TOKEN'] = $('.token').attr('content');
var app = new Vue({
el: 'body',
data: {
name: '',
view: '',
section: ''
},
components: {
'landing': require('./components/landing'),
'lobby': require('./components/lobby')
}
});
router.init(app);

View File

@@ -0,0 +1,11 @@
module.exports = {
template: require('../views/landing.html'),
ready: function() {
setTimeout(function() {
$('.container-form-landing').addClass('active')
}, 400);
}
};

View File

@@ -0,0 +1,5 @@
module.exports = {
template: require('../views/lobby.html')
};

28
site/client/app/routes.js Normal file
View File

@@ -0,0 +1,28 @@
var Router = require('director').Router;
var router = new Router();
module.exports = {
init: function(app) {
router.on('/', function() {
app.view = 'landing';
app.section = 'landing';
});
router.on('/lobby', function() {
app.view = 'lobby';
app.section = 'inner';
});
this.configure();
router.init('/');
},
configure: function() {
router.configure({
notfound: function() {
router.setRoute('/')
}
})
}
}

View File

@@ -0,0 +1,29 @@
<section class="container-landing" id="lol">
<div class="wrap-landing">
<img src="assets/img/logo-big.png" width="243" height="85" alt="Gwent" class="logo-big">
<p class="teaser-landing">
Play The Witcher Gwent Card-Game online!<br>
Play with randomly generated teams, or build your own!
</p>
<div class="container-form-landing">
<form class="form-session">
<input type="text" placeholder="Username" class="field-session" autofocus>
<input type="password" placeholder="Password" class="field-session">
<div class="wrap-btn-action btn-register-action">
<input type="submit" value="Register" class="btn-action">
<i class="icon-load"></i>
</div>
</form>
<span class="choose">or</span>
<a href="#/lobby" class="btn-second btn-guest">Play as guest</a>
<a href="#" class="btn-none btn-login">Login</a>
</div>
</div>
</section>

View File

@@ -0,0 +1 @@
LOBBY HIER BLA BLA