audio
This commit is contained in:
parent
8b3f700154
commit
d567cf2204
@ -89,6 +89,7 @@
|
|||||||
this.flippedTiles = 0;
|
this.flippedTiles = 0;
|
||||||
this.chosenLevel = "";
|
this.chosenLevel = "";
|
||||||
this.numMoves = 0;
|
this.numMoves = 0;
|
||||||
|
var dateDebut = new Date();
|
||||||
this._setupGameWrapper(level, nbcase, nbPartie);
|
this._setupGameWrapper(level, nbcase, nbPartie);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,10 +348,10 @@
|
|||||||
//http://translate.google.com/translate_tts?ie=UTF-8&q=bravo%2C%20tu%20as%20gagn%C3%A9&tl=fr
|
//http://translate.google.com/translate_tts?ie=UTF-8&q=bravo%2C%20tu%20as%20gagn%C3%A9&tl=fr
|
||||||
//http://translate.google.com/translate_tts?ie=UTF-8&q=bravo%2C%20tu%20as%20gagn%C3%A9&tl=fr&total=1&idx=0&textlen=18&client=t&prev=input
|
//http://translate.google.com/translate_tts?ie=UTF-8&q=bravo%2C%20tu%20as%20gagn%C3%A9&tl=fr&total=1&idx=0&textlen=18&client=t&prev=input
|
||||||
//une petite voix dit à l'utilisateur qu'il a gagné
|
//une petite voix dit à l'utilisateur qu'il a gagné
|
||||||
var audio = new Audio();
|
var temps = Math.ceil(((new Date()) - dateDebut)/60000);
|
||||||
var texte = 'http://translate.google.com/translate_tts?ie=UTF-8&q=bravo%2C%20tu%20as%20gagn%C3%A9&tl=fr';
|
var texteADire = (temps <= 1) ? "Bravo, tu as mis moins d'une minute." :
|
||||||
audio.src =texte;
|
"Bravo, tu as mis "+temps+" minutes. ";;
|
||||||
audio.play();
|
responsiveVoice.speak(texteADire, "French Female");
|
||||||
this.game.appendChild(this.gameMessages);
|
this.game.appendChild(this.gameMessages);
|
||||||
document.getElementById("mg__onend--restart").addEventListener( "click", function(e) {
|
document.getElementById("mg__onend--restart").addEventListener( "click", function(e) {
|
||||||
document.location.href="/memo";
|
document.location.href="/memo";
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('page-scripts')
|
@section('page-scripts')
|
||||||
|
|
||||||
|
<script src="/js/responsivevoice.js"></script>
|
||||||
<script src="/js/firework.js"></script>
|
<script src="/js/firework.js"></script>
|
||||||
|
|
||||||
<!--<script src="/js/fire-work.js"></script>-->
|
<!--<script src="/js/fire-work.js"></script>-->
|
||||||
|
Reference in New Issue
Block a user