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:
24
site/client/app/app.js
Normal file
24
site/client/app/app.js
Normal 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);
|
11
site/client/app/components/landing.js
Normal file
11
site/client/app/components/landing.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
|
||||
template: require('../views/landing.html'),
|
||||
|
||||
ready: function() {
|
||||
setTimeout(function() {
|
||||
$('.container-form-landing').addClass('active')
|
||||
}, 400);
|
||||
}
|
||||
|
||||
};
|
5
site/client/app/components/lobby.js
Normal file
5
site/client/app/components/lobby.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
|
||||
template: require('../views/lobby.html')
|
||||
|
||||
};
|
28
site/client/app/routes.js
Normal file
28
site/client/app/routes.js
Normal 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('/')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
29
site/client/app/views/landing.html
Normal file
29
site/client/app/views/landing.html
Normal 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>
|
1
site/client/app/views/lobby.html
Normal file
1
site/client/app/views/lobby.html
Normal file
@@ -0,0 +1 @@
|
||||
LOBBY HIER BLA BLA
|
Reference in New Issue
Block a user