From: soufiane Date: Thu, 21 Sep 2023 09:32:18 +0000 (+0200) Subject: wip #6182 question match X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f77346f8e351f3a8549edc178fc6d410975eb605;p=fluidbook-toolbox-quiz.git wip #6182 question match --- diff --git a/js/quiz.match.js b/js/quiz.match.js index 9d1dafd..bd1327a 100644 --- a/js/quiz.match.js +++ b/js/quiz.match.js @@ -18,9 +18,9 @@ QuizMatch.prototype = { let move = $(this).attr("aria-keyshortcuts") if(move === "ARROWLEFT") { - swiperTop.slidePrev() + swiperBottom.slidePrev() }else { - swiperTop.slideNext() + swiperBottom.slideNext() } }) @@ -46,25 +46,41 @@ QuizMatch.prototype = { el: '.swiper-pagination-bottom', type: 'bullets', }, + on: { + afterInit: function(swiper) { + //$this.setClass() + }, + slideChange: function(swiper) { + console.log(swiper) + const slides = swiper.slides + let activeIndex = swiper.activeIndex + let nextAllArray = swiper.slides.slice(activeIndex) + let prevAllArray = swiper.slides.slice(0,activeIndex) + + if(nextAllArray.length > 0) { + nextAllArray.forEach(function() { + + }) + } + + /*$(".bottom-slider .swiper-slide").removeClass("prevSibling nextSibling") + if($(".swiper-slide-prev").length > 0) { + const firstPrev = $(".swiper-slide-prev") + firstPrev.prevAll().addClass("prevSibling") + } + if($(".swiper-slide-next").length > 0) { + const firstNext = $(".swiper-slide-next").next() + firstNext.nextAll().addClass("nextSibling") + }*/ + } + } }) swiperBottom.on('sliderMove', function (swiper,ev) { const direction = swiper.swipeDirection let currentSlide = $(swiper.slides[swiper.activeIndex]) - console.log(currentSlide) - - console.log(swiper,ev) //$this.applyRotationToSiblings() }); }, - - applyRotationToSiblings: function() { - let prevEls = $(".swiper-container.bottom-slider .swiper-slide.swiper-slide-active").prevAll(); - let rotate = 0; - prevEls.each(function (){ - rotate -= 20 - $(this).css("transform","rotate("+rotate+"deg)") - }) - } } export default QuizMatch; diff --git a/style/004-mixins.sass b/style/004-mixins.sass index bd8e37f..756b300 100644 --- a/style/004-mixins.sass +++ b/style/004-mixins.sass @@ -8,7 +8,7 @@ @content -@mixin breakpoint($breakpoint, $direction: min) +//@mixin breakpoint($breakpoint, $direction: min) $breakpoint-values: map-get($breakpoints, $breakpoint) $breakpoint: map-get($breakpoint-values, $direction) @media (#{$direction}-width: $breakpoint) @@ -42,7 +42,7 @@ @mixin padding-container() padding: 16px - +breakpoint(md) + //+breakpoint(md) padding: 24px @mixin radius($size) diff --git a/style/103-question-multiple.sass b/style/103-question-multiple.sass index e42c80f..4073dc3 100644 --- a/style/103-question-multiple.sass +++ b/style/103-question-multiple.sass @@ -5,7 +5,7 @@ .list display: grid grid-gap: 16px - +breakpoint(md) + //+breakpoint(md) grid-template-columns: repeat(2, 1fr) &-item opacity: 0 diff --git a/style/106-question-draganddrop.sass b/style/106-question-draganddrop.sass index 0dcdb15..548765f 100644 --- a/style/106-question-draganddrop.sass +++ b/style/106-question-draganddrop.sass @@ -165,7 +165,7 @@ &.complete opacity: .16 !important - &:not(:nth-child(-n+4)) + //&:not(:nth-child(-n+4)) // on cache les items à partir du 5ème opacity: 0 !important visibility: hidden diff --git a/style/107-question-match.sass b/style/107-question-match.sass index ddeeab0..d2b5a6c 100644 --- a/style/107-question-match.sass +++ b/style/107-question-match.sass @@ -33,6 +33,7 @@ &-prev, &-next +opacity(.24,background-color,$neutral-color) + top: 13px &:not(.swiper-slide-active):not(.swiper-slide-prev):not(.swiper-slide-next) +opacity(.24,background-color,$neutral-color)