Created
August 7, 2019 03:57
-
-
Save parzibyte/2f224fcbe9c48e2b6d8344cd4e30941c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Método que muestra la alerta indicando que el jugador ha perdido; después | |
// de mostrarla, se reinicia el juego | |
indicarFracaso() { | |
Swal.fire({ | |
title: "Perdiste", | |
html: ` | |
<img class="img-fluid" src="./img/perdiste.png" alt="Perdiste"> | |
<p class="h4">Agotaste tus intentos</p>`, | |
confirmButtonText: "Jugar de nuevo", | |
allowOutsideClick: false, | |
allowEscapeKey: false, | |
}) | |
.then(this.reiniciarJuego) | |
}, | |
// Mostrar alerta de victoria y reiniciar juego | |
indicarVictoria() { | |
Swal.fire({ | |
title: "¡Ganaste!", | |
html: ` | |
<img class="img-fluid" src="./img/ganaste.png" alt="Ganaste"> | |
<p class="h4">Muy bien hecho</p>`, | |
confirmButtonText: "Jugar de nuevo", | |
allowOutsideClick: false, | |
allowEscapeKey: false, | |
}) | |
.then(this.reiniciarJuego) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment