</div>
</div>
</div>
- <div class="column overlap-bottom relative slide-mask">
+ <div class="column overlap-bottom relative">
+ <div class="slide-mask">
<div class="bg-image h-full bg-cover bg-no-repeat slide-img">
<!--<div class="bg-image-sizer" style="padding-bottom: 110.417%;">-->
<img class="img-slider" src="https://staging.pm-instrumentation.com/storage/uploads/images/home-car.jpg" alt="">
<!--</div>-->
</div>
</div>
+ </div>
</div>
<!-- hidden content-->
</div>
</div>
</div>
- <div class="column overlap-bottom relative slide-mask">
+ <div class="column overlap-bottom relative">
+ <div class="slide-mask">
<div class="bg-image h-full bg-cover bg-no-repeat slide-img">
<!--<div class="bg-image-sizer" style="padding-bottom: 110.417%;">-->
<img class="img-slider" src="https://www.sciencesetavenir.fr/assets/img/2019/04/10/cover-r4x3w1000-5cadebdd93968-trou-noir-galaxie.jpg" alt="">
<!--</div>-->
</div>
+ </div>
</div>
</div>
</div>
</div>
</div>
- <div class="column overlap-bottom relative slide-mask">
+ <div class="column overlap-bottom relative">
+ <div class="slide-mask">
<div class="bg-image h-full bg-cover bg-no-repeat slide-img">
<!--<div class="bg-image-sizer" style="padding-bottom: 110.417%;">-->
<img class="img-slider" src="https://staging.pm-instrumentation.com/storage/uploads/images/home-car.jpg" alt="">
- <!--</div>-->
+ </div>
</div>
</div>
</div>
</div>
</div>
</div>
- <div class="column overlap-bottom relative slide-mask">
+ <div class="column overlap-bottom relative">
+ <div class="slide-mask">
<div class="bg-image h-full bg-cover bg-no-repeat slide-img">
<!--<div class="bg-image-sizer" style="padding-bottom: 110.417%;">-->
<img class="img-slider" src="https://www.w3schools.com/w3css/img_lights.jpg" alt="">
- <!--</div>--->
+ </div>-
</div>
+
</div>
</div>
+
+ <div class="slider-indicator">
+ <ul class="pl-2v">
+ <li class="slider-position active-indicator"></li>
+ <li class="slider-position"></li>
+ <li class="slider-position"></li>
+ <li class="slider-position"></li>
+ </ul>
+ </div>
</div>
</div>
let delayBetweenAnim = 2000; // delay entre chaque slide
let mouvement = 0; // valeur en px du déplacement des blocks
+let pending = false;
+
let width = $('.slide-img').width(),
height = $('.slide-img').height(),
+ imgWidth =$('.img-slider').width(),
init = 'rect(0px ',
final = 'px 0px)';
function GotoSlide(nextindex, direction){
let currentSlideIndex = $('.slide').eq(index),
- nextSlideIndex = $('.slide').eq(nextindex),
+ nextSlideIndex = $('.slide').eq(nextindex),
currentText = $('.slide-txt').eq(index),
nextText = $('.slide-txt').eq(nextindex),
- currentImg = $('.img-slider').eq(index);
+ currentImg = $('.img-slider').eq(index),
+ currentContainerImg = $('.slide-img').eq(index),
+ currentIndicatorIndex = $('.slider-position').eq(index),
+ nextIndicatorIndex = $('.slider-position').eq(nextindex),
+ nextContainerImg = $('.slide-img').eq(nextindex);
console.log(nextindex, direction);
TweenMax.set('.img-slider',{clip:init + width +'px '+ height+ final, ease: Power3.easeOut});
let tl = new TimelineMax();
+ tl.set(currentSlideIndex,{zIndex: 97});
+ tl.set(nextText,{opacity:1,x:0});
+ tl.to(currentText,0.5,{x:-50*direction,opacity:0});
+
+ // tl.to(currentImg,2,{clip:init +width*(direction)*-1 +'px '+ height+ 'px'+ '-'+imgWidth+'px', ease: Power2.easeInOut,},"-=0.8");
+
+ if(direction === -1){
+ tl.to(currentImg,2,{ clip: init+ imgWidth+'px,'+ height+'px,'+ imgWidth+'px', ease: Power2.easeInOut }, "-=0.8");
+ }else{
+ tl.to(currentImg,2,{ clip: init+ '-'+imgWidth+'px,'+ height+'px,'+ '-'+imgWidth+'px', ease: Power2.easeInOut }, "-=0.8");
+ }
+
+ tl.from(nextText,0.5,{x:80*direction,opacity:0},'-=1.4');
+ tl.from(nextContainerImg,0.8,{x:150*direction,ease: Power2.easeInOut},'-=1.8');
+ tl.to(currentContainerImg,0.8,{x:-250*direction,ease: Power2.easeInOut},"-=1.8");
- tl.set(currentText,{opacity:1});
- tl.to(currentText,1,{x:-200,opacity:0});
- tl.set(currentSlideIndex,{zIndex: 999});
- tl.set(nextText,{opacity:0});
- tl.to(currentImg,1,{clip:init + '-'+width +'px '+ height+ final, ease: Power1.easeIn},'-=0.5');
- tl.from(nextText,1,{x:200,opacity:0},'-=0.5');
- tl.set(currentText,{opacity:1,x:0});
tl.set(currentSlideIndex,{zIndex: 0});
+ // tl.set(nextContainerImg,{x: 0});
+ tl.set(currentContainerImg,{x:0});
+
+
+ // tl.set(currentText,{opacity:1});
+ // tl.to(currentText,1,{x:-200,opacity:0});
+ // tl.set(currentSlideIndex,{zIndex: 999});
+ // tl.set(nextText,{opacity:0});
+ // tl.to(currentImg,1,{clip:init + '-'+width +'px '+ height+ final, ease: Power1.easeIn},'-=0.5');
+ // tl.from(nextText,1,{x:200,opacity:0},'-=0.5');
+ // tl.set(currentText,{opacity:1,x:0});
+ // tl.set(currentSlideIndex,{zIndex: 0});
+
+
+ nextIndicatorIndex.addClass('active-indicator').eq(nextindex);
+ currentIndicatorIndex.removeClass('active-indicator').eq(index);
setTimeout(function () {
nextSlideIndex.addClass('active').eq(nextindex);
- },1000);
+ });
setTimeout(function () {
currentSlideIndex.removeClass('active').eq(index);
- },2000);
+ },1000);
index=nextindex;
}
direction = 1;
}
else{
- direction=-1
+ direction=-1;
}
let nextindex = (index +direction + slideLength)% slideLength;