schweinchen and round added

This commit is contained in:
Susann Sgorzaly 2017-09-24 15:43:50 +02:00
parent bd14f4f158
commit 8066518093
4 changed files with 32 additions and 9 deletions

View File

@ -23,7 +23,9 @@
<hr id="DHR" style="margin:0px; width:100%; position:relative; top:3px; border-top:1px solid black;"> <hr id="DHR" style="margin:0px; width:100%; position:relative; top:3px; border-top:1px solid black;">
</div> </div>
<div class="bgColor textColor mainHight" style="display:none; position:relative; width: 1000px; margin: auto;" id="display"> <div class="bgColor textColor mainHight" style="display:none; position:relative; width: 1000px; margin: auto;" id="display">
<img id="schweinchenImg" style="margin-left: 200px; margin-top: 70px;" src="./img/schweinchen.jpg"> <img id="schweinchenImg" style="margin-left: 200px; margin-top: 70px; display: none;" src="./img/schweinchen.jpg">
<img id="schweinchen1Img" style="margin-left: 200px; margin-top: 70px; display: none;" src="./img/schweinchen1.jpg">
<img id="schweinchen2Img" style="margin-left: 200px; margin-top: 70px; display: none;" src="./img/schweinchen2.jpg">
<div id="displayQuestions" class="textColor"> <div id="displayQuestions" class="textColor">
</div> </div>
<div id="answers"> <div id="answers">
@ -88,7 +90,9 @@
<img width="20px;" src="./img/soundOn.png"> <img width="20px;" src="./img/soundOn.png">
</td> </td>
<td> <td>
<button id="startScheinchenbtn"><i class="fa fa-play"></i> Schweinchen</button><br> <button id="startScheinchenbtn" value="1"><i class="fa fa-play"></i> Schweinchen</button><br>
<button id="startScheinchenbtn2" value="2"><i class="fa fa-play"></i> Schweinchen (doppelte Punktzahl)</button><br>
<button id="startScheinchenbtn3" value="3"><i class="fa fa-play"></i> Schweinchen (dreifache Punktzahl)</button><br>
<button id="stopScheinchenbtn"><i class="fa fa-stop"></i> Schweinchen</button><br> <button id="stopScheinchenbtn"><i class="fa fa-stop"></i> Schweinchen</button><br>
<img width="20px;" src="./img/noSound.png"> <img width="20px;" src="./img/noSound.png">
<input id="schweinchenVolume" style="width: 50px;" type="range" value="10" name="points" min="0" max="10"> <input id="schweinchenVolume" style="width: 50px;" type="range" value="10" name="points" min="0" max="10">

BIN
web/img/schweinchen1.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
web/img/schweinchen2.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -38,14 +38,21 @@ $(document).ready(function() {
wsSend("setJeopardyVolume", v); wsSend("setJeopardyVolume", v);
}); });
$("#startScheinchenbtn").click(function() { $("button[id^='startScheinchenbtn']").each(function(){
$("#startScheinchenbtn").attr("disabled", "disabled"); $(this).click(function() {
wsSend("startSchweinchen", ""); var status = $(this).attr('value');
console.log('status' + status);
wsSend("setRunde", status);
$(this).attr("disabled", "disabled");
wsSend("startSchweinchen", "");
});
}); });
$("#stopScheinchenbtn").click(function() { $("#stopScheinchenbtn").click(function() {
$("#startScheinchenbtn").removeAttr("disabled"); $("button[id^='startScheinchenbtn']").each(function(){
wsSend("stopSchweinchen", ""); $(this).removeAttr("disabled");
});
wsSend("stopSchweinchen", "");
}); });
$("#schweinchenVolume").on("input", function() { $("#schweinchenVolume").on("input", function() {
@ -123,6 +130,9 @@ $(document).ready(function() {
}); });
function setRunde(value){
runde = value;
}
function showQuestionsAsPrint() { function showQuestionsAsPrint() {
var ges = '<h2 style="margin-left:30px;">Familienduell Fragen</h2><ol>'; var ges = '<h2 style="margin-left:30px;">Familienduell Fragen</h2><ol>';
for(var i=0;i<fragen.length;i++) { for(var i=0;i<fragen.length;i++) {
@ -165,7 +175,14 @@ function stopJeopardy() {
} }
function startSchweinchen() { function startSchweinchen() {
$("#schweinchenImg").show(); if (runde == 2){
$("#schweinchen2Img").show();
} else if (runde == 3){
$("#schweinchenImg").show();
} else {
$("#schweinchen1Img").show();
}
$("#answers").hide(); $("#answers").hide();
$("#displayQuestions").hide(); $("#displayQuestions").hide();
@ -182,6 +199,8 @@ function stopSchweinchen() {
changeFrage(); changeFrage();
$("#schweinchenImg").hide(); $("#schweinchenImg").hide();
$("#schweinchen1Img").hide();
$("#schweinchen2Img").hide();
$("#answers").show(); $("#answers").show();
$("#displayQuestions").show(); $("#displayQuestions").show();
if(schweinchen) { if(schweinchen) {