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

Add sounds and hunglify

parent 981f7d0f
Pipeline #8845 passed with stages
in 1 minute and 23 seconds
......@@ -13,6 +13,7 @@
}
.btn {
transition: color 0.5s, opacity 0.5s;
margin: .5em;
}
.cnt {
position: relative;
......@@ -50,6 +51,10 @@
background: #ff0;
}
.center {
text-align: center;
}
</style>
<link rel="icon" type="image/png" href="/favicon.png" />
......@@ -67,7 +72,10 @@
</table>
</div>
</div>
<button id="vote" type="submit" class="btn btn-primary" disabled>Beküldés</button>
<div class="center">
<button id="vote" type="submit" class="btn btn-primary" disabled>Beküldés</button>
<button id="snd" type="submit" class="btn btn-primary">Nyomd meg, ha nincsenek hangok</button>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
......
let joinAttempts = 0
const startSound = new Audio('start.mp3')
const stopSound = new Audio('stop.mp3')
const sndBtn = document.getElementById("snd")
sndBtn.onclick = () => {
startSound.play()
stopSound.play()
sndBtn.style.display = "none"
}
function loginOrRegister(force){
if (joinAttempts > 5) {
throw lastError || "failed to join"
throw lastError || "nem sikerült csatlakozni"
}
joinAttempts++
......@@ -74,6 +83,7 @@ function doOnAllRadio(f) {
}
function start(){
startSound.play()
voteBtn.disabled = false
if (lastSent)
lastSent.style.background = ""
......@@ -84,11 +94,12 @@ function start(){
}
function stop(){
stopSound.play()
voteBtn.disabled = true
}
function connect(){
changeTeamName("Joining...")
changeTeamName("Csatlakozás...")
}
function handleResponse(action, response){
......@@ -162,7 +173,7 @@ function createSocket() {
sock.onclose = function () {
console.log('close');
changeTeamName("Disconnected, reconnecting...");
changeTeamName("Újracsatlakozás...");
sock.broken = true
intervalId = setInterval(() => {
createSocket()
......
File added
......@@ -106,7 +106,7 @@ func joinTeam(joinTeamId string, session sockjs.Session, teamId *string, userId
return
}
if name == "" {
handleError(session, errors.New("team does not exist"), false, "join")
handleError(session, errors.New("nincs ilyen csapat"), false, "join")
} else {
*teamId = joinTeamId
e = logic.JoinTeam(session.Context(), userId, *teamId)
......
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