Commit b915be3e authored by Miklós Tóth's avatar Miklós Tóth 🤷
Browse files

Fronted fixes

parent 6788a937
Pipeline #8891 passed with stages
in 1 minute and 17 seconds
<html lang="hu">
<html lang="hu" class="bg-dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
......@@ -81,14 +81,16 @@
padding-right: 1em;
vertical-align: bottom;
}
.jumbotron {
background: #454d54;
}
</style>
<link rel="icon" type="image/png" href="/favicon.png" />
</head>
<body>
<body class="bg-dark text-white">
<main role="main" class="container">
<div class="jumbotron">
<div class="jumbotron text-white">
<table><tr><td><h1 id="teamName">Connecting...</h1></td><td><h3 id="score"></h3></td></tr></table>
<p class="lead">Tippeld meg, hogy melyik ablak villant fel!</p>
<div class="cnt">
......
let joinAttempts = 0
window.debug = false
function log(msg) {
if (debug) {
console.log(msg)
}
}
const startSound = new Audio('start.mp3')
const stopSound = new Audio('stop.mp3')
......@@ -19,7 +26,7 @@ function loginOrRegister(force){
let lastTeamId = localStorage.getItem("teamId");
let lastUserId = localStorage.getItem("userId");
if(!lastTeamId || teamId !== lastTeamId || force){
if(teamId.length !== 0 && (!lastTeamId || teamId !== lastTeamId || force)){
return {type: "team", id: teamId, cmd: "join"};
}
......@@ -32,7 +39,7 @@ function sendVote(){
let msg = { cmd: "vote", tip: selected };
msg = JSON.stringify(msg);
console.log(msg);
log(msg);
sock.send(msg);
......@@ -157,15 +164,15 @@ function createSocket() {
sock.onopen = function () {
sock.broken = false;
console.log('open');
log('open');
let msg = loginOrRegister();
msg = JSON.stringify(msg);
console.log(msg);
log(msg);
sock.send(msg);
};
sock.onmessage = function (e) {
console.log('message', e.data);
log('message', e.data);
let data = JSON.parse(e.data);
if (data.code < 300) {
......@@ -186,7 +193,7 @@ function createSocket() {
};
sock.onclose = function () {
console.log('close');
log('close');
changeTeamName("Újracsatlakozás...");
sock.broken = true
intervalId = setInterval(() => {
......@@ -240,3 +247,27 @@ function initBtns() {
}
}
initBtns()
console.log(`
.,-:;//;:=,
. :H@@@MM@M#H/.,+%;,
,/X+ +M@@M@MM%=,-%HMMM@X/,
-+@MM; $M@@MH+-,;XMMMM@MMMM@+-
;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/.
,%MM@@MH ,@%= .---=-=:=,.
=@#@@@MX ., -%HX$$%%%+;
=-./@M@M$ .;@MMMM@MM:
X@/ -$MM/ .+MM@@@M$
,@M@H: :@: . =X#@@@@-
,@@@MMX, . /H- ;@M@M=
.H@@@@M@+, %MM+..%#$.
/MMMM@MMH/. XM@MH; =;
/%+%$XHH@$= , .H@@@@MX,
.=--------. -%H.,@@@@@MX,
.%MM@@@HHHXX$$$%+- .:$MMX =M@@MM%.
=XMMM@MM@MM#H;,-+HMM@M+ /MMMX=
=%@M@M#@$-.=$@MM@@@M; %M%=
,:+$+-,/H#MMMMMMM@= =,
=++%%%%+/:-.
Made in Aperture Laboratories. 🤖
`)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment