Add files via upload

Grafische Überarbeitung, Erweiterung Finalmodus um Counter und Hinzufügen von unterstützenden Word- und Excel-Dateien
This commit is contained in:
ConvalAtGit 2019-01-02 02:24:11 +01:00 committed by GitHub
parent 9396a3317a
commit 4c0e89c90e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 355 additions and 123 deletions

BIN
Ablaufplan.doc Normal file

Binary file not shown.

BIN
Auswertung.xlsx Normal file

Binary file not shown.

Binary file not shown.

BIN
Fragen.doc Normal file

Binary file not shown.

BIN
Moderationskarten.doc Normal file

Binary file not shown.

BIN
Schilder.doc Normal file

Binary file not shown.

1
beispiel-fragen.txt Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
web/Familien-Duell.url Normal file
View File

@ -0,0 +1,2 @@
[InternetShortcut]
URL=http://127.0.0.1:8080/

View File

@ -1,11 +1,27 @@
body {
font-family: monospace;
background: url(../img/background.jpg) no-repeat;
background-position: center center;
background-attachment: fixed;
background-size: cover;
display: flex;
align-items: center; /* Vertikale Zentrierung */
justify-content: center; /* Horizontale Zentrierung */
}
#allContent {
position: relative;
}
.textColor {
color:#aeb130;
color:#ddff06;
font-weight:bold;
font-size: 1.5em;
}
.bgColor{
background:#525463;
background:#000000;
}
.antwortInp, .questionIn, .questionKIn {
@ -26,28 +42,93 @@
color:gray;
}
.xmarker {
font-family: Verdana, Helvetica, sans-serif;
font-weight: bold;
z-index: 3;
box-shadow: 3px 5px 35px rgba(0, 0, 0, 0.65);
border: 2px #595959 solid;
border-radius: 2px;
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.15), 1px 1px 1px rgba(255, 255, 255, 0.20);
font-size: 2em;
background: #595959;
height: 56px;
padding-left: 12px;
padding-right: 12px;
color: rgb(66, 66, 66);
/* box-shadow: 5px 5px 5px -1px rgba(0, 0, 0, 0.65), 0 5px 5px -5px rgba(0, 0, 0, 0.65); */
}
.noIntro {
display:none;
}
.footer {
background:#aeb130;
color:rgb(100, 100, 100);
background:#ddff06;
color: #000000;
}
#buttonsDownUnder {
background: #ffffff;
padding: 20px;
margin-top: 70px;
box-shadow: 3px 5px 35px rgba(0, 0, 0, 0.65);
}
#buttonsDownUnder td{
padding: 5px;
}
.mainHeight {
height: 530px;
position: relative;
width: 1020px;
height: 520px;
margin: auto;
margin-bottom: 50px;
z-index: 5;
border: 10px #c0c0c0 ridge;
border-radius: 2px;
box-shadow: 3px 5px 35px rgba(0, 0, 0, 0.65);
}
#timer {
background: #000000;
z-index: 5;
border: 10px #c0c0c0 ridge;
border-radius: 2px;
box-shadow: 3px 5px 35px rgba(0, 0, 0, 0.65);
}
#blackScreen {
z-index: 6;
}
#editQuestionsDiv {
border-radius: 2px;
z-index: 7;
}
#answers {
font-family: monospace;
padding-top: 55px;
padding-top: 58px;
padding-left: 18px;
font-size: 1.5em;
white-space: nowrap;
text-overflow: ellipsis;
}
.answer {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#displayQuestions {
position:absolute;
top:15px;
left:15px;
top:10px;
left:20px;
width: 970px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

BIN
web/img/background.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -12,16 +12,16 @@
<link rel="stylesheet" type="text/css" href="./css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./css/main.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body style="padding:10px;">
<div id="allContent">
<div id="startDiv" style="width: 500px; margin: auto;">
<h1 style="font-size: 5em;">Familien Duell</h1>
<h1 style="font-size: 5em;">Familienduell</h1>
<button id="displayBtn" style="font-size: 2em; width:500px;"><i class="fa fa-desktop"></i> DISPLAY</button><br>
<button id="controllerBtn" style="font-size: 2em; width:500px; margin-top:2px;"><i class="fa fa-keyboard-o"></i> CONTROLLER</button>
<hr id="DHR" style="margin:0px; width:100%; position:relative; top:3px; border-top:1px solid black;">
</div>
<div class="bgColor textColor mainHeight" style="display:none; position:relative; width: 1000px; margin: auto;" id="display">
<div class="bgColor textColor mainHeight" style="display:none" id="display">
<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">
@ -30,39 +30,31 @@
<div id="answers">
</div>
<div class="noIntro" id="result" style="position:absolute; bottom:115px; right:38px; font-size: 1.5em;">
<div id="result" style="position:absolute; bottom:65px; right:38px; font-size: 1.5em;">
<div style="float:left; padding-right: 20px;" class="header_summe">SUMME</div>
<div style="float:left; font-size: 0.8em; position: relative; top: 12; left:14px; color: red; cursor:pointer;" class="controller" id="pointsToTheLeft"><i class="fa fa-chevron-left"></i></div>
<div class="noIntro" style="width:50px; float: left; text-align:right;" id="SumRes">0</div>
<div style="float:left; font-size: 0.8em; position: relative; top: 12; color: red; cursor:pointer;" class="controller" id="pointsToTheRight"><i class="fa fa-chevron-right"></i></div>
</div>
<div class="noIntro" id="resultFinal" style="position:absolute; bottom:115px; right:465px; font-size: 1.5em; display: none;">
<div class="noIntro" style="width:50px; float: left; text-align:right;" id="SumRes_player1"></div>
<div class="noIntro" style="width:50px; float: left; text-align:right;" id="SumRes_player2"></div>
<div id="resultFinal" style="position:absolute; bottom:95px; right:444px; font-size: 1.5em; display: none;">
<div style="float:left" class="header_summe">SUMME</div>
<div class="noIntro" style="width:80px; float: left; text-align:right;" id="SumRes_player1"></div>
<div class="noIntro" style="width:80px; float: left; text-align:right;" id="SumRes_player2"></div>
</div>
<div class="noIntro footer" id="footer1" style="position:absolute; bottom:50px; width:100%; height:50px; font-size: 2em;">
<div style="position:absolute; left:5px; top: -5px;" class="pointsLeft">0</div>
<div style="position:absolute; right:5px; top: -5px;" class="pointsRight">0</div>
<div id="timer" style="position:absolute; top: 65px; left: 50%; width: 400px; margin-left: -200px; text-align: center; padding: 0px 30px 10px 30px; font-size: 200px; display: none;">
20
</div>
<div class="noIntro footer" id="footer1" style="position:absolute; bottom:0px; width:100%; height:50px; font-size: 2em;">
<div style="position:absolute; left:35px; top: -5px;" class="pointsLeft">0</div>
<div style="position:absolute; left:50%; width: 80px; margin-left: -40px; top: -5px; text-align: center" id="pointsCenter">0</div>
<div style="position:absolute; right:35px; top: -5px;" class="pointsRight">0</div>
</div>
<div class="noIntro footer" id="footer2" style="position:absolute; bottom:108px; width:100%; height:5px;"></div>
<div class="xmarker noIntro" style="position: absolute; bottom: 0px; left: 34; font-size: 2em; background: #525463; height: 50px; padding-left: 12px; padding-right: 12px; color: rgb(127, 115, 115);" ></div>
<div class="xmarker noIntro" style="position: absolute; bottom: 0px; right: 34; font-size: 2em; background: #525463; height: 50px; padding-left: 12px; padding-right: 12px; color: rgb(127, 115, 115);" ></div>
<img style="position: absolute; top: 0px;" class="intro mainHeight" src="./img/logo.png">
<!--<div class="noIntro footer" id="footer2" style="position:absolute; bottom:108px; width:100%; height:5px;"></div>-->
<div class="xmarker noIntro" style="position: absolute; bottom: -64px; left: 34px" ></div>
<div class="xmarker noIntro" style="position: absolute; bottom: -64px; right: 34px" ></div>
<img style="position: absolute; top: 0px;" class="intro" src="./img/logo.png">
</div>
<div style="display:none;" class="controller">
<div id="editQuestionsDiv" style="display:none; background: rgba(214, 205, 205, 0.95); padding-left:20px; position: absolute; top: 0px; width: 99%; min-height: 100%;">
<i id="closeFragenEditorIcon" style="position: fixed; right: 30px; top: 10px; font-size: 1.2em; cursor:pointer;" class="fa fa-caret-square-o-down"></i>
<h1 style="margin-left:50px;">Frageneditor</h1>
<div>
<ul id="fragenListe">
</ul>
</div>
<div >
<button style="margin-left:50px;" id="addNewQuestionBtn">Neue Frage hinzufügen!</button>
<button style="margin-left:50px; position:fixed; top: 10px; right: 100; font-size: 2em;" id="saveNewQuestions">Speichern!</button>
</div>
</div><br><br><br>
<div id="buttonsDownUnder">
<table border="1">
<tr>
@ -71,7 +63,7 @@
<td><b>Intro</b></td>
<td><b>Schweinchen</b></td>
<td><b>Optionen</b></td>
<td><b>Finalmodus</b> <input id="modeFinal" type="checkbox"> <button style="float:right;" id="finalmodusInfoBtn">Info</button></td>
<td><b><label for="modeFinal">Finalmodus</b> </label><input id="modeFinal" type="checkbox" style="vertical-align: text-bottom" /> <button style="float:right;" id="finalmodusInfoBtn">Info</button></td>
</tr>
<tr>
<td><img id="toggleSoundImg" style="cursor:pointer;" width="35px;" src="./img/soundOn.png"></td>
@ -82,7 +74,7 @@
<img width="20px;" src="./img/noSound.png">
<input id="introVolume" style="width: 50px;" type="range" value="10" name="points" min="0" max="10">
<img width="20px;" src="./img/soundOn.png"><br>
Blackscreen: <input id="blackScreenCheck" checked="checked" type="checkbox">
<label for="blackScreenCheck">Blackscreen:</label> <input id="blackScreenCheck" checked="checked" type="checkbox" style="vertical-align: text-bottom" />
</td>
<td>
Multiplikator: <input id="pointMultiplicator" type="number" name="" value="1" style="width: 50px;"><br>
@ -95,6 +87,7 @@
<img width="20px;" src="./img/soundOn.png">
</td>
<td>
<button id="startAnswerFailBtn"><i class="fa fa-play"></i> Antwort nicht vorhanden</button><br>
<button id="clearAllFailsBtn">Clear all Fails!</button><br><br>
<table>
<tr>
@ -106,30 +99,29 @@
</table>
</td>
<td>
<button id="startAnswerFailBtn"><i class="fa fa-play"></i> Antwort falsch</button><br>
<button id="startAnswerDuplicateBtn"><i class="fa fa-play"></i> Antwort doppelt</button><br>
<img width="20px;" src="./img/noSound.png">
<input id="answerFailVolume" style="width: 50px;" type="range" value="10" name="points" min="0" max="10">
<img width="20px;" src="./img/soundOn.png">
<div>
<lable>Spieler 1 (links): <input class="playerTgl finalElement" disabled="true" checked="true" type="radio" value="1" name="fmod"></lable><br>
<lable>Spieler 2 (rechts): <input class="playerTgl finalElement" disabled="true" type="radio" value="2" name="fmod"></lable><br>
Frage: <select class="finalElement" disabled="true" id="finalFragenSelect">
<label for="spieler1">Spieler 1:</label> <input class="playerTgl finalElement" disabled="true" checked="true" type="radio" value="1" name="fmod" id="spieler1" style="vertical-align: text-bottom" /> <button id="showTimerBtn" disabled="true" class="finalElement">Timer anzeigen</button><br>
<label for="spieler2">Spieler 2:</label> <input class="playerTgl finalElement" disabled="true" type="radio" value="2" name="fmod" id="spieler2" style="vertical-align: text-bottom" /> <button id="startTimerBtn" disabled="true" class="finalElement"><i class="fa fa-play"></i> Timer starten</button><br>
<label for="finalFragenSelect">Frage:</label> <select class="finalElement" disabled="true" id="finalFragenSelect">
<option value="0"> 1</option>
<option value="1"> 2</option>
<option value="2"> 3</option>
<option value="3"> 4</option>
<option value="4"> 5</option>
</select><br>
</select> <button id="stopTimerBtn" disabled="true" class="finalElement"><i class="fa fa-stop"></i> Timer stoppen</button><br>
Alternative Antwort:<br> <input class="finalElement" id="alternateAnswer" maxlength="20" disabled="true" type="text" name=""><button class="finalElement" id="alternateAnswerBtn" disabled="true">setzen</button><br><input type="number" class="finalElement" id="altPointsFinal" disabled="true" placeholder="Alt. Punkte" value=""><button class="finalElement" id="alternateAnswerPBtn" disabled="true">setzen</button>
</div>
</td>
</tr>
</table>
<br>
<table>
<tr>
<td><b>Fragenliste:</b><br>
<select style="min-width: 400px;" size="5" id="questionsSelcet">
<select style="min-width: 400px;" size="5" id="questionsSelect">
</select>
</td>
@ -144,12 +136,26 @@
</div>
</div>
<div id="editQuestionsDiv" style="display:none; background: rgba(205, 205, 205, 0.95); padding-left:20px; position: absolute; top: 0px; width: 100%; min-height: 100%;">
<h1 style="margin-left:50px;">Frageneditor</h1>
<div>
<ul id="fragenListe">
</ul>
</div>
<div >
<button style="margin-left:50px; margin-bottom: 50px;" id="addNewQuestionBtn">Neue Frage hinzufügen!</button>
<button style="margin-left:50px; position:fixed; top: 20px; right: 200px; font-size: 2em;" id="saveNewQuestions">Speichern!</button>
<button id="closeFragenEditorIcon" style="margin-left:50px; position:fixed; top: 20px; right: 30px; font-size: 2em;" id="saveNewQuestions">Schließen</button>
<!-- <i id="closeFragenEditorIcon" style="position: fixed; right: 30px; top: 10px; font-size: 1.2em; cursor:pointer;" class="fa fa-caret-square-o-down"></i> -->
</div>
</div>
<div id="notConnected" style="position:absolute; left:0px; top:0px; padding:5px;"><img width="50px" src="./img/notConnected.png"></div>
<div id="connected" style="position:absolute; left:0px; top:0px; padding:5px; display:none;"></div>
<div id="blackScreen" style="display:none; position:absolute; left:0px; top:0px; width:100%; height:100%; background:black;"></div>
</div>
<div id="printScreen" style="display:none; position:absolute; left:0px; top:0px; width:100%; height:100%; background:white;">
<div id="printDiv"></div>
</div>
<div id="blackScreen" style="display:none; position:absolute; left:0px; top:0px; width:100%; height:100%; background:black;"></div>
</body>
</html>

View File

@ -2,7 +2,8 @@ function init_xmarker() {
var c =0;
$.each($(".xmarker"), function() {
for(var i=0; i<3;i++) {
var span = $('<span class="marker'+(c)+'" style="cursor:pointer; position:relative; top:-5px; padding-right: 5px;">X</span>');
var span = $('<span class="marker'+(c)+'" style="cursor:pointer; position:relative; top:-5px; padding-left: 4px; padding-right: 4px">X</span>');
var span = $('<span class="marker'+(c)+'" style="cursor:pointer; position:relative; top:-5px; padding-left: 4px; padding-right: 4px">X</span>');
console.log("sow"+i);
(function() {

View File

@ -33,10 +33,26 @@ $(document).ready(function() {
wsSend("setPlayer2ForFinalMode", player);
});
$("#startAnswerFailBtn").click(function() {
$("#startAnswerFailBtn").click(function() {
wsSend("startAnswerFail", "");
});
$("#startAnswerDuplicateBtn").click(function() {
wsSend("startAnswerDuplicate", "");
});
$("#showTimerBtn").click(function() {
wsSend("showTimer", "");
});
$("#startTimerBtn").click(function() {
wsSend("startTimer", "");
});
$("#stopTimerBtn").click(function() {
wsSend("stopTimer", "");
});
$("#answerFailVolume").on("input", function() {
var v = parseFloat($(this).val()) / 10;
wsSend("setAnswerFailVolume", v);
@ -83,18 +99,36 @@ $(document).ready(function() {
});
$("#upQicon").click(function() {
var index = $("#questionsSelcet>option:selected").index();
var index = $("#questionsSelect>option:selected").index();
index--;
if (isFinalMode) {
var questionSelected = $("#finalFragenSelect").val();
questionSelected--;
if (questionSelected < 0) {
$("#finalFragenSelect").val(4);
} else {
$("#finalFragenSelect").val(questionSelected)
}
}
setFrageIndex(index);
});
$("#downQicon").click(function() {
var index = $("#questionsSelcet>option:selected").index();
var index = $("#questionsSelect>option:selected").index();
index++;
if (isFinalMode) {
var questionSelected = $("#finalFragenSelect").val();
questionSelected++;
if (questionSelected > 4) {
$("#finalFragenSelect").val(0);
} else {
$("#finalFragenSelect").val(questionSelected)
}
}
setFrageIndex(index);
});
$("#questionsSelcet").on("change", function() {
$("#questionsSelect").on("change", function() {
changeFrage();
});
@ -123,6 +157,7 @@ $(document).ready(function() {
var points = parseFloat($(".pointsRight").text()) + parseFloat($("#SumRes").text())*$("#pointMultiplicator").val();
wsSend("setRightPoints", points);
$("#SumRes").text("0");
$("#pointsCenter").text("0");
});
$("#newLeftPoints").click(function() {
@ -153,7 +188,7 @@ $(document).ready(function() {
function setFinalMode(status){
isFinalMode = status == "true" ? true : false;
$(".finalElement").attr("disabled", !isFinalMode);
var index = $("#questionsSelcet>option:selected").index();
var index = $("#questionsSelect>option:selected").index();
index = index > 0 ? index : 0;
$("#answers").empty();
loadQuestionToGui(index);
@ -180,6 +215,8 @@ function showQuestionsAsPrint() {
function setLeftPoints(newPoints) {
$(".pointsLeft").text(newPoints);
$("#mPunkteLeft").val(newPoints);
$("#sumRes").text("0");
$("#pointsCenter").text("0");
if(sounds && (display || serverSound)) {
audio = new Audio('./sounds/zahlRichtig.ogg');
audio.play();
@ -189,6 +226,8 @@ function setLeftPoints(newPoints) {
function setRightPoints(newPoints) {
$(".pointsRight").text(newPoints);
$("#mPunkteRight").val(newPoints);
$("#sumRes").text("0");
$("#pointsCenter").text("0");
if(sounds && (display || serverSound)) {
audio = new Audio('./sounds/zahlRichtig.ogg');
audio.play();
@ -196,20 +235,76 @@ function setRightPoints(newPoints) {
}
function startAnswerFail() {
if(sounds && (display || serverSound)) {
answerFail = new Audio('./sounds/failFinal.ogg');
if (sounds && (display || serverSound)) {
answerFail = new Audio('./sounds/failOriginal.ogg');
answerFail.volume = answerFailVolume;
answerFail.play();
}
}
function startAnswerDuplicate() {
if (sounds && (display || serverSound)) {
answerDuplicate = new Audio('./sounds/failFinal.ogg');
answerDuplicate.volume = answerFailVolume;
answerDuplicate.play();
}
}
function showTimer() {
if (display) {
if (player2) {
$("#timer").text("25");
} else {
$("#timer").text("20");
}
$("#timer").fadeIn();
}
}
function startTimer() {
if (display) {
var timer = parseInt($("#timer").text());
if ((timer == 20 && !player2) || (player2 && timer == 25)) {
if (sounds && (display || serverSound)) {
// window.document.timerTick = new Audio('./sounds/tick.ogg');
// window.document.timerTick.volume = answerFailVolume;
// window.document.timerTick.play();
}
window.document.timerId = setInterval(function() { startTimer(); }, 1000);
}
timer--;
if (timer > 0) {
$("#timer").text(timer);
} else {
clearInterval(window.document.timerId);
// window.document.timerTick.pause();
// window.document.timerTick.currentTime = 0;
$("#timer").fadeOut();
if (sounds && (display || serverSound)) {
timerEnd = new Audio('./sounds/failOriginal.ogg');
timerEnd.volume = answerFailVolume;
timerEnd.play();
}
}
}
}
function stopTimer() {
if (display) {
clearInterval(window.document.timerId);
// window.document.timerTick.pause();
// window.document.timerTick.currentTime = 0;
$("#timer").fadeOut();
}
}
function startSchweinchen() {
if (runde == 2){
$("#schweinchen2Img").show();
$("#schweinchen2Img").fadeIn();
} else if (runde == 3){
$("#schweinchenImg").show();
$("#schweinchenImg").fadeIn();
} else {
$("#schweinchen1Img").show();
$("#schweinchen1Img").fadeIn();
}
$("#answers").hide();
@ -223,8 +318,8 @@ function startSchweinchen() {
}
function stopSchweinchen() {
var index = $("#questionsSelcet>option:selected").index();
$("#questionsSelcet").val(index+1);
var index = $("#questionsSelect>option:selected").index();
$("#questionsSelect").val(index+1);
changeFrage();
$("#schweinchenImg").hide();
@ -239,10 +334,7 @@ function stopSchweinchen() {
function hideIntro() {
$(".noIntro").show();
$(".intro").hide();
if(!$("#modeFinal").is(":checked")) {
$("#resultFinal").hide();
}
$(".intro").fadeOut();
if(intro) {
intro.pause();
}
@ -250,7 +342,7 @@ function hideIntro() {
function showIntro() {
$(".noIntro").hide();
$(".intro").show();
$(".intro").fadeIn();
if(sounds && (display || serverSound)) {
intro = new Audio('./sounds/intro.ogg');
intro.volume = introVolume;
@ -259,25 +351,25 @@ function showIntro() {
}
function fillFragenSelect() {
$("#questionsSelcet").empty();
$("#questionsSelect").empty();
for(var i=0;i<fragen.length;i++) {
$("#questionsSelcet").append('<option value="'+i+'">'+fragen[i]["kuerzel"]+'</option>');
$("#questionsSelect").append('<option value="'+i+'">'+fragen[i]["kuerzel"]+'</option>');
}
}
function setFrageIndex(index) {
if(index >= 0 && index < $("#questionsSelcet").find("option").length) {
$("#questionsSelcet").find("option").removeAttr("selected");
$($("#questionsSelcet").find("option")[index]).prop("selected", "true");
if (index >= 0 && index < $("#questionsSelect").find("option").length) {
$("#questionsSelect").find("option").removeAttr("selected");
$($("#questionsSelect").find("option")[index]).prop("selected", "true");
}
if ($("#questionsSelect>option:selected").index() == -1 && $("#questionsSelect").find("option")[0]) {
$($("#questionsSelect").find("option")[0]).prop("selected", "true");
}
if($("#questionsSelcet>option:selected").index() == -1 && $("#questionsSelcet").find("option")[0] )
$($("#questionsSelcet").find("option")[0]).prop("selected", "true");
changeFrage();
}
function changeFrage() {
var index = $("#questionsSelcet>option:selected").index();
var index = $("#questionsSelect>option:selected").index();
wsSend("loadQuestion", index);
wsSend("clearAllFailsBtn", "");
}
@ -288,14 +380,15 @@ function loadQuestionToGui(index) {
$("#schweinchen2Img").hide();
$("#answers").empty();
$('.footer').toggle(!isFinalMode);
$('.xmarker').toggle(!isFinalMode);
$(".pointsLeft").toggle(!isFinalMode);
$(".pointsRight").toggle(!isFinalMode);
$(".xmarker").toggle(!isFinalMode);
$("#ResSum_player1").toggle(isFinalMode);
$("#ResSum_player2").toggle(isFinalMode);
if (!isFinalMode){
$("#resultFinal").hide();
} else {
if (isFinalMode){
$("#resultFinal").show();
} else {
$("#resultFinal").hide();
}
$("#result").toggle(!isFinalMode);
@ -306,33 +399,39 @@ function loadQuestionToGui(index) {
} else {
$("#displayQuestions").show();
}
var answerLength = isFinalMode&&display ? 5 : fragen[index]["antworten"].length;
for(var i=0;i<answerLength;i++) {
if(fragen[index]["antworten"][i]["antwort"] != "") {
if (!isFinalMode) {
var oneLine = $('<div style="height:55px">' +
'<div style="width: 52px; float: left;" class="nr">' + (i + 1) + '.</div>' +
'<div style="width: 860px; float: left;" class="answer"></div>' +
'<div style="width: 52px; float: left;" class="points"></div>' +
var anzahlFragen = fragen[index]["antworten"].length;
if (isFinalMode) {
anzahlFragen = 5;
}
for (var i = 0; i < anzahlFragen; i++) {
if(isFinalMode || fragen[index]["antworten"][i]["antwort"] != "") {
if (isFinalMode) {
var oneLine = $('<div style="height:55px">' +
'<div style="width: 400px; float: left; text-align: right" class="answer"></div>' +
'<div style="width: 40px; float: left; margin-left: 18px; margin-right: 20px; text-align: right" class="points"></div>' +
'<div style="width: 40px; float: left; margin-left: 20px; margin-right: 22px; text-align: right" class="points_player2"></div>' +
'<div style="width: 400px; float: left;" class="answer_player2"></div>' +
'</div>');
} else {
var oneLine = $('<div style="margin-left: 20px; height:55px">' +
'<div style="margin-left: 15px; width: 400px; float: left;" class="answer"></div>' +
'<div style="width: 52px; float: left;" class="points"></div>' +
'<div style="width: 65px; float: left;" class="points_player2"></div>' +
'<div style="width: 400px; float: left;" class="answer_player2"></div>' +
var oneLine = $('<div style="height:55px">' +
'<div style="margin-left: 18px; width: 50px; float: left;" class="nr">' + (i + 1) + '.</div>' +
'<div style="width: 824px; float: left" class="answer"></div>' +
'<div style="width: 52px; float: left; text-align: right" class="points"></div>' +
'</div>');
}
if(display && !player2) {
if (isFinalMode) {
oneLine.find(".answer").text("_ _ _ _ _ _ _ _ _ _ _");
// oneLine.find(".answer").text("_ _ _ _ _ _ _ _ _ _ _");
oneLine.find(".answer").text(".....................");
} else {
oneLine.find(".answer").text("_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _");
// oneLine.find(".answer").text("_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _");
oneLine.find(".answer").text("...............................................");
}
oneLine.find(".points").text("--");
if (isFinalMode){
oneLine.find(".points_player2").text("--");
oneLine.find(".answer_player2").text("_ _ _ _ _ _ _ _ _ _ _");
oneLine.find(".answer_player2").text(".....................");
// oneLine.find(".answer_player2").text("_ _ _ _ _ _ _ _ _ _ _");
}
} else if (!display) {
oneLine.find(".answer").html('<span class="markOnHover">'+getAnswerString(fragen[index]["antworten"][i]["antwort"])+'</span>');
@ -345,17 +444,13 @@ function loadQuestionToGui(index) {
if (isFinalMode){
is = $("#finalFragenSelect").val();
}
if($(this).find(".markOnHover").length>0) { //Dont send twice
wsSend("setAnswer", is+"###"+frage["antworten"][is2]["antwort"]);
}
wsSend("setAnswer", is+"###"+frage["antworten"][is2]["antwort"]);
});
oneLine.find(".points").click(function() {
if (isFinalMode){
is = $("#finalFragenSelect").val();
}
if($(this).find(".markOnHover").length>0) { //Dont send twice
wsSend("setAnz", is+"###"+frage["antworten"][is2]["anz"]);
}
wsSend("setAnz", is+"###"+frage["antworten"][is2]["anz"]);
});
})();
}
@ -388,17 +483,18 @@ function setAnswer(index, answer) {
}
answer = getAnswerString(answer);
var el = $($("#answers").find(answer_select)[index]);
el.empty();
//el.empty();
if(sounds && (display || serverSound)) {
audio = new Audio('./sounds/textRichtig.ogg');
audio.play();
}
el.typed({
strings: [answer],
typeSpeed: 1,
typeSpeed: 10,
overwrite: true,
showCursor: false,
cursorChar: "",
fadeOut: true,
fadeOut: false,
fadeOutDelay: 0,
});
}
@ -439,23 +535,34 @@ function recalcSum(s) {
});
$("#SumRes_player1").text(p1p);
$("#SumRes_player2").text(p2p);
if (display) {
$("#pointsCenter").text(p1p + p2p);
} else {
$("#pointsCenter").text("");
}
} else {
$(sum_selector).text(parseFloat($(sum_selector).text())+parseFloat(s));
$("#pointsCenter").text(parseFloat($(sum_selector).text())*runde);
}
}
function getAnswerString(str) {
var anz = str.length;
if(anz%2==0) {
str+="_";
}
anz = str.length;
var maxLength = 40;
if (isFinalMode){
maxLength = 20;
}
while(str.length < maxLength) {
str+= " _";
while(str.length < 21) {
if (player2){
str += " ";
} else {
str = " " + str;
}
}
if (player2){
str = str.replace(/ /g, "&nbsp;");
}
} else {
str += " ";
while(str.length < 47) {
str += ".";
}
}
return str;
}

View File

@ -139,6 +139,8 @@
// Check if there is some text in the element, if yes start by backspacing the default message
if (elContent.length == 0) {
self.typewrite(self.strings[self.sequence[self.arrayPos]], self.strPos);
} else if (self.options && self.options.overwrite) {
self.typewrite(self.strings[self.sequence[self.arrayPos]], self.strPos);
} else {
self.backspace(elContent, elContent.length);
}
@ -165,13 +167,17 @@
this.init();
},
// pass current string state to each function, types 1 char per call
typewrite: function(curString, curStrPos) {
// pass current string state to each function, types 1 char per call, if overwrite is true the existing string will be replaced char by char
typewrite: function(curString, curStrPos, curOverwritePos) {
// exit when stopped
if (this.stop === true) {
return;
}
if (!curOverwritePos) {
curOverwritePos = curStrPos;
}
if (this.fadeOut && this.el.classList.contains(this.fadeOutClass)) {
this.el.classList.remove(this.fadeOutClass);
this.cursor.classList.remove(this.fadeOutClass);
@ -263,6 +269,9 @@
// start typing each new char into existing string
// curString: arg, self.el.html: original text inside element
var nextString = curString.substr(0, curStrPos + 1);
if (self.options && self.options.overwrite) {
nextString += self.el.textContent.substr(curOverwritePos + 1);
}
if (self.attr) {
self.el.setAttribute(self.attr, nextString);
} else {
@ -277,8 +286,9 @@
// add characters one by one
curStrPos++;
curOverwritePos++;
// loop the function
self.typewrite(curString, curStrPos);
self.typewrite(curString, curStrPos, curOverwritePos);
}
// end of character pause
}, charPause);
@ -436,7 +446,9 @@
var self = this;
clearInterval(self.timeout);
var id = this.el.getAttribute('id');
this.el.textContent = '';
if (!self.options || !self.options.overwrite) {
this.el.textContent = '';
}
if (typeof this.cursor !== 'undefined' && typeof this.cursor.parentNode !== 'undefined') {
this.cursor.parentNode.removeChild(this.cursor);
}
@ -486,6 +498,8 @@
backSpeed: 0,
// shuffle the strings
shuffle: false,
// existing text will be overwritten instead of removing it first
overwrite: false,
// time before backspacing
backDelay: 500,
// Fade out instead of backspace

View File

@ -21,6 +21,13 @@ if(window.location.href.indexOf("viewonly")!==-1) {
$(document).ready(function() {
$("#displayBtn").click(function() {
if (this.requestFullScreen) {
this.requestFullScreen();
} else if (this.mozRequestFullScreen) {
this.mozRequestFullScreen();
} else if (this.webkitRequestFullScreen) {
this.webkitRequestFullScreen();
}
$("#startDiv").hide();
$("#display").show();
$(".controller").hide();
@ -92,18 +99,18 @@ var connectWs = function() {
var key = messageParts_a[0];
var value = messageParts_a[1];
if(key =="setFail") {
if($(".marker"+value).css("color") == "rgb(127, 115, 115)") {
if($(".marker"+value).css("color") == "rgb(66, 66, 66)") {
$(".marker"+value).css("color","rgb(211, 16, 16)");
if(sounds && (display || serverSound)) {
audio = new Audio('./sounds/fail.ogg');
audio = new Audio('./sounds/fail.mp3');
audio.play();
}
} else {
$(".marker"+value).css("color","rgb(127, 115, 115)");
$(".marker"+value).css("color","rgb(66, 66, 66)");
}
} else if(key == "clearAllFailsBtn") {
$.each($(".xmarker").find("span"), function() {
$(this).css("color","rgb(127, 115, 115)");
$(this).css("color","rgb(66, 66, 66)");
});
} else if(key == "toggleSound") {
if(sounds) {
@ -147,6 +154,14 @@ var connectWs = function() {
setRightPoints(value);
} else if(key == "startAnswerFail") {
startAnswerFail();
} else if(key == "startAnswerDuplicate") {
startAnswerDuplicate();
} else if(key == "showTimer") {
showTimer();
} else if(key == "startTimer") {
startTimer();
} else if(key == "stopTimer") {
stopTimer();
} else if(key == "setAnswerFailVolume") {
answerFailVolume = value;
if(answerFail != null)
@ -160,8 +175,13 @@ var connectWs = function() {
if(schweinchen != null)
schweinchen.volume = schweinchenVolume;
} else if(key == "toggleBlackScreen") {
if(display) {
$("#blackScreen").toggle();
if (display) {
if ($("#blackScreen").css("display") === "none") {
$("#blackScreen").fadeIn(500);
} else {
$("#blackScreen").fadeOut(6000);
}
// $("#blackScreen").toggle();
}
} else if (key == "toggleFinalMode"){
setFinalMode(value);

BIN
web/sounds/failOriginal.ogg Normal file

Binary file not shown.