From: soufiane Date: Fri, 20 Sep 2024 17:36:03 +0000 (+0200) Subject: wip #7067 @7:00 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=63c68a2dc8ae48cc6a557044077c39f54050d42d;p=spinepro.git wip #7067 @7:00 --- diff --git a/wp-content/themes/CCV/resources/assets/scripts/patient-tour.js b/wp-content/themes/CCV/resources/assets/scripts/patient-tour.js index 5ad50f0b..1405525b 100644 --- a/wp-content/themes/CCV/resources/assets/scripts/patient-tour.js +++ b/wp-content/themes/CCV/resources/assets/scripts/patient-tour.js @@ -7,9 +7,27 @@ const swiper = new Swiper(elementSelector, swiperSettings); - //const lastBullet = $(elementSelector).find(".patient-tour-item").last().get(0).getBoundingClientRect() + $(document).on("mousemove", function( e ) { + let pageX = e.pageX, + coordSwiper = $(elementSelector).get(0).getBoundingClientRect() - //console.log(lastBullet) + let formule = Math.max(0, pageX - coordSwiper.x) / coordSwiper.width, + progress = Math.min(formule, 1) + + swiper.setProgress(progress, 10) + + document.querySelector(':root').style.setProperty('--progress-swiper', progress*100+'%'); + $("[data-group]").removeClass("active") + $("[data-group=0-5]").addClass("active") + if(progress*100 >= 50) { + $("[data-group=6-12]").addClass("active") + } + + if (progress*100 >= 90) { + $("[data-group=13-17]").addClass("active") + } + + }) }); }); })(jQuery); \ No newline at end of file diff --git a/wp-content/themes/CCV/resources/assets/styles/widgets/patient-tour.styl b/wp-content/themes/CCV/resources/assets/styles/widgets/patient-tour.styl index 79a265ff..7ac0efb9 100644 --- a/wp-content/themes/CCV/resources/assets/styles/widgets/patient-tour.styl +++ b/wp-content/themes/CCV/resources/assets/styles/widgets/patient-tour.styl @@ -1,10 +1,15 @@ $breakpoint-timeline-horizontal = 768px // When timeline changes to mobile view +:root + --progress-swiper: 0 .patient-tour width: calc(100% - calc(192px * 2)) !important margin: 0 auto overflow-x: visible + +below($breakpoint-timeline-horizontal) + width: 90% + &-item @apply bg-white flex-col items-center //horizontal-spacing(12.5vw) @@ -101,15 +106,25 @@ $breakpoint-timeline-horizontal = 768px // When timeline changes to mobile view display: none // Timeline horizontal line - &:before + &:before, + &:after content: '' position: absolute top: r(32px) left: 0 right: 0 height: r(10px) + + &:before background: #EDEDF4 + z-index: -2 + + &:after + background: #ffbf29 z-index: -1 + width: var(--progress-swiper) + border-top-right-radius: 5px + border-bottom-right-radius: 5px &-bullet @@ -189,6 +204,7 @@ $breakpoint-timeline-horizontal = 768px // When timeline changes to mobile view &-title display: block text-align: center + position: relative .active & color: #FFBF29 @@ -211,6 +227,7 @@ $breakpoint-timeline-horizontal = 768px // When timeline changes to mobile view &-title @apply font-body mt-2 mb-6 text-sm font-light min-height: 52px + max-height: 52px //max-width: 8em .bullet diff --git a/wp-content/themes/CCV/resources/views/widgets/patient-tour.blade.php b/wp-content/themes/CCV/resources/views/widgets/patient-tour.blade.php index 6419cf3d..307a9761 100644 --- a/wp-content/themes/CCV/resources/views/widgets/patient-tour.blade.php +++ b/wp-content/themes/CCV/resources/views/widgets/patient-tour.blade.php @@ -4,6 +4,7 @@ 'slidesPerView' => 'auto', 'loop' => false, 'effect' => 'slide', + 'watchSlidesProgress' => true, 'touchEventsTarget' => 'wrapper', // Fix pagination links sometimes going to wrong place 'navigation' => [ 'nextEl' => '.patient-tour-next', @@ -35,19 +36,19 @@
@svg('carousel-next', 'stroke-current')
--}}
-
+
pre-operative phase - UK
-
+
Surgery phase - France
-
+
recovery phase - UK