lobby redirection screen

pull/4065/head
Thibault Duplessis 2018-02-24 18:07:18 -06:00
parent 5e9cbe79b1
commit 7a3fb0c92c
4 changed files with 19 additions and 5 deletions

View File

@ -373,6 +373,15 @@ body.dark #hooks_wrap .hook_filter {
#hook span {
display: block;
}
#hooks_wrap .redir {
background: rgba(128,128,128,0.5);
display: flex;
}
#hooks_wrap .redir .spinner {
width: 100px;
height: 100px;
}
/*********** POOLS *********/
#hooks_wrap .pools {

View File

@ -215,7 +215,11 @@ export default class LobbyController {
setRedirecting = () => {
this.redirecting = true;
setTimeout(() => this.redirecting = false, 2000);
setTimeout(() => {
this.redirecting = false;
this.redraw();
}, 3000);
this.redraw();
};
awake = () => {

View File

@ -5,12 +5,14 @@ import * as renderPools from './pools';
import renderRealTime from './realTime/main';
import renderSeeks from './correspondence';
import renderPlaying from './playing';
import { spinner } from './util';
import LobbyController from '../ctrl';
export default function(ctrl: LobbyController) {
let body, data: VNodeData = {};
if (ctrl.playban || ctrl.currentGame) return h('div#hooks_wrap');
switch (ctrl.tab) {
if (ctrl.redirecting) body = spinner();
else switch (ctrl.tab) {
case 'pools':
body = renderPools.render(ctrl);
data = { hook: renderPools.hooks(ctrl) };
@ -25,9 +27,8 @@ export default function(ctrl: LobbyController) {
body = renderPlaying(ctrl);
break;
}
console.log(data);
return h('div#hooks_wrap', [
h('div.tabs', renderTabs(ctrl)),
h('div.lobby_box.' + ctrl.tab, data, body)
h('div.lobby_box.' + (ctrl.redirecting ? 'redir' : ctrl.tab), data, body)
]);
};

View File

@ -12,7 +12,7 @@ export function hooks(ctrl: LobbyController): Hooks {
const id = (e.target as HTMLElement).getAttribute('data-id') ||
((e.target as HTMLElement).parentNode as HTMLElement).getAttribute('data-id');
if (id === 'custom') $('#start_buttons .config_hook').mousedown();
else id && ctrl.clickPool(id);
else if (id) ctrl.clickPool(id);
}, ctrl.redraw);
}