From 7c1ed386b7899e5e1d31ba64e5730b2d3f7532c2 Mon Sep 17 00:00:00 2001 From: nael Date: Wed, 19 Jun 2019 18:25:14 +0200 Subject: [PATCH] wip #2747 @7 --- public/_modules/home-slider/index.html | 61 +++++++++++++++------ public/_modules/home-slider/slider.js | 73 ++++++++++++++++++-------- 2 files changed, 97 insertions(+), 37 deletions(-) diff --git a/public/_modules/home-slider/index.html b/public/_modules/home-slider/index.html index 4714a4f..1e69e92 100644 --- a/public/_modules/home-slider/index.html +++ b/public/_modules/home-slider/index.html @@ -31,10 +31,13 @@
- - -
-
+ +
+ + +
+
+

Wheel Force Transducer

@@ -53,15 +56,15 @@
-
-
+
+
- -
-
+ +
+

slide suivante

@@ -80,14 +83,14 @@
-
-
+
+
-
-
+
+

Lorem ipsum

@@ -108,8 +111,36 @@
-
-
+
+
+
+
+
+
+
+
+
+

Lorrefdcem ipsfdcum

+
+

+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem + accusantium doloremque laudantium, totam rem aperiam, eaque ipsa + quae ab illo inventore veritatis et quasi architecto beatae vitae + dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit + aspernatur aut odit aut fugit, sed quia consequuntur magni dolores + eos qui ratione voluptatem sequi nesciunt. +

+

+ + Découvrir + +

+
+
+
+
+
+
diff --git a/public/_modules/home-slider/slider.js b/public/_modules/home-slider/slider.js index 3eb0a38..9fe4363 100644 --- a/public/_modules/home-slider/slider.js +++ b/public/_modules/home-slider/slider.js @@ -1,47 +1,76 @@ // jshint ignore: start let index = $(".column-wrapper.active").index(".column-wrapper"), - stepsCount = $(".column-wrapper").length, + slideLength = $(".slide").length, prevBtn = $(".home-arrow-left"), nextBtn = $(".home-arrow-right"); +let slides = document.querySelectorAll('.slide'); -// Slider variables let animationDuration = 0; -let delayBetweenAnim = 2000; +let delayBetweenAnim = 0; let mouvement = 0; -prevBtn.click(function() { - nextBtn.prop("disabled", false); + prevBtn.click(function() { + nextBtn.prop("disabled", false); - if (index > 0) { - index--; - $(".column-wrapper").removeClass("active").eq(index).addClass("active"); - }; + if (index > 0) { + index--; + $(".column-wrapper").removeClass("active").eq(index).addClass("active"); + }; - if (index === 0) { - $(this).prop("disabled", true); - } -}); + if (index === 0) { + $(this).prop("disabled", true); + } + }); nextBtn.click(function() { setTimeout(function () { - prevBtn.prop("disabled", false); + prevBtn.prop("disabled", false); + - if (index < stepsCount - 1) { + if (index < slideLength - 1) { index++; - //TODO animation when the first slide go out - // $(".column-wrapper").removeClass("active").eq(index); $(".column-wrapper").removeClass("active").eq(index).addClass("active"); - //TODO animation when the second slide appear + // if($('div.slide').hasClass('active')){ + // $('div.slide.active').removeClass('active'); + // } - console.log(index); - }; + + }; }, delayBetweenAnim); - if (index === stepsCount - 1) { + if (index === slideLength - 1) { $(this).prop("disabled", true); } -}); \ No newline at end of file +}); + +//TODO clip-path animation, movement text block animation + +// modifications slider + +// $('.slide').each(function (i) { +// +// console.log(i); +// let that = $(this); +// +// $('.home-arrow-right').on('click',function () { +// // that.prev().removeClass('active'); +// // $('div.slide').next(that).addClass('active'); +// // +// // // that.closest(that).addClass('active'); +// // +// // // console.log(that); +// // // that.prev(that).addClass('active'); +// if(that.hasClass('active')){ +// $('div.slide.active').removeClass('active'); +// } +// else{ +// $('div.slide').next('.active').addClass('active'); +// } +// +// }); +// +// }); \ No newline at end of file -- 2.39.5