diff --git a/client/client_recv.js b/client/client_recv.js index 9a0c533..3d445a0 100644 --- a/client/client_recv.js +++ b/client/client_recv.js @@ -304,8 +304,10 @@ async function handle_message(state, context, d) { switch (message_type) { case MESSAGE.JOIN: case MESSAGE.INIT: { - state.server_lsn = des_u32(d); + console.time('init'); + state.online = true; + state.server_lsn = des_u32(d); if (state.server_lsn > state.lsn) { // Server knows something that we don't @@ -359,6 +361,8 @@ async function handle_message(state, context, d) { send_ack(event_count); sync_queue(state); + console.timeEnd('init'); + break; } diff --git a/client/default.css b/client/default.css index 5dba991..ebe2eaf 100644 --- a/client/default.css +++ b/client/default.css @@ -295,3 +295,20 @@ input[type=range]::-moz-range-track { body.offline * { pointer-events: none; } + +.loader { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 128px; + height: 128px; + pointer-events: none; + background: rgba(0, 0, 0, 0.8); + border-radius: 10px; + transition: opacity .2s; +} + +.loader.hidden { + opacity: 0; +} \ No newline at end of file diff --git a/client/index.html b/client/index.html index 2d04c31..ff4c8d5 100644 --- a/client/index.html +++ b/client/index.html @@ -7,20 +7,20 @@ - + - - - - - - - - + + + + + + + + - - - + + +