modif memory
This commit is contained in:
parent
702d6eac8e
commit
eb3c3eb88a
@ -337,19 +337,39 @@
|
|||||||
* You won the game! This function runs the "onGameEnd" callback, which by
|
* You won the game! This function runs the "onGameEnd" callback, which by
|
||||||
* default clears the game div entirely and shows a "play again" button.
|
* default clears the game div entirely and shows a "play again" button.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
Memory.prototype._winGame = function() {
|
Memory.prototype._winGame = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (this.options.onGameEnd() === false) {
|
if (this.options.onGameEnd() === false) {
|
||||||
this._clearGame();
|
this._clearGame();
|
||||||
/* document.getElementById("win").addEventListener( "click", function(e) {
|
|
||||||
|
alert("zoro 2");
|
||||||
|
document.location.href="/memo";
|
||||||
self.resetGame();
|
self.resetGame();
|
||||||
});*/
|
|
||||||
} else {
|
} else {
|
||||||
// run callback
|
// run callback
|
||||||
this.options.onGameEnd();
|
this.options.onGameEnd();
|
||||||
|
//alert("coucou");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
Memory.prototype._winGame = function() {
|
||||||
|
var self = this;
|
||||||
|
if (this.options.onGameEnd() === false) {
|
||||||
|
this._clearGame();
|
||||||
|
this.gameMessages.innerHTML = '<h2 class="mg__onend--heading"><span class="icon-trophy"></span></h2>\
|
||||||
|
<p class="mg__onend--message">Vous avez gagné votre partie en ' + this.numMoves + ' coups !</p>\
|
||||||
|
<button id="mg__onend--restart" class="mg__button"><span class="icon-spinner11"></span></button>';
|
||||||
|
this.game.appendChild(this.gameMessages);
|
||||||
|
document.getElementById("mg__onend--restart").addEventListener( "click", function(e) {
|
||||||
|
document.location.href="/memo";
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// run callback
|
||||||
|
this.options.onGameEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memory resetGame
|
* Memory resetGame
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
@section('page-css')
|
@section('page-css')
|
||||||
<link rel="stylesheet" href="/css/memory.css">
|
<link rel="stylesheet" href="/css/memory.css">
|
||||||
|
<link rel="stylesheet" href="/css/fonts/style.css" type="text/css">
|
||||||
<style>
|
<style>
|
||||||
.mg__tile--inside {
|
.mg__tile--inside {
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
Reference in New Issue
Block a user