Fix images retour
This commit is contained in:
parent
63407ff378
commit
4915308709
@ -4,8 +4,7 @@
|
|||||||
@section('content')
|
@section('content')
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
|
|
||||||
<div id="imgRef" style="background-image:url('{{ $ref -> image }}');">
|
<div id="imgRef" style="background-image:url('{{ $ref -> image }}'); line-height:100px;font-weight:bold;">
|
||||||
<span id="decompte"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -31,20 +30,12 @@
|
|||||||
|
|
||||||
@section('page-scripts')
|
@section('page-scripts')
|
||||||
<script>
|
<script>
|
||||||
var redirect;
|
|
||||||
var i = 3;
|
var redirectTimer;
|
||||||
var timer = null;
|
|
||||||
function decompte() {
|
|
||||||
//on affiche i secondes
|
imgRef.innerHTML = ' ';
|
||||||
document.getElementById("decompte").innerHTML =+i.toString()+" secondes";
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
document.getElementById("decompte").innerHTML = "Redirection..."; // quand i atteint 0 on affiche redirection
|
|
||||||
location.href="{{URL::to('choisirref')}}"; // on redirige
|
|
||||||
clearInterval(timer); // on stop le timer
|
|
||||||
}
|
|
||||||
i = i - 1; //on decremente
|
|
||||||
}
|
|
||||||
|
|
||||||
function absorbEvent_(event) {
|
function absorbEvent_(event) {
|
||||||
var e = event || window.event;
|
var e = event || window.event;
|
||||||
@ -55,45 +46,26 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("click", function(event) {
|
function startCounter(event) {
|
||||||
absorbEvent_(event);
|
absorbEvent_(event);
|
||||||
return false;
|
imgRef.innerHTML = 3;
|
||||||
});
|
redirectTimer = setInterval(counter, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function counter() {
|
||||||
|
imgRef.innerHTML--;
|
||||||
|
if(imgRef.innerHTML == 0) location.href="{{URL::to('choisirref')}}";
|
||||||
|
}
|
||||||
|
|
||||||
|
function endCounter(event) {
|
||||||
|
imgRef.innerHTML = ' ';
|
||||||
|
clearInterval(redirectTimer);
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
document.getElementById('imgRef').addEventListener("mousedown", startCounter);
|
||||||
absorbEvent_(event);
|
document.getElementById('imgRef').addEventListener("touchstart", startCounter);
|
||||||
timer = setInterval(function(){ decompte() } , 1000); //intervalle, decompte de 1 secondes
|
window.addEventListener("mouseup", endCounter);
|
||||||
//redirect = setTimeout(function(){location.href="{{URL::to('choisirref')}}"}, 3000);
|
window.addEventListener("touchend", endCounter);
|
||||||
return false;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
|
||||||
clearTimeout(redirect);
|
|
||||||
document.getElementById("decompte").innerHTML =""; //on efface le contenu
|
|
||||||
i = 3; //on reset le compteur
|
|
||||||
clearInterval(timer); // on stop le decompte si on relache la souris
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Gestion du tactile, debut du toucher
|
|
||||||
document.getElementById('imgRef').addEventListener("touchstart", function(event) {
|
|
||||||
absorbEvent_(event);
|
|
||||||
timer = setInterval(function(){ decompte() } , 1000); //intervalle, decompte de 1 secondes
|
|
||||||
//redirect = setTimeout(function(){location.href="{{URL::to('choisirref')}}"}, 3000);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Gestion du tactile, fin du toucher
|
|
||||||
document.getElementById('imgRef').addEventListener("touchend", function() {
|
|
||||||
clearTimeout(redirect);
|
|
||||||
document.getElementById("decompte").innerHTML =""; //on efface le contenu
|
|
||||||
i = 3; //on reset le compteur
|
|
||||||
clearInterval(timer); // on stop le decompte si on relache la souris
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -63,15 +63,32 @@
|
|||||||
}
|
}
|
||||||
dateDebut = new Date();
|
dateDebut = new Date();
|
||||||
}
|
}
|
||||||
|
function drawGrid() {
|
||||||
|
pieces.forEach(function(item){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
var graphics = game.add.graphics(0, 0);
|
||||||
|
graphics.lineStyle(1, 0xff0000, 1);
|
||||||
|
graphics.moveTo(800, 0);
|
||||||
|
graphics.lineTo(100, 0);
|
||||||
|
}
|
||||||
function create () {
|
function create () {
|
||||||
var button = game.make.button(5, 5, 'previous', changePage, this, 2, 1, 0);
|
this.button3 = this.add.button(0, 0, 'previous', changePage);
|
||||||
game.physics.startSystem(Phaser.Physics.ARCADE);
|
this.button3.width = 50;
|
||||||
|
this.button3.height = 50;
|
||||||
|
|
||||||
|
this.physics.startSystem(Phaser.Physics.ARCADE);
|
||||||
createPiecesFor(1);
|
createPiecesFor(1);
|
||||||
}
|
}
|
||||||
function changePage() {
|
function changePage() {
|
||||||
|
if (confirm('Quitter le jeu ?')) {
|
||||||
alert("Confirmer ?");
|
location.href = "{{URL::to('/')}}";
|
||||||
|
} else {
|
||||||
|
// Do nothing!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function startDrag(elt) {
|
function startDrag(elt) {
|
||||||
elt.placed = false;
|
elt.placed = false;
|
||||||
|
@ -7,20 +7,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/1') }}'">
|
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/1') }}'">
|
||||||
<span style="color:gold;">
|
<span style="color:gold;"><span class="icon-star-full"></span></span><span class="icon-star-full"></span><span class="icon-star-full"></span></button>
|
||||||
<span class="icon-star-full"></span>
|
|
||||||
</span>
|
|
||||||
<span class="icon-star-full"></span>
|
|
||||||
<span class="icon-star-full"></span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/2') }}'"><span style="color:gold;"><span class="icon-star-full"></span><span class="icon-star-full"></span></span><span class="icon-star-full"></span></button>
|
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/2') }}'"><span style="color:gold;"><span class="icon-star-full"></span><span class="icon-star-full"></span></span><span class="icon-star-full"></span></button>
|
||||||
|
|
||||||
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/3') }}'"><span style="color:gold;"><span class="icon-star-full"></span><span class="icon-star-full"></span><span class="icon-star-full"></span></span></button>
|
<button class="level" onclick="location.href='{{ URL::to('puzzle/jouer/3') }}'"><span style="color:gold;"><span class="icon-star-full"></span><span class="icon-star-full"></span><span class="icon-star-full"></span></span></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: relative; left: 0; bottom: 400px; padding-left:1%; ">
|
<div style="position: fixed; left: 0;top:0;">
|
||||||
<a href="/"><img style="height: 80px;" src="{{ URL::to('imgs/previouspage.png') }}"/></a>
|
<a href="/"><img style="height: 50px; width:50px;" src="{{ URL::to('imgs/previouspage.png') }}"></a>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user