fix
This commit is contained in:
parent
f57dcad25f
commit
6836da99a6
12
js/snake.js
12
js/snake.js
@ -94,14 +94,14 @@ $(document).ready(function () {
|
|||||||
if(localStorage.getItem("new_question") === null){
|
if(localStorage.getItem("new_question") === null){
|
||||||
localStorage.setItem('id_question', 0);
|
localStorage.setItem('id_question', 0);
|
||||||
localStorage.setItem("new_question",form);
|
localStorage.setItem("new_question",form);
|
||||||
alert('Dodano pytanie. Wciśnij Ok. Dodaj następne pytanie lub wciśnij F5 i graj');
|
alert('Dodano pytanie. Wcisnij Ok. Dodaj nastepne pytanie lub wcisnij F5 i graj');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
id_question = localStorage.getItem('id_question');
|
id_question = localStorage.getItem('id_question');
|
||||||
id_question++ ;
|
id_question++ ;
|
||||||
localStorage.setItem(`new_question-${id_question}`,form);
|
localStorage.setItem(`new_question-${id_question}`,form);
|
||||||
localStorage.setItem('id_question', id_question);
|
localStorage.setItem('id_question', id_question);
|
||||||
alert('Dodano pytanie. Wciśnij Ok. Dodaj następne pytanie lub wciśnij F5 i graj');
|
alert('Dodano pytanie. Wcisnij Ok. Dodaj nastepne pytanie lub wcisnij F5 i graj');
|
||||||
}
|
}
|
||||||
$(this).closest('form').find("input[type=text]").val("");
|
$(this).closest('form').find("input[type=text]").val("");
|
||||||
});
|
});
|
||||||
@ -128,7 +128,7 @@ $(document).ready(function () {
|
|||||||
$('#restart_game').click(function(){
|
$('#restart_game').click(function(){
|
||||||
setLifeCouter(3);
|
setLifeCouter(3);
|
||||||
setSessionScore(0);
|
setSessionScore(0);
|
||||||
alert('Zresetowałeś swoje życia, wciśnij Ok, a następnie F5 żeby zacząć od nowa');
|
alert('Zresetowales swoje zycia, wcisnij Ok, a nastepnie F5 zeby zaczac od nowa');
|
||||||
})
|
})
|
||||||
$('#add_question').click(function(){
|
$('#add_question').click(function(){
|
||||||
var isHidden = localStorage.getItem('isHidden');
|
var isHidden = localStorage.getItem('isHidden');
|
||||||
@ -153,7 +153,7 @@ $(document).ready(function () {
|
|||||||
$('#session').text(getSessionScore());
|
$('#session').text(getSessionScore());
|
||||||
$('#lifes').text(localStorage.getItem('life_couter'));
|
$('#lifes').text(localStorage.getItem('life_couter'));
|
||||||
if(localStorage.getItem('life_couter') == 0){
|
if(localStorage.getItem('life_couter') == 0){
|
||||||
alert(`Koniec gry! Twoj wynik to: ${localStorage.getItem('session_score')}. Jeżeli chcesz zagrać jeszcze raz wciśnij Ok, następnie Resetuj grę, poźniej F5`);
|
alert(`Koniec gry! Twoj wynik to: ${localStorage.getItem('session_score')}. Jezeli chcesz zagrac jeszcze raz wcisnij Ok, nastepnie Resetuj gre, pozniej F5`);
|
||||||
}
|
}
|
||||||
function update() {
|
function update() {
|
||||||
if (d == "RIGHT")
|
if (d == "RIGHT")
|
||||||
@ -224,7 +224,7 @@ $(document).ready(function () {
|
|||||||
var current = $('#current').text();
|
var current = $('#current').text();
|
||||||
$('#final').text(current);
|
$('#final').text(current);
|
||||||
if(randomQuestion === null){
|
if(randomQuestion === null){
|
||||||
alert('Pytania nie zostaly dodane. Wciśnij Ok, następnie F5 i dodaj pytania');
|
alert('Pytania nie zostaly dodane. Wcisnij Ok, nastepnie F5 i dodaj pytania');
|
||||||
}
|
}
|
||||||
randomYes();
|
randomYes();
|
||||||
addTextToAnserws(randomQuestion);
|
addTextToAnserws(randomQuestion);
|
||||||
@ -259,7 +259,7 @@ $(document).ready(function () {
|
|||||||
if($('.no').is(':checked')){
|
if($('.no').is(':checked')){
|
||||||
$('#incorrect').fadeIn('slow');
|
$('#incorrect').fadeIn('slow');
|
||||||
$('.yes').attr('disabled','disabled').delay(1000);;
|
$('.yes').attr('disabled','disabled').delay(1000);;
|
||||||
$('.no').prop('checked', true);
|
$('.no').attr('disabled', 'disabled');
|
||||||
$('#try_again').fadeIn('slow');
|
$('#try_again').fadeIn('slow');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -20,7 +20,7 @@ body {
|
|||||||
#add_question {
|
#add_question {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
top: 100px;
|
top: 100px;
|
||||||
left: 1750px;
|
left: 1500px;
|
||||||
}
|
}
|
||||||
#popup {
|
#popup {
|
||||||
background-color: rgba(0,0,0,.25);
|
background-color: rgba(0,0,0,.25);
|
||||||
@ -68,7 +68,7 @@ input[type="text"] {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
top: 20%;
|
top: 20%;
|
||||||
left: 40%;
|
left: 32.5%;
|
||||||
background-color: rgb(255,255,255);
|
background-color: rgb(255,255,255);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -80,7 +80,7 @@ input[type="text"] {
|
|||||||
#popup_question {
|
#popup_question {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
top: 150px;
|
top: 150px;
|
||||||
left: 1750px;
|
left: 1500px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: rgb(100, 219, 223);
|
color: rgb(100, 219, 223);
|
||||||
@ -232,4 +232,3 @@ a {
|
|||||||
position:relative;
|
position:relative;
|
||||||
top:1px;
|
top:1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
snake.html
10
snake.html
@ -11,7 +11,7 @@
|
|||||||
<button id="add_question">Dodaj pytanie!</button>
|
<button id="add_question">Dodaj pytanie!</button>
|
||||||
<form id='popup_question'>
|
<form id='popup_question'>
|
||||||
<input type="text" name="question" placeholder="Podaj pytanie"><br>
|
<input type="text" name="question" placeholder="Podaj pytanie"><br>
|
||||||
<input type="text" name="answer" placeholder="Podaj odpowiedz 1 (poprawną)"><br>
|
<input type="text" name="answer" placeholder="Podaj odpowiedz 1 (poprawna)"><br>
|
||||||
<input type="text" name="answer" placeholder="Podaj odpowiedz 2"><br>
|
<input type="text" name="answer" placeholder="Podaj odpowiedz 2"><br>
|
||||||
<input type="text" name="answer" placeholder="Podaj odpowiedz 3"><br>
|
<input type="text" name="answer" placeholder="Podaj odpowiedz 3"><br>
|
||||||
<input type="text" name="answer" placeholder="Podaj odpowiedz 4"><br>
|
<input type="text" name="answer" placeholder="Podaj odpowiedz 4"><br>
|
||||||
@ -36,8 +36,8 @@
|
|||||||
Twoj wynik to: <span id="final"></span><br>
|
Twoj wynik to: <span id="final"></span><br>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<button id="restart" href="#">Wyśnij, aby kontynuować</button>
|
<button id="restart" href="#">Wysnij, aby kontynuowac</button>
|
||||||
<button id="try_again" href="#">Spróbuj jeszcze raz</button>
|
<button id="try_again" href="#">Sprobuj jeszcze raz</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<canvas id="myCanvas" width="600" height="450">
|
<canvas id="myCanvas" width="600" height="450">
|
||||||
@ -45,9 +45,9 @@
|
|||||||
</canvas>
|
</canvas>
|
||||||
<div id="score">
|
<div id="score">
|
||||||
<div>Punkty: <span id="session">0</span></div>
|
<div>Punkty: <span id="session">0</span></div>
|
||||||
<div>Życia: <span id="lifes">4</span></div>
|
<div>Zycia: <span id="lifes">4</span></div>
|
||||||
</div>
|
</div>
|
||||||
<button id="restart_game">Resetuj grę</button>
|
<button id="restart_game">Resetuj gre</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Json
|
<!-- Json
|
||||||
<script src="js/pytania.json" type="text/javascript"></script> -->
|
<script src="js/pytania.json" type="text/javascript"></script> -->
|
||||||
|
Loading…
Reference in New Issue
Block a user