From 9cebb7f6f0e7e249a9ef79e6ed719b6bb6f37c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Hu=CC=88llmandel?= Date: Wed, 21 Aug 2019 15:13:48 +0200 Subject: [PATCH] Add blind animations for pigs and questions (more authentic) --- web/js/main.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/web/js/main.js b/web/js/main.js index bb1869e..81d8e05 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -300,15 +300,17 @@ function stopTimer() { function startSchweinchen() { if (runde == 2){ - $("#schweinchen2Img").fadeIn(); + $("#schweinchen2Img").show("blind", { direction: "left" }, 1500); } else if (runde == 3){ - $("#schweinchenImg").fadeIn(); + $("#schweinchen3Img").show("blind", { direction: "left" }, 1500); } else { - $("#schweinchen1Img").fadeIn(); + $("#schweinchen1Img").show("blind", { direction: "left" }, 1500); } $("#answers").hide(); $("#displayQuestions").hide(); + $("#result").hide(); + $(".footer").hide(); if(sounds && (display || serverSound)) { schweinchen = new Audio('./sounds/schweinchen.ogg'); @@ -322,11 +324,11 @@ function stopSchweinchen() { $("#questionsSelect").val(index+1); changeFrage(); - $("#schweinchenImg").hide(); + $("#schweinchen3Img").hide(); $("#schweinchen1Img").hide(); $("#schweinchen2Img").hide(); - $("#answers").show(); - $("#displayQuestions").show(); + $("#result").show(); + $(".footer").show("blind", { direction: "left" }, 1500); if(schweinchen) { schweinchen.pause(); } @@ -375,7 +377,8 @@ function changeFrage() { } function loadQuestionToGui(index) { - $("#schweinchenImg").hide(); + console.log('oh noooo we are here'); + $("#schweinchen3Img").hide(); $("#schweinchen1Img").hide(); $("#schweinchen2Img").hide(); $("#answers").empty(); @@ -397,7 +400,7 @@ function loadQuestionToGui(index) { if (isFinalMode){ $("#displayQuestions").hide(); } else { - $("#displayQuestions").show(); + $("#displayQuestions").show("blind", { direction: "left" }, 1500); } var anzahlFragen = fragen[index]["antworten"].length; if (isFinalMode) { @@ -459,7 +462,8 @@ function loadQuestionToGui(index) { } } if (!isFinalMode) { - $("#SumRes").text("0"); + $("#SumRes").text("0"); + $("#answers").show("blind", { direction: "left" }, 1500); } if(!display) $("#resultFinal").hide();