From f94f15549cd50eee5d34db65ac28b87c07b01cb1 Mon Sep 17 00:00:00 2001 From: soufiane Date: Fri, 22 Sep 2023 18:24:24 +0200 Subject: [PATCH] wip #6182 @3:00 question match --- js/quiz.match.js | 26 ++++++++++++++++++++------ views/index.blade.php | 2 ++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/js/quiz.match.js b/js/quiz.match.js index 300d964..9f72e69 100644 --- a/js/quiz.match.js +++ b/js/quiz.match.js @@ -34,8 +34,11 @@ QuizMatch.prototype = { this.swiperTop = new Swiper('.swiper-container.top-slider', { modules: [Navigation, Pagination], slidesPerView: 1, - loop: true, effect: 'fade', + spaceBetween: 20, + mousewheelControl: false, + keyboardControl: false, + noSwiping: true, pagination: { el: '.swiper-pagination-top', type: 'fraction', @@ -59,24 +62,35 @@ QuizMatch.prototype = { //$this.setClass() }, progress: function(swiper, progress) { - //console.log(swiper,progress,(progress*100)+"%") + console.log(swiper) const slides = swiper.slides let activeIndex = swiper.activeIndex let nextAllArray = swiper.slides.slice(activeIndex+1) let prevAllArray = swiper.slides.slice(0,activeIndex) - /*if(nextAllArray.length > 0) { + + console.log(nextAllArray) + //console.log(prevAllArray) + let angle = 4 + + if(swiper.swipeDirection === "next") { + angle -= 4 + } + + if(nextAllArray.length > 0) { + let angle = 4 nextAllArray.forEach(function(el,index) { - console.log("progress",el.progress) - let angle = 4 * el.progress + console.log("progress",el.progress,progress) $(el).css({ 'transform':'rotate('+(angle)+'deg)', 'top': $this.positionsX[index] ? $this.positionsX[index].top+'px' : 0, }) + angle += 4 + }) - }*/ + } } } diff --git a/views/index.blade.php b/views/index.blade.php index 78b55ff..03b7ee1 100644 --- a/views/index.blade.php +++ b/views/index.blade.php @@ -27,6 +27,8 @@
+ + -- 2.39.5