diaporama home js et css
This commit is contained in:
parent
73c33f640a
commit
9aec2f02b9
File diff suppressed because one or more lines are too long
|
@ -1606,9 +1606,33 @@ header #block-quartiers-de-demain-logoquartiersdedemain .field_field_logo .qdd-h
|
||||||
#home .config_pages--type--diaporama-home {
|
#home .config_pages--type--diaporama-home {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
#home .config_pages--type--diaporama-home .field_field_images img {
|
#home .config_pages--type--diaporama-home .swiper-container .swiper-wrapper .swiper-slide .cadre-img-zoom {
|
||||||
|
max-height: 1281px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#home .config_pages--type--diaporama-home .swiper-container .swiper-wrapper .swiper-slide .cadre-img-zoom img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
animation: zoomOut 3.5s ease-in infinite;
|
||||||
|
}
|
||||||
|
#home .config_pages--type--diaporama-home .swiper-container .swiper-wrapper .swiper-slide blockquote {
|
||||||
|
position: relative;
|
||||||
|
top: -30px;
|
||||||
|
}
|
||||||
|
#home .config_pages--type--diaporama-home .swiper-container .swiper-wrapper .swiper-slide blockquote p {
|
||||||
|
font-size: 0.6rem !important;
|
||||||
|
font-family: "gilroy-regular";
|
||||||
|
}
|
||||||
|
#home .config_pages--type--diaporama-home .swiper-container .swiper-wrapper .swiper-slide :hover {
|
||||||
|
color: blueviolet;
|
||||||
|
}
|
||||||
|
@keyframes zoomOut {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#home .content_container #block-quartiers-de-demain-titredepage {
|
#home .content_container #block-quartiers-de-demain-titredepage {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2019 Vladimir Kharlampidi
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,11 @@
|
||||||
|
Swiper
|
||||||
|
==========
|
||||||
|
|
||||||
|
Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
|
||||||
|
|
||||||
|
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.
|
||||||
|
|
||||||
|
# Getting Started
|
||||||
|
* [Getting Started Guide](https://swiperjs.com/get-started/)
|
||||||
|
* [API](https://swiperjs.com/swiper-api/)
|
||||||
|
* [Demos](https://swiperjs.com/demos/)
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* a11y */
|
||||||
|
.swiper .swiper-notification {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
z-index: -1000;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/a11y-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/a11y-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* a11y */
|
||||||
|
.swiper .swiper-notification {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
z-index: -1000;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* a11y */
|
||||||
|
.swiper .swiper-notification {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
z-index: -1000;
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,374 @@
|
||||||
|
import { g as getDocument } from '../shared/ssr-window.esm.mjs';
|
||||||
|
import { c as classesToSelector } from '../shared/classes-to-selector.mjs';
|
||||||
|
import { c as createElement, h as elementIndex, m as makeElementsArray } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function A11y(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
a11y: {
|
||||||
|
enabled: true,
|
||||||
|
notificationClass: 'swiper-notification',
|
||||||
|
prevSlideMessage: 'Previous slide',
|
||||||
|
nextSlideMessage: 'Next slide',
|
||||||
|
firstSlideMessage: 'This is the first slide',
|
||||||
|
lastSlideMessage: 'This is the last slide',
|
||||||
|
paginationBulletMessage: 'Go to slide {{index}}',
|
||||||
|
slideLabelMessage: '{{index}} / {{slidesLength}}',
|
||||||
|
containerMessage: null,
|
||||||
|
containerRoleDescriptionMessage: null,
|
||||||
|
itemRoleDescriptionMessage: null,
|
||||||
|
slideRole: 'group',
|
||||||
|
id: null,
|
||||||
|
scrollOnFocus: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
swiper.a11y = {
|
||||||
|
clicked: false
|
||||||
|
};
|
||||||
|
let liveRegion = null;
|
||||||
|
let preventFocusHandler;
|
||||||
|
let focusTargetSlideEl;
|
||||||
|
let visibilityChangedTimestamp = new Date().getTime();
|
||||||
|
function notify(message) {
|
||||||
|
const notification = liveRegion;
|
||||||
|
if (notification.length === 0) return;
|
||||||
|
notification.innerHTML = '';
|
||||||
|
notification.innerHTML = message;
|
||||||
|
}
|
||||||
|
function getRandomNumber(size) {
|
||||||
|
if (size === void 0) {
|
||||||
|
size = 16;
|
||||||
|
}
|
||||||
|
const randomChar = () => Math.round(16 * Math.random()).toString(16);
|
||||||
|
return 'x'.repeat(size).replace(/x/g, randomChar);
|
||||||
|
}
|
||||||
|
function makeElFocusable(el) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('tabIndex', '0');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function makeElNotFocusable(el) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('tabIndex', '-1');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElRole(el, role) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('role', role);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElRoleDescription(el, description) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-roledescription', description);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElControls(el, controls) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-controls', controls);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElLabel(el, label) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-label', label);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElId(el, id) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('id', id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addElLive(el, live) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-live', live);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function disableEl(el) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-disabled', true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function enableEl(el) {
|
||||||
|
el = makeElementsArray(el);
|
||||||
|
el.forEach(subEl => {
|
||||||
|
subEl.setAttribute('aria-disabled', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onEnterOrSpaceKey(e) {
|
||||||
|
if (e.keyCode !== 13 && e.keyCode !== 32) return;
|
||||||
|
const params = swiper.params.a11y;
|
||||||
|
const targetEl = e.target;
|
||||||
|
if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
|
||||||
|
if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
|
||||||
|
}
|
||||||
|
if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
|
||||||
|
const prevEls = makeElementsArray(swiper.navigation.prevEl);
|
||||||
|
const nextEls = makeElementsArray(swiper.navigation.nextEl);
|
||||||
|
if (nextEls.includes(targetEl)) {
|
||||||
|
if (!(swiper.isEnd && !swiper.params.loop)) {
|
||||||
|
swiper.slideNext();
|
||||||
|
}
|
||||||
|
if (swiper.isEnd) {
|
||||||
|
notify(params.lastSlideMessage);
|
||||||
|
} else {
|
||||||
|
notify(params.nextSlideMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (prevEls.includes(targetEl)) {
|
||||||
|
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
||||||
|
swiper.slidePrev();
|
||||||
|
}
|
||||||
|
if (swiper.isBeginning) {
|
||||||
|
notify(params.firstSlideMessage);
|
||||||
|
} else {
|
||||||
|
notify(params.prevSlideMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
|
||||||
|
targetEl.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function updateNavigation() {
|
||||||
|
if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
|
||||||
|
const {
|
||||||
|
nextEl,
|
||||||
|
prevEl
|
||||||
|
} = swiper.navigation;
|
||||||
|
if (prevEl) {
|
||||||
|
if (swiper.isBeginning) {
|
||||||
|
disableEl(prevEl);
|
||||||
|
makeElNotFocusable(prevEl);
|
||||||
|
} else {
|
||||||
|
enableEl(prevEl);
|
||||||
|
makeElFocusable(prevEl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nextEl) {
|
||||||
|
if (swiper.isEnd) {
|
||||||
|
disableEl(nextEl);
|
||||||
|
makeElNotFocusable(nextEl);
|
||||||
|
} else {
|
||||||
|
enableEl(nextEl);
|
||||||
|
makeElFocusable(nextEl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function hasPagination() {
|
||||||
|
return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
|
||||||
|
}
|
||||||
|
function hasClickablePagination() {
|
||||||
|
return hasPagination() && swiper.params.pagination.clickable;
|
||||||
|
}
|
||||||
|
function updatePagination() {
|
||||||
|
const params = swiper.params.a11y;
|
||||||
|
if (!hasPagination()) return;
|
||||||
|
swiper.pagination.bullets.forEach(bulletEl => {
|
||||||
|
if (swiper.params.pagination.clickable) {
|
||||||
|
makeElFocusable(bulletEl);
|
||||||
|
if (!swiper.params.pagination.renderBullet) {
|
||||||
|
addElRole(bulletEl, 'button');
|
||||||
|
addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
|
||||||
|
bulletEl.setAttribute('aria-current', 'true');
|
||||||
|
} else {
|
||||||
|
bulletEl.removeAttribute('aria-current');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const initNavEl = (el, wrapperId, message) => {
|
||||||
|
makeElFocusable(el);
|
||||||
|
if (el.tagName !== 'BUTTON') {
|
||||||
|
addElRole(el, 'button');
|
||||||
|
el.addEventListener('keydown', onEnterOrSpaceKey);
|
||||||
|
}
|
||||||
|
addElLabel(el, message);
|
||||||
|
addElControls(el, wrapperId);
|
||||||
|
};
|
||||||
|
const handlePointerDown = e => {
|
||||||
|
if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
|
||||||
|
preventFocusHandler = true;
|
||||||
|
}
|
||||||
|
swiper.a11y.clicked = true;
|
||||||
|
};
|
||||||
|
const handlePointerUp = () => {
|
||||||
|
preventFocusHandler = false;
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (!swiper.destroyed) {
|
||||||
|
swiper.a11y.clicked = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onVisibilityChange = e => {
|
||||||
|
visibilityChangedTimestamp = new Date().getTime();
|
||||||
|
};
|
||||||
|
const handleFocus = e => {
|
||||||
|
if (swiper.a11y.clicked || !swiper.params.a11y.scrollOnFocus) return;
|
||||||
|
if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
|
||||||
|
const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
|
||||||
|
if (!slideEl || !swiper.slides.includes(slideEl)) return;
|
||||||
|
focusTargetSlideEl = slideEl;
|
||||||
|
const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
|
||||||
|
const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
|
||||||
|
if (isActive || isVisible) return;
|
||||||
|
if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
|
||||||
|
if (swiper.isHorizontal()) {
|
||||||
|
swiper.el.scrollLeft = 0;
|
||||||
|
} else {
|
||||||
|
swiper.el.scrollTop = 0;
|
||||||
|
}
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (preventFocusHandler) return;
|
||||||
|
if (swiper.params.loop) {
|
||||||
|
swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
|
||||||
|
} else {
|
||||||
|
swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
|
||||||
|
}
|
||||||
|
preventFocusHandler = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const initSlides = () => {
|
||||||
|
const params = swiper.params.a11y;
|
||||||
|
if (params.itemRoleDescriptionMessage) {
|
||||||
|
addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
|
||||||
|
}
|
||||||
|
if (params.slideRole) {
|
||||||
|
addElRole(swiper.slides, params.slideRole);
|
||||||
|
}
|
||||||
|
const slidesLength = swiper.slides.length;
|
||||||
|
if (params.slideLabelMessage) {
|
||||||
|
swiper.slides.forEach((slideEl, index) => {
|
||||||
|
const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
|
||||||
|
const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
|
||||||
|
addElLabel(slideEl, ariaLabelMessage);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const init = () => {
|
||||||
|
const params = swiper.params.a11y;
|
||||||
|
swiper.el.append(liveRegion);
|
||||||
|
|
||||||
|
// Container
|
||||||
|
const containerEl = swiper.el;
|
||||||
|
if (params.containerRoleDescriptionMessage) {
|
||||||
|
addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
|
||||||
|
}
|
||||||
|
if (params.containerMessage) {
|
||||||
|
addElLabel(containerEl, params.containerMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wrapper
|
||||||
|
const wrapperEl = swiper.wrapperEl;
|
||||||
|
const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
|
||||||
|
const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
|
||||||
|
addElId(wrapperEl, wrapperId);
|
||||||
|
addElLive(wrapperEl, live);
|
||||||
|
|
||||||
|
// Slide
|
||||||
|
initSlides();
|
||||||
|
|
||||||
|
// Navigation
|
||||||
|
let {
|
||||||
|
nextEl,
|
||||||
|
prevEl
|
||||||
|
} = swiper.navigation ? swiper.navigation : {};
|
||||||
|
nextEl = makeElementsArray(nextEl);
|
||||||
|
prevEl = makeElementsArray(prevEl);
|
||||||
|
if (nextEl) {
|
||||||
|
nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
|
||||||
|
}
|
||||||
|
if (prevEl) {
|
||||||
|
prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pagination
|
||||||
|
if (hasClickablePagination()) {
|
||||||
|
const paginationEl = makeElementsArray(swiper.pagination.el);
|
||||||
|
paginationEl.forEach(el => {
|
||||||
|
el.addEventListener('keydown', onEnterOrSpaceKey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tab focus
|
||||||
|
const document = getDocument();
|
||||||
|
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||||
|
swiper.el.addEventListener('focus', handleFocus, true);
|
||||||
|
swiper.el.addEventListener('focus', handleFocus, true);
|
||||||
|
swiper.el.addEventListener('pointerdown', handlePointerDown, true);
|
||||||
|
swiper.el.addEventListener('pointerup', handlePointerUp, true);
|
||||||
|
};
|
||||||
|
function destroy() {
|
||||||
|
if (liveRegion) liveRegion.remove();
|
||||||
|
let {
|
||||||
|
nextEl,
|
||||||
|
prevEl
|
||||||
|
} = swiper.navigation ? swiper.navigation : {};
|
||||||
|
nextEl = makeElementsArray(nextEl);
|
||||||
|
prevEl = makeElementsArray(prevEl);
|
||||||
|
if (nextEl) {
|
||||||
|
nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
||||||
|
}
|
||||||
|
if (prevEl) {
|
||||||
|
prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pagination
|
||||||
|
if (hasClickablePagination()) {
|
||||||
|
const paginationEl = makeElementsArray(swiper.pagination.el);
|
||||||
|
paginationEl.forEach(el => {
|
||||||
|
el.removeEventListener('keydown', onEnterOrSpaceKey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const document = getDocument();
|
||||||
|
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||||
|
// Tab focus
|
||||||
|
if (swiper.el && typeof swiper.el !== 'string') {
|
||||||
|
swiper.el.removeEventListener('focus', handleFocus, true);
|
||||||
|
swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
|
||||||
|
swiper.el.removeEventListener('pointerup', handlePointerUp, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
on('beforeInit', () => {
|
||||||
|
liveRegion = createElement('span', swiper.params.a11y.notificationClass);
|
||||||
|
liveRegion.setAttribute('aria-live', 'assertive');
|
||||||
|
liveRegion.setAttribute('aria-atomic', 'true');
|
||||||
|
});
|
||||||
|
on('afterInit', () => {
|
||||||
|
if (!swiper.params.a11y.enabled) return;
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
|
||||||
|
if (!swiper.params.a11y.enabled) return;
|
||||||
|
initSlides();
|
||||||
|
});
|
||||||
|
on('fromEdge toEdge afterInit lock unlock', () => {
|
||||||
|
if (!swiper.params.a11y.enabled) return;
|
||||||
|
updateNavigation();
|
||||||
|
});
|
||||||
|
on('paginationUpdate', () => {
|
||||||
|
if (!swiper.params.a11y.enabled) return;
|
||||||
|
updatePagination();
|
||||||
|
});
|
||||||
|
on('destroy', () => {
|
||||||
|
if (!swiper.params.a11y.enabled) return;
|
||||||
|
destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { A11y as default };
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* a11y */
|
||||||
|
.swiper .swiper-notification {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
z-index: -1000;
|
||||||
|
}
|
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/autoplay-element.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/autoplay-element.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/autoplay.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/autoplay.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import{g as getDocument}from"../shared/ssr-window.esm.min.mjs";function Autoplay(e){let a,t,{swiper:n,extendParams:i,on:r,emit:o,params:s}=e;n.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,p,u,d,y,m,c,g,v=s&&s.autoplay?s.autoplay.delay:3e3,T=s&&s.autoplay?s.autoplay.delay:3e3,f=(new Date).getTime();function w(e){n&&!n.destroyed&&n.wrapperEl&&e.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",w),g||e.detail&&e.detail.bySwiperTouchMove||S())}const b=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?p=!0:p&&(T=l,p=!1);const e=n.autoplay.paused?l:f+T-(new Date).getTime();n.autoplay.timeLeft=e,o("autoplayTimeLeft",e,e/v),t=requestAnimationFrame((()=>{b()}))},E=e=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(t),b();let i=void 0===e?n.params.autoplay.delay:e;v=n.params.autoplay.delay,T=n.params.autoplay.delay;const r=(()=>{let e;if(e=n.virtual&&n.params.virtual.enabled?n.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:n.slides[n.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(r)&&r>0&&void 0===e&&(i=r,v=r,T=r),l=i;const s=n.params.speed,p=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(s,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,s,!0,!0),o("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(s,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,s,!0,!0),o("autoplay")),n.params.cssMode&&(f=(new Date).getTime(),requestAnimationFrame((()=>{E()}))))};return i>0?(clearTimeout(a),a=setTimeout((()=>{p()}),i)):requestAnimationFrame((()=>{p()})),i},L=()=>{f=(new Date).getTime(),n.autoplay.running=!0,E(),o("autoplayStart")},D=()=>{n.autoplay.running=!1,clearTimeout(a),cancelAnimationFrame(t),o("autoplayStop")},O=(e,t)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(a),e||(c=!0);const i=()=>{o("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",w):S()};if(n.autoplay.paused=!0,t)return m&&(l=n.params.autoplay.delay),m=!1,void i();const r=l||n.params.autoplay.delay;l=r-((new Date).getTime()-f),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),i())},S=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(f=(new Date).getTime(),c?(c=!1,E(l)):E(),n.autoplay.paused=!1,o("autoplayResume"))},M=()=>{if(n.destroyed||!n.autoplay.running)return;const e=getDocument();"hidden"===e.visibilityState&&(c=!0,O(!0)),"visible"===e.visibilityState&&S()},h=e=>{"mouse"===e.pointerType&&(c=!0,g=!0,n.animating||n.autoplay.paused||O(!0))},A=e=>{"mouse"===e.pointerType&&(g=!1,n.autoplay.paused&&S())};r("init",(()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",h),n.el.addEventListener("pointerleave",A)),getDocument().addEventListener("visibilitychange",M),L())})),r("destroy",(()=>{n.el&&"string"!=typeof n.el&&(n.el.removeEventListener("pointerenter",h),n.el.removeEventListener("pointerleave",A)),getDocument().removeEventListener("visibilitychange",M),n.autoplay.running&&D()})),r("_freeModeStaticRelease",(()=>{(d||c)&&S()})),r("_freeModeNoMomentumRelease",(()=>{n.params.autoplay.disableOnInteraction?D():O(!0,!0)})),r("beforeTransitionStart",((e,a,t)=>{!n.destroyed&&n.autoplay.running&&(t||!n.params.autoplay.disableOnInteraction?O(!0,!0):D())})),r("sliderFirstMove",(()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?D():(u=!0,d=!1,c=!1,y=setTimeout((()=>{c=!0,d=!0,O(!0)}),200)))})),r("touchEnd",(()=>{if(!n.destroyed&&n.autoplay.running&&u){if(clearTimeout(y),clearTimeout(a),n.params.autoplay.disableOnInteraction)return d=!1,void(u=!1);d&&n.params.cssMode&&S(),d=!1,u=!1}})),r("slideChange",(()=>{!n.destroyed&&n.autoplay.running&&(m=!0)})),Object.assign(n.autoplay,{start:L,stop:D,pause:O,resume:S})}export{Autoplay as default};
|
||||||
|
//# sourceMappingURL=autoplay.min.mjs.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,304 @@
|
||||||
|
import { g as getDocument } from '../shared/ssr-window.esm.mjs';
|
||||||
|
|
||||||
|
/* eslint no-underscore-dangle: "off" */
|
||||||
|
/* eslint no-use-before-define: "off" */
|
||||||
|
function Autoplay(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on,
|
||||||
|
emit,
|
||||||
|
params
|
||||||
|
} = _ref;
|
||||||
|
swiper.autoplay = {
|
||||||
|
running: false,
|
||||||
|
paused: false,
|
||||||
|
timeLeft: 0
|
||||||
|
};
|
||||||
|
extendParams({
|
||||||
|
autoplay: {
|
||||||
|
enabled: false,
|
||||||
|
delay: 3000,
|
||||||
|
waitForTransition: true,
|
||||||
|
disableOnInteraction: false,
|
||||||
|
stopOnLastSlide: false,
|
||||||
|
reverseDirection: false,
|
||||||
|
pauseOnMouseEnter: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let timeout;
|
||||||
|
let raf;
|
||||||
|
let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
|
||||||
|
let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
|
||||||
|
let autoplayTimeLeft;
|
||||||
|
let autoplayStartTime = new Date().getTime();
|
||||||
|
let wasPaused;
|
||||||
|
let isTouched;
|
||||||
|
let pausedByTouch;
|
||||||
|
let touchStartTimeout;
|
||||||
|
let slideChanged;
|
||||||
|
let pausedByInteraction;
|
||||||
|
let pausedByPointerEnter;
|
||||||
|
function onTransitionEnd(e) {
|
||||||
|
if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
|
||||||
|
if (e.target !== swiper.wrapperEl) return;
|
||||||
|
swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
|
||||||
|
if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resume();
|
||||||
|
}
|
||||||
|
const calcTimeLeft = () => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
if (swiper.autoplay.paused) {
|
||||||
|
wasPaused = true;
|
||||||
|
} else if (wasPaused) {
|
||||||
|
autoplayDelayCurrent = autoplayTimeLeft;
|
||||||
|
wasPaused = false;
|
||||||
|
}
|
||||||
|
const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();
|
||||||
|
swiper.autoplay.timeLeft = timeLeft;
|
||||||
|
emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);
|
||||||
|
raf = requestAnimationFrame(() => {
|
||||||
|
calcTimeLeft();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const getSlideDelay = () => {
|
||||||
|
let activeSlideEl;
|
||||||
|
if (swiper.virtual && swiper.params.virtual.enabled) {
|
||||||
|
activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
|
||||||
|
} else {
|
||||||
|
activeSlideEl = swiper.slides[swiper.activeIndex];
|
||||||
|
}
|
||||||
|
if (!activeSlideEl) return undefined;
|
||||||
|
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
||||||
|
return currentSlideDelay;
|
||||||
|
};
|
||||||
|
const run = delayForce => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
cancelAnimationFrame(raf);
|
||||||
|
calcTimeLeft();
|
||||||
|
let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
|
||||||
|
autoplayDelayTotal = swiper.params.autoplay.delay;
|
||||||
|
autoplayDelayCurrent = swiper.params.autoplay.delay;
|
||||||
|
const currentSlideDelay = getSlideDelay();
|
||||||
|
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
|
||||||
|
delay = currentSlideDelay;
|
||||||
|
autoplayDelayTotal = currentSlideDelay;
|
||||||
|
autoplayDelayCurrent = currentSlideDelay;
|
||||||
|
}
|
||||||
|
autoplayTimeLeft = delay;
|
||||||
|
const speed = swiper.params.speed;
|
||||||
|
const proceed = () => {
|
||||||
|
if (!swiper || swiper.destroyed) return;
|
||||||
|
if (swiper.params.autoplay.reverseDirection) {
|
||||||
|
if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {
|
||||||
|
swiper.slidePrev(speed, true, true);
|
||||||
|
emit('autoplay');
|
||||||
|
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||||
|
swiper.slideTo(swiper.slides.length - 1, speed, true, true);
|
||||||
|
emit('autoplay');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {
|
||||||
|
swiper.slideNext(speed, true, true);
|
||||||
|
emit('autoplay');
|
||||||
|
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||||
|
swiper.slideTo(0, speed, true, true);
|
||||||
|
emit('autoplay');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (swiper.params.cssMode) {
|
||||||
|
autoplayStartTime = new Date().getTime();
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
run();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (delay > 0) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
proceed();
|
||||||
|
}, delay);
|
||||||
|
} else {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
proceed();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
return delay;
|
||||||
|
};
|
||||||
|
const start = () => {
|
||||||
|
autoplayStartTime = new Date().getTime();
|
||||||
|
swiper.autoplay.running = true;
|
||||||
|
run();
|
||||||
|
emit('autoplayStart');
|
||||||
|
};
|
||||||
|
const stop = () => {
|
||||||
|
swiper.autoplay.running = false;
|
||||||
|
clearTimeout(timeout);
|
||||||
|
cancelAnimationFrame(raf);
|
||||||
|
emit('autoplayStop');
|
||||||
|
};
|
||||||
|
const pause = (internal, reset) => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
clearTimeout(timeout);
|
||||||
|
if (!internal) {
|
||||||
|
pausedByInteraction = true;
|
||||||
|
}
|
||||||
|
const proceed = () => {
|
||||||
|
emit('autoplayPause');
|
||||||
|
if (swiper.params.autoplay.waitForTransition) {
|
||||||
|
swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);
|
||||||
|
} else {
|
||||||
|
resume();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
swiper.autoplay.paused = true;
|
||||||
|
if (reset) {
|
||||||
|
if (slideChanged) {
|
||||||
|
autoplayTimeLeft = swiper.params.autoplay.delay;
|
||||||
|
}
|
||||||
|
slideChanged = false;
|
||||||
|
proceed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const delay = autoplayTimeLeft || swiper.params.autoplay.delay;
|
||||||
|
autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);
|
||||||
|
if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;
|
||||||
|
if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;
|
||||||
|
proceed();
|
||||||
|
};
|
||||||
|
const resume = () => {
|
||||||
|
if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
autoplayStartTime = new Date().getTime();
|
||||||
|
if (pausedByInteraction) {
|
||||||
|
pausedByInteraction = false;
|
||||||
|
run(autoplayTimeLeft);
|
||||||
|
} else {
|
||||||
|
run();
|
||||||
|
}
|
||||||
|
swiper.autoplay.paused = false;
|
||||||
|
emit('autoplayResume');
|
||||||
|
};
|
||||||
|
const onVisibilityChange = () => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
const document = getDocument();
|
||||||
|
if (document.visibilityState === 'hidden') {
|
||||||
|
pausedByInteraction = true;
|
||||||
|
pause(true);
|
||||||
|
}
|
||||||
|
if (document.visibilityState === 'visible') {
|
||||||
|
resume();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onPointerEnter = e => {
|
||||||
|
if (e.pointerType !== 'mouse') return;
|
||||||
|
pausedByInteraction = true;
|
||||||
|
pausedByPointerEnter = true;
|
||||||
|
if (swiper.animating || swiper.autoplay.paused) return;
|
||||||
|
pause(true);
|
||||||
|
};
|
||||||
|
const onPointerLeave = e => {
|
||||||
|
if (e.pointerType !== 'mouse') return;
|
||||||
|
pausedByPointerEnter = false;
|
||||||
|
if (swiper.autoplay.paused) {
|
||||||
|
resume();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const attachMouseEvents = () => {
|
||||||
|
if (swiper.params.autoplay.pauseOnMouseEnter) {
|
||||||
|
swiper.el.addEventListener('pointerenter', onPointerEnter);
|
||||||
|
swiper.el.addEventListener('pointerleave', onPointerLeave);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const detachMouseEvents = () => {
|
||||||
|
if (swiper.el && typeof swiper.el !== 'string') {
|
||||||
|
swiper.el.removeEventListener('pointerenter', onPointerEnter);
|
||||||
|
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const attachDocumentEvents = () => {
|
||||||
|
const document = getDocument();
|
||||||
|
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||||
|
};
|
||||||
|
const detachDocumentEvents = () => {
|
||||||
|
const document = getDocument();
|
||||||
|
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||||
|
};
|
||||||
|
on('init', () => {
|
||||||
|
if (swiper.params.autoplay.enabled) {
|
||||||
|
attachMouseEvents();
|
||||||
|
attachDocumentEvents();
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
on('destroy', () => {
|
||||||
|
detachMouseEvents();
|
||||||
|
detachDocumentEvents();
|
||||||
|
if (swiper.autoplay.running) {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
on('_freeModeStaticRelease', () => {
|
||||||
|
if (pausedByTouch || pausedByInteraction) {
|
||||||
|
resume();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
on('_freeModeNoMomentumRelease', () => {
|
||||||
|
if (!swiper.params.autoplay.disableOnInteraction) {
|
||||||
|
pause(true, true);
|
||||||
|
} else {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
on('beforeTransitionStart', (_s, speed, internal) => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
||||||
|
pause(true, true);
|
||||||
|
} else {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
on('sliderFirstMove', () => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
if (swiper.params.autoplay.disableOnInteraction) {
|
||||||
|
stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isTouched = true;
|
||||||
|
pausedByTouch = false;
|
||||||
|
pausedByInteraction = false;
|
||||||
|
touchStartTimeout = setTimeout(() => {
|
||||||
|
pausedByInteraction = true;
|
||||||
|
pausedByTouch = true;
|
||||||
|
pause(true);
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
on('touchEnd', () => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;
|
||||||
|
clearTimeout(touchStartTimeout);
|
||||||
|
clearTimeout(timeout);
|
||||||
|
if (swiper.params.autoplay.disableOnInteraction) {
|
||||||
|
pausedByTouch = false;
|
||||||
|
isTouched = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pausedByTouch && swiper.params.cssMode) resume();
|
||||||
|
pausedByTouch = false;
|
||||||
|
isTouched = false;
|
||||||
|
});
|
||||||
|
on('slideChange', () => {
|
||||||
|
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||||
|
slideChanged = true;
|
||||||
|
});
|
||||||
|
Object.assign(swiper.autoplay, {
|
||||||
|
start,
|
||||||
|
stop,
|
||||||
|
pause,
|
||||||
|
resume
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Autoplay as default };
|
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/controller-element.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/controller-element.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/controller.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/controller.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import{n as nextTick,k as elementTransitionEnd}from"../shared/utils.min.mjs";function Controller(t){let{swiper:r,extendParams:e,on:n}=t;function o(t,r){const e=function(){let t,r,e;return(n,o)=>{for(r=-1,t=n.length;t-r>1;)e=t+r>>1,n[e]<=o?r=e:t=e;return t}}();let n,o;return this.x=t,this.y=r,this.lastIndex=t.length-1,this.interpolate=function(t){return t?(o=e(this.x,t),n=o-1,(t-this.x[n])*(this.y[o]-this.y[n])/(this.x[o]-this.x[n])+this.y[n]):0},this}function l(){r.controller.control&&r.controller.spline&&(r.controller.spline=void 0,delete r.controller.spline)}e({controller:{control:void 0,inverse:!1,by:"slide"}}),r.controller={control:void 0},n("beforeInit",(()=>{if("undefined"!=typeof window&&("string"==typeof r.params.controller.control||r.params.controller.control instanceof HTMLElement)){("string"==typeof r.params.controller.control?[...document.querySelectorAll(r.params.controller.control)]:[r.params.controller.control]).forEach((t=>{if(r.controller.control||(r.controller.control=[]),t&&t.swiper)r.controller.control.push(t.swiper);else if(t){const e=`${r.params.eventsPrefix}init`,n=o=>{r.controller.control.push(o.detail[0]),r.update(),t.removeEventListener(e,n)};t.addEventListener(e,n)}}))}else r.controller.control=r.params.controller.control})),n("update",(()=>{l()})),n("resize",(()=>{l()})),n("observerUpdate",(()=>{l()})),n("setTranslate",((t,e,n)=>{r.controller.control&&!r.controller.control.destroyed&&r.controller.setTranslate(e,n)})),n("setTransition",((t,e,n)=>{r.controller.control&&!r.controller.control.destroyed&&r.controller.setTransition(e,n)})),Object.assign(r.controller,{setTranslate:function(t,e){const n=r.controller.control;let l,s;const i=r.constructor;function a(t){if(t.destroyed)return;const e=r.rtlTranslate?-r.translate:r.translate;"slide"===r.params.controller.by&&(!function(t){r.controller.spline=r.params.loop?new o(r.slidesGrid,t.slidesGrid):new o(r.snapGrid,t.snapGrid)}(t),s=-r.controller.spline.interpolate(-e)),s&&"container"!==r.params.controller.by||(l=(t.maxTranslate()-t.minTranslate())/(r.maxTranslate()-r.minTranslate()),!Number.isNaN(l)&&Number.isFinite(l)||(l=1),s=(e-r.minTranslate())*l+t.minTranslate()),r.params.controller.inverse&&(s=t.maxTranslate()-s),t.updateProgress(s),t.setTranslate(s,r),t.updateActiveIndex(),t.updateSlidesClasses()}if(Array.isArray(n))for(let t=0;t<n.length;t+=1)n[t]!==e&&n[t]instanceof i&&a(n[t]);else n instanceof i&&e!==n&&a(n)},setTransition:function(t,e){const n=r.constructor,o=r.controller.control;let l;function s(e){e.destroyed||(e.setTransition(t,r),0!==t&&(e.transitionStart(),e.params.autoHeight&&nextTick((()=>{e.updateAutoHeight()})),elementTransitionEnd(e.wrapperEl,(()=>{o&&e.transitionEnd()}))))}if(Array.isArray(o))for(l=0;l<o.length;l+=1)o[l]!==e&&o[l]instanceof n&&s(o[l]);else o instanceof n&&e!==o&&s(o)}})}export{Controller as default};
|
||||||
|
//# sourceMappingURL=controller.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"controller.mjs.mjs","names":["nextTick","elementTransitionEnd","Controller","_ref","swiper","extendParams","on","LinearSpline","x","y","binarySearch","maxIndex","minIndex","guess","array","val","length","i1","i3","this","lastIndex","interpolate","x2","removeSpline","controller","control","spline","undefined","inverse","by","window","params","HTMLElement","document","querySelectorAll","forEach","controlElement","push","eventName","eventsPrefix","onControllerSwiper","e","detail","update","removeEventListener","addEventListener","_s","translate","byController","destroyed","setTranslate","duration","setTransition","Object","assign","_t","controlled","multiplier","controlledTranslate","Swiper","constructor","setControlledTranslate","c","rtlTranslate","loop","slidesGrid","snapGrid","getInterpolateFunction","maxTranslate","minTranslate","Number","isNaN","isFinite","updateProgress","updateActiveIndex","updateSlidesClasses","Array","isArray","i","setControlledTransition","transitionStart","autoHeight","updateAutoHeight","wrapperEl","transitionEnd"],"sources":["0"],"mappings":"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"}
|
|
@ -0,0 +1,191 @@
|
||||||
|
import { n as nextTick, k as elementTransitionEnd } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
|
||||||
|
function Controller(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
controller: {
|
||||||
|
control: undefined,
|
||||||
|
inverse: false,
|
||||||
|
by: 'slide' // or 'container'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
swiper.controller = {
|
||||||
|
control: undefined
|
||||||
|
};
|
||||||
|
function LinearSpline(x, y) {
|
||||||
|
const binarySearch = function search() {
|
||||||
|
let maxIndex;
|
||||||
|
let minIndex;
|
||||||
|
let guess;
|
||||||
|
return (array, val) => {
|
||||||
|
minIndex = -1;
|
||||||
|
maxIndex = array.length;
|
||||||
|
while (maxIndex - minIndex > 1) {
|
||||||
|
guess = maxIndex + minIndex >> 1;
|
||||||
|
if (array[guess] <= val) {
|
||||||
|
minIndex = guess;
|
||||||
|
} else {
|
||||||
|
maxIndex = guess;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maxIndex;
|
||||||
|
};
|
||||||
|
}();
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.lastIndex = x.length - 1;
|
||||||
|
// Given an x value (x2), return the expected y2 value:
|
||||||
|
// (x1,y1) is the known point before given value,
|
||||||
|
// (x3,y3) is the known point after given value.
|
||||||
|
let i1;
|
||||||
|
let i3;
|
||||||
|
this.interpolate = function interpolate(x2) {
|
||||||
|
if (!x2) return 0;
|
||||||
|
|
||||||
|
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
||||||
|
i3 = binarySearch(this.x, x2);
|
||||||
|
i1 = i3 - 1;
|
||||||
|
|
||||||
|
// We have our indexes i1 & i3, so we can calculate already:
|
||||||
|
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
||||||
|
return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
|
||||||
|
};
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
function getInterpolateFunction(c) {
|
||||||
|
swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid);
|
||||||
|
}
|
||||||
|
function setTranslate(_t, byController) {
|
||||||
|
const controlled = swiper.controller.control;
|
||||||
|
let multiplier;
|
||||||
|
let controlledTranslate;
|
||||||
|
const Swiper = swiper.constructor;
|
||||||
|
function setControlledTranslate(c) {
|
||||||
|
if (c.destroyed) return;
|
||||||
|
|
||||||
|
// this will create an Interpolate function based on the snapGrids
|
||||||
|
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
||||||
|
// it makes sense to create this only once and recall it for the interpolation
|
||||||
|
// the function does a lot of value caching for performance
|
||||||
|
const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
|
||||||
|
if (swiper.params.controller.by === 'slide') {
|
||||||
|
getInterpolateFunction(c);
|
||||||
|
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
||||||
|
// but it did not work out
|
||||||
|
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
|
||||||
|
}
|
||||||
|
if (!controlledTranslate || swiper.params.controller.by === 'container') {
|
||||||
|
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
|
||||||
|
if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) {
|
||||||
|
multiplier = 1;
|
||||||
|
}
|
||||||
|
controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
|
||||||
|
}
|
||||||
|
if (swiper.params.controller.inverse) {
|
||||||
|
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
||||||
|
}
|
||||||
|
c.updateProgress(controlledTranslate);
|
||||||
|
c.setTranslate(controlledTranslate, swiper);
|
||||||
|
c.updateActiveIndex();
|
||||||
|
c.updateSlidesClasses();
|
||||||
|
}
|
||||||
|
if (Array.isArray(controlled)) {
|
||||||
|
for (let i = 0; i < controlled.length; i += 1) {
|
||||||
|
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||||
|
setControlledTranslate(controlled[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||||
|
setControlledTranslate(controlled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function setTransition(duration, byController) {
|
||||||
|
const Swiper = swiper.constructor;
|
||||||
|
const controlled = swiper.controller.control;
|
||||||
|
let i;
|
||||||
|
function setControlledTransition(c) {
|
||||||
|
if (c.destroyed) return;
|
||||||
|
c.setTransition(duration, swiper);
|
||||||
|
if (duration !== 0) {
|
||||||
|
c.transitionStart();
|
||||||
|
if (c.params.autoHeight) {
|
||||||
|
nextTick(() => {
|
||||||
|
c.updateAutoHeight();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
elementTransitionEnd(c.wrapperEl, () => {
|
||||||
|
if (!controlled) return;
|
||||||
|
c.transitionEnd();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Array.isArray(controlled)) {
|
||||||
|
for (i = 0; i < controlled.length; i += 1) {
|
||||||
|
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||||
|
setControlledTransition(controlled[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||||
|
setControlledTransition(controlled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function removeSpline() {
|
||||||
|
if (!swiper.controller.control) return;
|
||||||
|
if (swiper.controller.spline) {
|
||||||
|
swiper.controller.spline = undefined;
|
||||||
|
delete swiper.controller.spline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
on('beforeInit', () => {
|
||||||
|
if (typeof window !== 'undefined' && (
|
||||||
|
// eslint-disable-line
|
||||||
|
typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) {
|
||||||
|
const controlElements = typeof swiper.params.controller.control === 'string' ? [...document.querySelectorAll(swiper.params.controller.control)] : [swiper.params.controller.control];
|
||||||
|
controlElements.forEach(controlElement => {
|
||||||
|
if (!swiper.controller.control) swiper.controller.control = [];
|
||||||
|
if (controlElement && controlElement.swiper) {
|
||||||
|
swiper.controller.control.push(controlElement.swiper);
|
||||||
|
} else if (controlElement) {
|
||||||
|
const eventName = `${swiper.params.eventsPrefix}init`;
|
||||||
|
const onControllerSwiper = e => {
|
||||||
|
swiper.controller.control.push(e.detail[0]);
|
||||||
|
swiper.update();
|
||||||
|
controlElement.removeEventListener(eventName, onControllerSwiper);
|
||||||
|
};
|
||||||
|
controlElement.addEventListener(eventName, onControllerSwiper);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
swiper.controller.control = swiper.params.controller.control;
|
||||||
|
});
|
||||||
|
on('update', () => {
|
||||||
|
removeSpline();
|
||||||
|
});
|
||||||
|
on('resize', () => {
|
||||||
|
removeSpline();
|
||||||
|
});
|
||||||
|
on('observerUpdate', () => {
|
||||||
|
removeSpline();
|
||||||
|
});
|
||||||
|
on('setTranslate', (_s, translate, byController) => {
|
||||||
|
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
|
||||||
|
swiper.controller.setTranslate(translate, byController);
|
||||||
|
});
|
||||||
|
on('setTransition', (_s, duration, byController) => {
|
||||||
|
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
|
||||||
|
swiper.controller.setTransition(duration, byController);
|
||||||
|
});
|
||||||
|
Object.assign(swiper.controller, {
|
||||||
|
setTranslate,
|
||||||
|
setTransition
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Controller as default };
|
|
@ -0,0 +1,9 @@
|
||||||
|
.swiper-cards {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-cards ::slotted(swiper-slide) {
|
||||||
|
transform-origin: center bottom;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cards-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cards-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-cards{overflow:visible}.swiper-cards ::slotted(swiper-slide){transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}
|
|
@ -0,0 +1,9 @@
|
||||||
|
.swiper-cards {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-cards .swiper-slide {
|
||||||
|
transform-origin: center bottom;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
.swiper-cards {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
transform-origin: center bottom;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cards.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cards.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-cards{overflow:visible}.swiper-cards .swiper-slide{transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl}from"../shared/utils.min.mjs";function EffectCards(e){let{swiper:t,extendParams:a,on:s}=e;a({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});effectInit({effect:"cards",swiper:t,on:s,setTranslate:()=>{const{slides:e,activeIndex:a,rtlTranslate:s}=t,r=t.params.cardsEffect,{startTranslate:i,isTouched:n}=t.touchEventsData,o=s?-t.translate:t.translate;for(let l=0;l<e.length;l+=1){const d=e[l],f=d.progress,c=Math.min(Math.max(f,-4),4);let m=d.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(m-=e[0].swiperSlideOffset);let p=t.params.cssMode?-m-t.translate:-m,h=0;const M=-100*Math.abs(c);let u=1,w=-r.perSlideRotate*c,S=r.perSlideOffset-.75*Math.abs(c);const $=t.virtual&&t.params.virtual.enabled?t.virtual.from+l:l,E=($===a||$===a-1)&&c>0&&c<1&&(n||t.params.cssMode)&&o<i,T=($===a||$===a+1)&&c<0&&c>-1&&(n||t.params.cssMode)&&o>i;if(E||T){const e=(1-Math.abs((Math.abs(c)-.5)/.5))**.5;w+=-28*c*e,u+=-.5*e,S+=96*e,h=-25*e*Math.abs(c)+"%"}if(p=c<0?`calc(${p}px ${s?"-":"+"} (${S*Math.abs(c)}%))`:c>0?`calc(${p}px ${s?"-":"+"} (-${S*Math.abs(c)}%))`:`${p}px`,!t.isHorizontal()){const e=h;h=p,p=e}const g=c<0?""+(1+(1-u)*c):""+(1-(1-u)*c),x=`\n translate3d(${p}, ${h}, ${M}px)\n rotateZ(${r.rotate?s?-w:w:0}deg)\n scale(${g})\n `;if(r.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=createShadow("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(c)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(f))+e.length;effectTarget(r,d).style.transform=x}},setTransition:e=>{const a=t.slides.map((e=>getSlideTransformEl(e)));a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:a})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}export{EffectCards as default};
|
||||||
|
//# sourceMappingURL=effect-cards.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-cards.mjs.mjs","names":["createShadow","effectInit","effectTarget","effectVirtualTransitionEnd","getSlideTransformEl","EffectCards","_ref","swiper","extendParams","on","cardsEffect","slideShadows","rotate","perSlideRotate","perSlideOffset","effect","setTranslate","slides","activeIndex","rtlTranslate","rtl","params","startTranslate","isTouched","touchEventsData","currentTranslate","translate","i","length","slideEl","slideProgress","progress","Math","min","max","offset","swiperSlideOffset","centeredSlides","cssMode","wrapperEl","style","transform","minTranslate","tX","tY","tZ","abs","scale","tXAdd","slideIndex","virtual","enabled","from","isSwipeToNext","isSwipeToPrev","subProgress","isHorizontal","prevY","scaleString","shadowEl","querySelector","opacity","zIndex","round","setTransition","duration","transformElements","map","forEach","el","transitionDuration","querySelectorAll","perspective","overwriteParams","watchSlidesProgress","virtualTranslate"],"sources":["0"],"mappings":"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"}
|
|
@ -0,0 +1,125 @@
|
||||||
|
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||||
|
import { e as effectVirtualTransitionEnd } from '../shared/effect-virtual-transition-end.mjs';
|
||||||
|
import { g as getSlideTransformEl } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectCards(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
cardsEffect: {
|
||||||
|
slideShadows: true,
|
||||||
|
rotate: true,
|
||||||
|
perSlideRotate: 2,
|
||||||
|
perSlideOffset: 8
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
slides,
|
||||||
|
activeIndex,
|
||||||
|
rtlTranslate: rtl
|
||||||
|
} = swiper;
|
||||||
|
const params = swiper.params.cardsEffect;
|
||||||
|
const {
|
||||||
|
startTranslate,
|
||||||
|
isTouched
|
||||||
|
} = swiper.touchEventsData;
|
||||||
|
const currentTranslate = rtl ? -swiper.translate : swiper.translate;
|
||||||
|
for (let i = 0; i < slides.length; i += 1) {
|
||||||
|
const slideEl = slides[i];
|
||||||
|
const slideProgress = slideEl.progress;
|
||||||
|
const progress = Math.min(Math.max(slideProgress, -4), 4);
|
||||||
|
let offset = slideEl.swiperSlideOffset;
|
||||||
|
if (swiper.params.centeredSlides && !swiper.params.cssMode) {
|
||||||
|
swiper.wrapperEl.style.transform = `translateX(${swiper.minTranslate()}px)`;
|
||||||
|
}
|
||||||
|
if (swiper.params.centeredSlides && swiper.params.cssMode) {
|
||||||
|
offset -= slides[0].swiperSlideOffset;
|
||||||
|
}
|
||||||
|
let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset;
|
||||||
|
let tY = 0;
|
||||||
|
const tZ = -100 * Math.abs(progress);
|
||||||
|
let scale = 1;
|
||||||
|
let rotate = -params.perSlideRotate * progress;
|
||||||
|
let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75;
|
||||||
|
const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i;
|
||||||
|
const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate;
|
||||||
|
const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate;
|
||||||
|
if (isSwipeToNext || isSwipeToPrev) {
|
||||||
|
const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5;
|
||||||
|
rotate += -28 * progress * subProgress;
|
||||||
|
scale += -0.5 * subProgress;
|
||||||
|
tXAdd += 96 * subProgress;
|
||||||
|
tY = `${-25 * subProgress * Math.abs(progress)}%`;
|
||||||
|
}
|
||||||
|
if (progress < 0) {
|
||||||
|
// next
|
||||||
|
tX = `calc(${tX}px ${rtl ? '-' : '+'} (${tXAdd * Math.abs(progress)}%))`;
|
||||||
|
} else if (progress > 0) {
|
||||||
|
// prev
|
||||||
|
tX = `calc(${tX}px ${rtl ? '-' : '+'} (-${tXAdd * Math.abs(progress)}%))`;
|
||||||
|
} else {
|
||||||
|
tX = `${tX}px`;
|
||||||
|
}
|
||||||
|
if (!swiper.isHorizontal()) {
|
||||||
|
const prevY = tY;
|
||||||
|
tY = tX;
|
||||||
|
tX = prevY;
|
||||||
|
}
|
||||||
|
const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`;
|
||||||
|
|
||||||
|
/* eslint-disable */
|
||||||
|
const transform = `
|
||||||
|
translate3d(${tX}, ${tY}, ${tZ}px)
|
||||||
|
rotateZ(${params.rotate ? rtl ? -rotate : rotate : 0}deg)
|
||||||
|
scale(${scaleString})
|
||||||
|
`;
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
|
if (params.slideShadows) {
|
||||||
|
// Set shadows
|
||||||
|
let shadowEl = slideEl.querySelector('.swiper-slide-shadow');
|
||||||
|
if (!shadowEl) {
|
||||||
|
shadowEl = createShadow('cards', slideEl);
|
||||||
|
}
|
||||||
|
if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1);
|
||||||
|
}
|
||||||
|
slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;
|
||||||
|
const targetEl = effectTarget(params, slideEl);
|
||||||
|
targetEl.style.transform = transform;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||||
|
transformElements.forEach(el => {
|
||||||
|
el.style.transitionDuration = `${duration}ms`;
|
||||||
|
el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {
|
||||||
|
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
effectVirtualTransitionEnd({
|
||||||
|
swiper,
|
||||||
|
duration,
|
||||||
|
transformElements
|
||||||
|
});
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'cards',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
perspective: () => true,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
watchSlidesProgress: true,
|
||||||
|
virtualTranslate: !swiper.params.cssMode
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectCards as default };
|
|
@ -0,0 +1,8 @@
|
||||||
|
.swiper-cards {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
transform-origin: center bottom;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
.swiper-coverflow {
|
||||||
|
}
|
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-coverflow.min.css
vendored
Normal file
0
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-coverflow.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{g as getSlideTransformEl,o as getRotateFix}from"../shared/utils.min.mjs";function EffectCoverflow(e){let{swiper:t,extendParams:s,on:r}=e;s({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}});effectInit({effect:"coverflow",swiper:t,on:r,setTranslate:()=>{const{width:e,height:s,slides:r,slidesSizesGrid:o}=t,a=t.params.coverflowEffect,i=t.isHorizontal(),l=t.translate,f=i?e/2-l:s/2-l,d=i?a.rotate:-a.rotate,c=a.depth,h=getRotateFix(t);for(let e=0,t=r.length;e<t;e+=1){const t=r[e],s=o[e],l=(f-t.swiperSlideOffset-s/2)/s,n="function"==typeof a.modifier?a.modifier(l):l*a.modifier;let w=i?d*n:0,p=i?0:d*n,m=-c*Math.abs(n),g=a.stretch;"string"==typeof g&&-1!==g.indexOf("%")&&(g=parseFloat(a.stretch)/100*s);let y=i?0:g*n,S=i?g*n:0,b=1-(1-a.scale)*Math.abs(n);Math.abs(S)<.001&&(S=0),Math.abs(y)<.001&&(y=0),Math.abs(m)<.001&&(m=0),Math.abs(w)<.001&&(w=0),Math.abs(p)<.001&&(p=0),Math.abs(b)<.001&&(b=0);const u=`translate3d(${S}px,${y}px,${m}px) rotateX(${h(p)}deg) rotateY(${h(w)}deg) scale(${b})`;if(effectTarget(a,t).style.transform=u,t.style.zIndex=1-Math.abs(Math.round(n)),a.slideShadows){let e=i?t.querySelector(".swiper-slide-shadow-left"):t.querySelector(".swiper-slide-shadow-top"),s=i?t.querySelector(".swiper-slide-shadow-right"):t.querySelector(".swiper-slide-shadow-bottom");e||(e=createShadow("coverflow",t,i?"left":"top")),s||(s=createShadow("coverflow",t,i?"right":"bottom")),e&&(e.style.opacity=n>0?n:0),s&&(s.style.opacity=-n>0?-n:0)}}},setTransition:e=>{t.slides.map((e=>getSlideTransformEl(e))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}export{EffectCoverflow as default};
|
||||||
|
//# sourceMappingURL=effect-coverflow.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-coverflow.mjs.mjs","names":["createShadow","effectInit","effectTarget","getSlideTransformEl","getRotateFix","EffectCoverflow","_ref","swiper","extendParams","on","coverflowEffect","rotate","stretch","depth","scale","modifier","slideShadows","effect","setTranslate","width","swiperWidth","height","swiperHeight","slides","slidesSizesGrid","params","isHorizontal","transform","translate","center","r","i","length","slideEl","slideSize","centerOffset","swiperSlideOffset","offsetMultiplier","rotateY","rotateX","translateZ","Math","abs","indexOf","parseFloat","translateY","translateX","slideTransform","style","zIndex","round","shadowBeforeEl","querySelector","shadowAfterEl","opacity","setTransition","duration","map","forEach","el","transitionDuration","querySelectorAll","shadowEl","perspective","overwriteParams","watchSlidesProgress"],"sources":["0"],"mappings":"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"}
|
|
@ -0,0 +1,104 @@
|
||||||
|
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||||
|
import { g as getSlideTransformEl, o as getRotateFix } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectCoverflow(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
coverflowEffect: {
|
||||||
|
rotate: 50,
|
||||||
|
stretch: 0,
|
||||||
|
depth: 100,
|
||||||
|
scale: 1,
|
||||||
|
modifier: 1,
|
||||||
|
slideShadows: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
width: swiperWidth,
|
||||||
|
height: swiperHeight,
|
||||||
|
slides,
|
||||||
|
slidesSizesGrid
|
||||||
|
} = swiper;
|
||||||
|
const params = swiper.params.coverflowEffect;
|
||||||
|
const isHorizontal = swiper.isHorizontal();
|
||||||
|
const transform = swiper.translate;
|
||||||
|
const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;
|
||||||
|
const rotate = isHorizontal ? params.rotate : -params.rotate;
|
||||||
|
const translate = params.depth;
|
||||||
|
const r = getRotateFix(swiper);
|
||||||
|
// Each slide offset from center
|
||||||
|
for (let i = 0, length = slides.length; i < length; i += 1) {
|
||||||
|
const slideEl = slides[i];
|
||||||
|
const slideSize = slidesSizesGrid[i];
|
||||||
|
const slideOffset = slideEl.swiperSlideOffset;
|
||||||
|
const centerOffset = (center - slideOffset - slideSize / 2) / slideSize;
|
||||||
|
const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier;
|
||||||
|
let rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
|
||||||
|
let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;
|
||||||
|
// var rotateZ = 0
|
||||||
|
let translateZ = -translate * Math.abs(offsetMultiplier);
|
||||||
|
let stretch = params.stretch;
|
||||||
|
// Allow percentage to make a relative stretch for responsive sliders
|
||||||
|
if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {
|
||||||
|
stretch = parseFloat(params.stretch) / 100 * slideSize;
|
||||||
|
}
|
||||||
|
let translateY = isHorizontal ? 0 : stretch * offsetMultiplier;
|
||||||
|
let translateX = isHorizontal ? stretch * offsetMultiplier : 0;
|
||||||
|
let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier);
|
||||||
|
|
||||||
|
// Fix for ultra small values
|
||||||
|
if (Math.abs(translateX) < 0.001) translateX = 0;
|
||||||
|
if (Math.abs(translateY) < 0.001) translateY = 0;
|
||||||
|
if (Math.abs(translateZ) < 0.001) translateZ = 0;
|
||||||
|
if (Math.abs(rotateY) < 0.001) rotateY = 0;
|
||||||
|
if (Math.abs(rotateX) < 0.001) rotateX = 0;
|
||||||
|
if (Math.abs(scale) < 0.001) scale = 0;
|
||||||
|
const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${r(rotateX)}deg) rotateY(${r(rotateY)}deg) scale(${scale})`;
|
||||||
|
const targetEl = effectTarget(params, slideEl);
|
||||||
|
targetEl.style.transform = slideTransform;
|
||||||
|
slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
|
||||||
|
if (params.slideShadows) {
|
||||||
|
// Set shadows
|
||||||
|
let shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
|
||||||
|
let shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
|
||||||
|
if (!shadowBeforeEl) {
|
||||||
|
shadowBeforeEl = createShadow('coverflow', slideEl, isHorizontal ? 'left' : 'top');
|
||||||
|
}
|
||||||
|
if (!shadowAfterEl) {
|
||||||
|
shadowAfterEl = createShadow('coverflow', slideEl, isHorizontal ? 'right' : 'bottom');
|
||||||
|
}
|
||||||
|
if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
|
||||||
|
if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||||
|
transformElements.forEach(el => {
|
||||||
|
el.style.transitionDuration = `${duration}ms`;
|
||||||
|
el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {
|
||||||
|
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'coverflow',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
perspective: () => true,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
watchSlidesProgress: true
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectCoverflow as default };
|
|
@ -0,0 +1,2 @@
|
||||||
|
.swiper-coverflow {
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
.swiper-creative ::slotted(swiper-slide) {
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
transition-property: transform, opacity, height;
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
.swiper-creative ::slotted(swiper-slide){-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}
|
|
@ -0,0 +1,6 @@
|
||||||
|
.swiper-creative .swiper-slide {
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
transition-property: transform, opacity, height;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
.swiper-creative {
|
||||||
|
.swiper-slide {
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
transition-property: transform, opacity, height;
|
||||||
|
}
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-creative.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-creative.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-creative .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl,o as getRotateFix}from"../shared/utils.min.mjs";function EffectCreative(e){let{swiper:t,extendParams:s,on:r}=e;s({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const a=e=>"string"==typeof e?e:`${e}px`;effectInit({effect:"creative",swiper:t,on:r,setTranslate:()=>{const{slides:e,wrapperEl:s,slidesSizesGrid:r}=t,i=t.params.creativeEffect,{progressMultiplier:o}=i,l=t.params.centeredSlides,n=getRotateFix(t);if(l){const e=r[0]/2-t.params.slidesOffsetBefore||0;s.style.transform=`translateX(calc(50% - ${e}px))`}for(let s=0;s<e.length;s+=1){const r=e[s],c=r.progress,f=Math.min(Math.max(r.progress,-i.limitProgress),i.limitProgress);let m=f;l||(m=Math.min(Math.max(r.originalProgress,-i.limitProgress),i.limitProgress));const p=r.swiperSlideOffset,d=[t.params.cssMode?-p-t.translate:-p,0,0],g=[0,0,0];let h=!1;t.isHorizontal()||(d[1]=d[0],d[0]=0);let w={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};f<0?(w=i.next,h=!0):f>0&&(w=i.prev,h=!0),d.forEach(((e,t)=>{d[t]=`calc(${e}px + (${a(w.translate[t])} * ${Math.abs(f*o)}))`})),g.forEach(((e,t)=>{let s=w.rotate[t]*Math.abs(f*o);g[t]=s})),r.style.zIndex=-Math.abs(Math.round(c))+e.length;const y=d.join(", "),u=`rotateX(${n(g[0])}deg) rotateY(${n(g[1])}deg) rotateZ(${n(g[2])}deg)`,v=m<0?`scale(${1+(1-w.scale)*m*o})`:`scale(${1-(1-w.scale)*m*o})`,E=m<0?1+(1-w.opacity)*m*o:1-(1-w.opacity)*m*o,M=`translate3d(${y}) ${u} ${v}`;if(h&&w.shadow||!h){let e=r.querySelector(".swiper-slide-shadow");if(!e&&w.shadow&&(e=createShadow("creative",r)),e){const t=i.shadowPerProgress?f*(1/i.limitProgress):f;e.style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const $=effectTarget(i,r);$.style.transform=M,$.style.opacity=E,w.origin&&($.style.transformOrigin=w.origin)}},setTransition:e=>{const s=t.slides.map((e=>getSlideTransformEl(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:s,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}export{EffectCreative as default};
|
||||||
|
//# sourceMappingURL=effect-creative.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-creative.mjs.mjs","names":["createShadow","effectInit","effectTarget","effectVirtualTransitionEnd","getSlideTransformEl","getRotateFix","EffectCreative","_ref","swiper","extendParams","on","creativeEffect","limitProgress","shadowPerProgress","progressMultiplier","perspective","prev","translate","rotate","opacity","scale","next","getTranslateValue","value","effect","setTranslate","slides","wrapperEl","slidesSizesGrid","params","multiplier","isCenteredSlides","centeredSlides","rotateFix","margin","slidesOffsetBefore","style","transform","i","length","slideEl","slideProgress","progress","Math","min","max","originalProgress","offset","swiperSlideOffset","t","cssMode","r","custom","isHorizontal","data","forEach","index","abs","val","zIndex","round","translateString","join","rotateString","scaleString","opacityString","shadow","shadowEl","querySelector","shadowOpacity","targetEl","origin","transformOrigin","setTransition","duration","transformElements","map","el","transitionDuration","querySelectorAll","allSlides","overwriteParams","watchSlidesProgress","virtualTranslate"],"sources":["0"],"mappings":"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"}
|
|
@ -0,0 +1,146 @@
|
||||||
|
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||||
|
import { e as effectVirtualTransitionEnd } from '../shared/effect-virtual-transition-end.mjs';
|
||||||
|
import { g as getSlideTransformEl, o as getRotateFix } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectCreative(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
creativeEffect: {
|
||||||
|
limitProgress: 1,
|
||||||
|
shadowPerProgress: false,
|
||||||
|
progressMultiplier: 1,
|
||||||
|
perspective: true,
|
||||||
|
prev: {
|
||||||
|
translate: [0, 0, 0],
|
||||||
|
rotate: [0, 0, 0],
|
||||||
|
opacity: 1,
|
||||||
|
scale: 1
|
||||||
|
},
|
||||||
|
next: {
|
||||||
|
translate: [0, 0, 0],
|
||||||
|
rotate: [0, 0, 0],
|
||||||
|
opacity: 1,
|
||||||
|
scale: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const getTranslateValue = value => {
|
||||||
|
if (typeof value === 'string') return value;
|
||||||
|
return `${value}px`;
|
||||||
|
};
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
slides,
|
||||||
|
wrapperEl,
|
||||||
|
slidesSizesGrid
|
||||||
|
} = swiper;
|
||||||
|
const params = swiper.params.creativeEffect;
|
||||||
|
const {
|
||||||
|
progressMultiplier: multiplier
|
||||||
|
} = params;
|
||||||
|
const isCenteredSlides = swiper.params.centeredSlides;
|
||||||
|
const rotateFix = getRotateFix(swiper);
|
||||||
|
if (isCenteredSlides) {
|
||||||
|
const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0;
|
||||||
|
wrapperEl.style.transform = `translateX(calc(50% - ${margin}px))`;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < slides.length; i += 1) {
|
||||||
|
const slideEl = slides[i];
|
||||||
|
const slideProgress = slideEl.progress;
|
||||||
|
const progress = Math.min(Math.max(slideEl.progress, -params.limitProgress), params.limitProgress);
|
||||||
|
let originalProgress = progress;
|
||||||
|
if (!isCenteredSlides) {
|
||||||
|
originalProgress = Math.min(Math.max(slideEl.originalProgress, -params.limitProgress), params.limitProgress);
|
||||||
|
}
|
||||||
|
const offset = slideEl.swiperSlideOffset;
|
||||||
|
const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0];
|
||||||
|
const r = [0, 0, 0];
|
||||||
|
let custom = false;
|
||||||
|
if (!swiper.isHorizontal()) {
|
||||||
|
t[1] = t[0];
|
||||||
|
t[0] = 0;
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
translate: [0, 0, 0],
|
||||||
|
rotate: [0, 0, 0],
|
||||||
|
scale: 1,
|
||||||
|
opacity: 1
|
||||||
|
};
|
||||||
|
if (progress < 0) {
|
||||||
|
data = params.next;
|
||||||
|
custom = true;
|
||||||
|
} else if (progress > 0) {
|
||||||
|
data = params.prev;
|
||||||
|
custom = true;
|
||||||
|
}
|
||||||
|
// set translate
|
||||||
|
t.forEach((value, index) => {
|
||||||
|
t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`;
|
||||||
|
});
|
||||||
|
// set rotates
|
||||||
|
r.forEach((value, index) => {
|
||||||
|
let val = data.rotate[index] * Math.abs(progress * multiplier);
|
||||||
|
r[index] = val;
|
||||||
|
});
|
||||||
|
slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;
|
||||||
|
const translateString = t.join(', ');
|
||||||
|
const rotateString = `rotateX(${rotateFix(r[0])}deg) rotateY(${rotateFix(r[1])}deg) rotateZ(${rotateFix(r[2])}deg)`;
|
||||||
|
const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`;
|
||||||
|
const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier;
|
||||||
|
const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`;
|
||||||
|
|
||||||
|
// Set shadows
|
||||||
|
if (custom && data.shadow || !custom) {
|
||||||
|
let shadowEl = slideEl.querySelector('.swiper-slide-shadow');
|
||||||
|
if (!shadowEl && data.shadow) {
|
||||||
|
shadowEl = createShadow('creative', slideEl);
|
||||||
|
}
|
||||||
|
if (shadowEl) {
|
||||||
|
const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress;
|
||||||
|
shadowEl.style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const targetEl = effectTarget(params, slideEl);
|
||||||
|
targetEl.style.transform = transform;
|
||||||
|
targetEl.style.opacity = opacityString;
|
||||||
|
if (data.origin) {
|
||||||
|
targetEl.style.transformOrigin = data.origin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||||
|
transformElements.forEach(el => {
|
||||||
|
el.style.transitionDuration = `${duration}ms`;
|
||||||
|
el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {
|
||||||
|
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
effectVirtualTransitionEnd({
|
||||||
|
swiper,
|
||||||
|
duration,
|
||||||
|
transformElements,
|
||||||
|
allSlides: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'creative',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
perspective: () => swiper.params.creativeEffect.perspective,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
watchSlidesProgress: true,
|
||||||
|
virtualTranslate: !swiper.params.cssMode
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectCreative as default };
|
|
@ -0,0 +1,7 @@
|
||||||
|
.swiper-creative {
|
||||||
|
.swiper-slide {
|
||||||
|
backface-visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
transition-property: transform, opacity, height;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
.swiper-cube {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-cube ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
visibility: hidden;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.swiper-cube ::slotted(swiper-slide) ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-cube.swiper-rtl ::slotted(swiper-slide) {
|
||||||
|
transform-origin: 100% 0;
|
||||||
|
}
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-active),
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active) {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-active),
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-next),
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-prev) {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-cube-shadow {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0.6;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-cube-shadow:before {
|
||||||
|
content: '';
|
||||||
|
background: #000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
filter: blur(50px);
|
||||||
|
}
|
||||||
|
.swiper-cube ::slotted(.swiper-slide-next) + ::slotted(swiper-slide) {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
/* Cube slide shadows start *//* Cube slide shadows end */
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cube-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cube-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-cube{overflow:visible}.swiper-cube ::slotted(swiper-slide){pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;transform-origin:0 0;width:100%;height:100%}.swiper-cube ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-cube.swiper-rtl ::slotted(swiper-slide){transform-origin:100% 0}.swiper-cube ::slotted(.swiper-slide-active),.swiper-cube ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}.swiper-cube ::slotted(.swiper-slide-active),.swiper-cube ::slotted(.swiper-slide-next),.swiper-cube ::slotted(.swiper-slide-prev){pointer-events:auto;visibility:visible}.swiper-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:.6;z-index:0}.swiper-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;filter:blur(50px)}.swiper-cube ::slotted(.swiper-slide-next)+::slotted(swiper-slide){pointer-events:auto;visibility:visible}
|
|
@ -0,0 +1,62 @@
|
||||||
|
.swiper-cube {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
visibility: hidden;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-slide .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-cube.swiper-rtl .swiper-slide {
|
||||||
|
transform-origin: 100% 0;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-slide-active,
|
||||||
|
.swiper-cube .swiper-slide-active .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-slide-active,
|
||||||
|
.swiper-cube .swiper-slide-next,
|
||||||
|
.swiper-cube .swiper-slide-prev {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-cube-shadow {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0.6;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-cube-shadow:before {
|
||||||
|
content: '';
|
||||||
|
background: #000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
filter: blur(50px);
|
||||||
|
}
|
||||||
|
.swiper-cube .swiper-slide-next + .swiper-slide {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
/* Cube slide shadows start */
|
||||||
|
.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-top,
|
||||||
|
.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-left,
|
||||||
|
.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
/* Cube slide shadows end */
|
|
@ -0,0 +1,69 @@
|
||||||
|
.swiper-cube {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
visibility: hidden;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.swiper-rtl .swiper-slide {
|
||||||
|
transform-origin: 100% 0;
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
&,
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active,
|
||||||
|
.swiper-slide-next,
|
||||||
|
.swiper-slide-prev {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-cube-shadow {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0.6;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
background: #000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
-webkit-filter: blur(50px);
|
||||||
|
filter: blur(50px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-cube {
|
||||||
|
.swiper-slide-next + .swiper-slide {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Cube slide shadows start */
|
||||||
|
.swiper-cube {
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-top,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-left,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Cube slide shadows end */
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cube.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-cube.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-cube{overflow:visible}.swiper-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;transform-origin:0 0;width:100%;height:100%}.swiper-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-cube.swiper-rtl .swiper-slide{transform-origin:100% 0}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-next,.swiper-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:.6;z-index:0}.swiper-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;filter:blur(50px)}.swiper-cube .swiper-slide-next+.swiper-slide{pointer-events:auto;visibility:visible}.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-bottom,.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-left,.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-right,.swiper-cube .swiper-slide-shadow-cube.swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{e as effectInit}from"../shared/effect-init.min.mjs";import{c as createElement,o as getRotateFix}from"../shared/utils.min.mjs";function EffectCube(e){let{swiper:t,extendParams:s,on:a}=e;s({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const r=(e,t,s)=>{let a=s?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),r=s?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=createElement("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"left":"top")).split(" ")),e.append(a)),r||(r=createElement("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"right":"bottom")).split(" ")),e.append(r)),a&&(a.style.opacity=Math.max(-t,0)),r&&(r.style.opacity=Math.max(t,0))};effectInit({effect:"cube",swiper:t,on:a,setTranslate:()=>{const{el:e,wrapperEl:s,slides:a,width:o,height:i,rtlTranslate:l,size:d,browser:n}=t,p=getRotateFix(t),c=t.params.cubeEffect,w=t.isHorizontal(),h=t.virtual&&t.params.virtual.enabled;let f,m=0;c.shadow&&(w?(f=t.wrapperEl.querySelector(".swiper-cube-shadow"),f||(f=createElement("div","swiper-cube-shadow"),t.wrapperEl.append(f)),f.style.height=`${o}px`):(f=e.querySelector(".swiper-cube-shadow"),f||(f=createElement("div","swiper-cube-shadow"),e.append(f))));for(let e=0;e<a.length;e+=1){const t=a[e];let s=e;h&&(s=parseInt(t.getAttribute("data-swiper-slide-index"),10));let o=90*s,i=Math.floor(o/360);l&&(o=-o,i=Math.floor(-o/360));const n=Math.max(Math.min(t.progress,1),-1);let f=0,u=0,b=0;s%4==0?(f=4*-i*d,b=0):(s-1)%4==0?(f=0,b=4*-i*d):(s-2)%4==0?(f=d+4*i*d,b=d):(s-3)%4==0&&(f=-d,b=3*d+4*d*i),l&&(f=-f),w||(u=f,f=0);const x=`rotateX(${p(w?0:-o)}deg) rotateY(${p(w?o:0)}deg) translate3d(${f}px, ${u}px, ${b}px)`;n<=1&&n>-1&&(m=90*s+90*n,l&&(m=90*-s-90*n)),t.style.transform=x,c.slideShadows&&r(t,n,w)}if(s.style.transformOrigin=`50% 50% -${d/2}px`,s.style["-webkit-transform-origin"]=`50% 50% -${d/2}px`,c.shadow)if(w)f.style.transform=`translate3d(0px, ${o/2+c.shadowOffset}px, ${-o/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${c.shadowScale})`;else{const e=Math.abs(m)-90*Math.floor(Math.abs(m)/90),t=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),s=c.shadowScale,a=c.shadowScale/t,r=c.shadowOffset;f.style.transform=`scale3d(${s}, 1, ${a}) translate3d(0px, ${i/2+r}px, ${-i/2/a}px) rotateX(-89.99deg)`}const u=(n.isSafari||n.isWebView)&&n.needPerspectiveFix?-d/2:0;s.style.transform=`translate3d(0px,0,${u}px) rotateX(${p(t.isHorizontal()?0:m)}deg) rotateY(${p(t.isHorizontal()?-m:0)}deg)`,s.style.setProperty("--swiper-cube-translate-z",`${u}px`)},setTransition:e=>{const{el:s,slides:a}=t;if(a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),t.params.cubeEffect.shadow&&!t.isHorizontal()){const t=s.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=t.isHorizontal();t.slides.forEach((t=>{const s=Math.max(Math.min(t.progress,1),-1);r(t,s,e)}))},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})}export{EffectCube as default};
|
||||||
|
//# sourceMappingURL=effect-cube.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-cube.mjs.mjs","names":["effectInit","createElement","getRotateFix","EffectCube","_ref","swiper","extendParams","on","cubeEffect","slideShadows","shadow","shadowOffset","shadowScale","createSlideShadows","slideEl","progress","isHorizontal","shadowBefore","querySelector","shadowAfter","split","append","style","opacity","Math","max","effect","setTranslate","el","wrapperEl","slides","width","swiperWidth","height","swiperHeight","rtlTranslate","rtl","size","swiperSize","browser","r","params","isVirtual","virtual","enabled","cubeShadowEl","wrapperRotate","i","length","slideIndex","parseInt","getAttribute","slideAngle","round","floor","min","tx","ty","tz","transform","transformOrigin","shadowAngle","abs","multiplier","sin","PI","cos","scale1","scale2","offset","zFactor","isSafari","isWebView","needPerspectiveFix","setProperty","setTransition","duration","forEach","transitionDuration","querySelectorAll","subEl","shadowEl","recreateShadows","getEffectParams","perspective","overwriteParams","slidesPerView","slidesPerGroup","watchSlidesProgress","resistanceRatio","spaceBetween","centeredSlides","virtualTranslate"],"sources":["0"],"mappings":"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"}
|
|
@ -0,0 +1,174 @@
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { c as createElement, o as getRotateFix } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectCube(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
cubeEffect: {
|
||||||
|
slideShadows: true,
|
||||||
|
shadow: true,
|
||||||
|
shadowOffset: 20,
|
||||||
|
shadowScale: 0.94
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const createSlideShadows = (slideEl, progress, isHorizontal) => {
|
||||||
|
let shadowBefore = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
|
||||||
|
let shadowAfter = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
|
||||||
|
if (!shadowBefore) {
|
||||||
|
shadowBefore = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}`.split(' '));
|
||||||
|
slideEl.append(shadowBefore);
|
||||||
|
}
|
||||||
|
if (!shadowAfter) {
|
||||||
|
shadowAfter = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}`.split(' '));
|
||||||
|
slideEl.append(shadowAfter);
|
||||||
|
}
|
||||||
|
if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);
|
||||||
|
if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);
|
||||||
|
};
|
||||||
|
const recreateShadows = () => {
|
||||||
|
// create new ones
|
||||||
|
const isHorizontal = swiper.isHorizontal();
|
||||||
|
swiper.slides.forEach(slideEl => {
|
||||||
|
const progress = Math.max(Math.min(slideEl.progress, 1), -1);
|
||||||
|
createSlideShadows(slideEl, progress, isHorizontal);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
el,
|
||||||
|
wrapperEl,
|
||||||
|
slides,
|
||||||
|
width: swiperWidth,
|
||||||
|
height: swiperHeight,
|
||||||
|
rtlTranslate: rtl,
|
||||||
|
size: swiperSize,
|
||||||
|
browser
|
||||||
|
} = swiper;
|
||||||
|
const r = getRotateFix(swiper);
|
||||||
|
const params = swiper.params.cubeEffect;
|
||||||
|
const isHorizontal = swiper.isHorizontal();
|
||||||
|
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
||||||
|
let wrapperRotate = 0;
|
||||||
|
let cubeShadowEl;
|
||||||
|
if (params.shadow) {
|
||||||
|
if (isHorizontal) {
|
||||||
|
cubeShadowEl = swiper.wrapperEl.querySelector('.swiper-cube-shadow');
|
||||||
|
if (!cubeShadowEl) {
|
||||||
|
cubeShadowEl = createElement('div', 'swiper-cube-shadow');
|
||||||
|
swiper.wrapperEl.append(cubeShadowEl);
|
||||||
|
}
|
||||||
|
cubeShadowEl.style.height = `${swiperWidth}px`;
|
||||||
|
} else {
|
||||||
|
cubeShadowEl = el.querySelector('.swiper-cube-shadow');
|
||||||
|
if (!cubeShadowEl) {
|
||||||
|
cubeShadowEl = createElement('div', 'swiper-cube-shadow');
|
||||||
|
el.append(cubeShadowEl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < slides.length; i += 1) {
|
||||||
|
const slideEl = slides[i];
|
||||||
|
let slideIndex = i;
|
||||||
|
if (isVirtual) {
|
||||||
|
slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10);
|
||||||
|
}
|
||||||
|
let slideAngle = slideIndex * 90;
|
||||||
|
let round = Math.floor(slideAngle / 360);
|
||||||
|
if (rtl) {
|
||||||
|
slideAngle = -slideAngle;
|
||||||
|
round = Math.floor(-slideAngle / 360);
|
||||||
|
}
|
||||||
|
const progress = Math.max(Math.min(slideEl.progress, 1), -1);
|
||||||
|
let tx = 0;
|
||||||
|
let ty = 0;
|
||||||
|
let tz = 0;
|
||||||
|
if (slideIndex % 4 === 0) {
|
||||||
|
tx = -round * 4 * swiperSize;
|
||||||
|
tz = 0;
|
||||||
|
} else if ((slideIndex - 1) % 4 === 0) {
|
||||||
|
tx = 0;
|
||||||
|
tz = -round * 4 * swiperSize;
|
||||||
|
} else if ((slideIndex - 2) % 4 === 0) {
|
||||||
|
tx = swiperSize + round * 4 * swiperSize;
|
||||||
|
tz = swiperSize;
|
||||||
|
} else if ((slideIndex - 3) % 4 === 0) {
|
||||||
|
tx = -swiperSize;
|
||||||
|
tz = 3 * swiperSize + swiperSize * 4 * round;
|
||||||
|
}
|
||||||
|
if (rtl) {
|
||||||
|
tx = -tx;
|
||||||
|
}
|
||||||
|
if (!isHorizontal) {
|
||||||
|
ty = tx;
|
||||||
|
tx = 0;
|
||||||
|
}
|
||||||
|
const transform = `rotateX(${r(isHorizontal ? 0 : -slideAngle)}deg) rotateY(${r(isHorizontal ? slideAngle : 0)}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`;
|
||||||
|
if (progress <= 1 && progress > -1) {
|
||||||
|
wrapperRotate = slideIndex * 90 + progress * 90;
|
||||||
|
if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90;
|
||||||
|
}
|
||||||
|
slideEl.style.transform = transform;
|
||||||
|
if (params.slideShadows) {
|
||||||
|
createSlideShadows(slideEl, progress, isHorizontal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wrapperEl.style.transformOrigin = `50% 50% -${swiperSize / 2}px`;
|
||||||
|
wrapperEl.style['-webkit-transform-origin'] = `50% 50% -${swiperSize / 2}px`;
|
||||||
|
if (params.shadow) {
|
||||||
|
if (isHorizontal) {
|
||||||
|
cubeShadowEl.style.transform = `translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(89.99deg) rotateZ(0deg) scale(${params.shadowScale})`;
|
||||||
|
} else {
|
||||||
|
const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
|
||||||
|
const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
|
||||||
|
const scale1 = params.shadowScale;
|
||||||
|
const scale2 = params.shadowScale / multiplier;
|
||||||
|
const offset = params.shadowOffset;
|
||||||
|
cubeShadowEl.style.transform = `scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-89.99deg)`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const zFactor = (browser.isSafari || browser.isWebView) && browser.needPerspectiveFix ? -swiperSize / 2 : 0;
|
||||||
|
wrapperEl.style.transform = `translate3d(0px,0,${zFactor}px) rotateX(${r(swiper.isHorizontal() ? 0 : wrapperRotate)}deg) rotateY(${r(swiper.isHorizontal() ? -wrapperRotate : 0)}deg)`;
|
||||||
|
wrapperEl.style.setProperty('--swiper-cube-translate-z', `${zFactor}px`);
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const {
|
||||||
|
el,
|
||||||
|
slides
|
||||||
|
} = swiper;
|
||||||
|
slides.forEach(slideEl => {
|
||||||
|
slideEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(subEl => {
|
||||||
|
subEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {
|
||||||
|
const shadowEl = el.querySelector('.swiper-cube-shadow');
|
||||||
|
if (shadowEl) shadowEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'cube',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
recreateShadows,
|
||||||
|
getEffectParams: () => swiper.params.cubeEffect,
|
||||||
|
perspective: () => true,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
slidesPerView: 1,
|
||||||
|
slidesPerGroup: 1,
|
||||||
|
watchSlidesProgress: true,
|
||||||
|
resistanceRatio: 0,
|
||||||
|
spaceBetween: 0,
|
||||||
|
centeredSlides: false,
|
||||||
|
virtualTranslate: true
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectCube as default };
|
|
@ -0,0 +1,69 @@
|
||||||
|
.swiper-cube {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
visibility: hidden;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.swiper-rtl .swiper-slide {
|
||||||
|
transform-origin: 100% 0;
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
&,
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active,
|
||||||
|
.swiper-slide-next,
|
||||||
|
.swiper-slide-prev {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-cube-shadow {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0.6;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
background: #000;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
-webkit-filter: blur(50px);
|
||||||
|
filter: blur(50px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-cube {
|
||||||
|
.swiper-slide-next + .swiper-slide {
|
||||||
|
pointer-events: auto;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Cube slide shadows start */
|
||||||
|
.swiper-cube {
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-top,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-left,
|
||||||
|
.swiper-slide-shadow-cube.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Cube slide shadows end */
|
|
@ -0,0 +1,16 @@
|
||||||
|
.swiper-fade.swiper-free-mode ::slotted(swiper-slide) {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
.swiper-fade ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
transition-property: opacity;
|
||||||
|
}
|
||||||
|
.swiper-fade ::slotted(swiper-slide) ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-fade ::slotted(.swiper-slide-active) {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.swiper-fade ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active) {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-fade-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-fade-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-fade.swiper-free-mode ::slotted(swiper-slide){transition-timing-function:ease-out}.swiper-fade ::slotted(swiper-slide){pointer-events:none;transition-property:opacity}.swiper-fade ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-fade ::slotted(.swiper-slide-active){pointer-events:auto}.swiper-fade ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}
|
|
@ -0,0 +1,16 @@
|
||||||
|
.swiper-fade.swiper-free-mode .swiper-slide {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
.swiper-fade .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
transition-property: opacity;
|
||||||
|
}
|
||||||
|
.swiper-fade .swiper-slide .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-fade .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.swiper-fade .swiper-slide-active .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
.swiper-fade {
|
||||||
|
&.swiper-free-mode {
|
||||||
|
.swiper-slide {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
transition-property: opacity;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-fade.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-fade.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-fade.swiper-free-mode .swiper-slide{transition-timing-function:ease-out}.swiper-fade .swiper-slide{pointer-events:none;transition-property:opacity}.swiper-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-fade .swiper-slide-active{pointer-events:auto}.swiper-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl}from"../shared/utils.min.mjs";function EffectFade(e){let{swiper:t,extendParams:s,on:a}=e;s({fadeEffect:{crossFade:!1}});effectInit({effect:"fade",swiper:t,on:a,setTranslate:()=>{const{slides:e}=t,s=t.params.fadeEffect;for(let a=0;a<e.length;a+=1){const e=t.slides[a];let r=-e.swiperSlideOffset;t.params.virtualTranslate||(r-=t.translate);let i=0;t.isHorizontal()||(i=r,r=0);const f=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),n=effectTarget(s,e);n.style.opacity=f,n.style.transform=`translate3d(${r}px, ${i}px, 0px)`}},setTransition:e=>{const s=t.slides.map((e=>getSlideTransformEl(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:s,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}export{EffectFade as default};
|
||||||
|
//# sourceMappingURL=effect-fade.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-fade.mjs.mjs","names":["effectInit","effectTarget","effectVirtualTransitionEnd","getSlideTransformEl","EffectFade","_ref","swiper","extendParams","on","fadeEffect","crossFade","effect","setTranslate","slides","params","i","length","slideEl","tx","swiperSlideOffset","virtualTranslate","translate","ty","isHorizontal","slideOpacity","Math","max","abs","progress","min","targetEl","style","opacity","transform","setTransition","duration","transformElements","map","forEach","el","transitionDuration","allSlides","overwriteParams","slidesPerView","slidesPerGroup","watchSlidesProgress","spaceBetween","cssMode"],"sources":["0"],"mappings":"YAAcA,eAAkB,4CAClBC,iBAAoB,8CACpBC,+BAAkC,8DAClCC,wBAA2B,0BAEzC,SAASC,WAAWC,GAClB,IAAIC,OACFA,EAAMC,aACNA,EAAYC,GACZA,GACEH,EACJE,EAAa,CACXE,WAAY,CACVC,WAAW,KAoCfV,WAAW,CACTW,OAAQ,OACRL,SACAE,KACAI,aArCmB,KACnB,MAAMC,OACJA,GACEP,EACEQ,EAASR,EAAOQ,OAAOL,WAC7B,IAAK,IAAIM,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,GAAK,EAAG,CACzC,MAAME,EAAUX,EAAOO,OAAOE,GAE9B,IAAIG,GADWD,EAAQE,kBAElBb,EAAOQ,OAAOM,mBAAkBF,GAAMZ,EAAOe,WAClD,IAAIC,EAAK,EACJhB,EAAOiB,iBACVD,EAAKJ,EACLA,EAAK,GAEP,MAAMM,EAAelB,EAAOQ,OAAOL,WAAWC,UAAYe,KAAKC,IAAI,EAAID,KAAKE,IAAIV,EAAQW,UAAW,GAAK,EAAIH,KAAKI,IAAIJ,KAAKC,IAAIT,EAAQW,UAAW,GAAI,GAC/IE,EAAW7B,aAAaa,EAAQG,GACtCa,EAASC,MAAMC,QAAUR,EACzBM,EAASC,MAAME,UAAY,eAAef,QAASI,WACrD,GAmBAY,cAjBoBC,IACpB,MAAMC,EAAoB9B,EAAOO,OAAOwB,KAAIpB,GAAWd,oBAAoBc,KAC3EmB,EAAkBE,SAAQC,IACxBA,EAAGR,MAAMS,mBAAqB,GAAGL,KAAY,IAE/CjC,2BAA2B,CACzBI,SACA6B,WACAC,oBACAK,WAAW,GACX,EAQFC,gBAAiB,KAAM,CACrBC,cAAe,EACfC,eAAgB,EAChBC,qBAAqB,EACrBC,aAAc,EACd1B,kBAAmBd,EAAOQ,OAAOiC,WAGvC,QAES3C"}
|
|
@ -0,0 +1,66 @@
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||||
|
import { e as effectVirtualTransitionEnd } from '../shared/effect-virtual-transition-end.mjs';
|
||||||
|
import { g as getSlideTransformEl } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectFade(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
fadeEffect: {
|
||||||
|
crossFade: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
slides
|
||||||
|
} = swiper;
|
||||||
|
const params = swiper.params.fadeEffect;
|
||||||
|
for (let i = 0; i < slides.length; i += 1) {
|
||||||
|
const slideEl = swiper.slides[i];
|
||||||
|
const offset = slideEl.swiperSlideOffset;
|
||||||
|
let tx = -offset;
|
||||||
|
if (!swiper.params.virtualTranslate) tx -= swiper.translate;
|
||||||
|
let ty = 0;
|
||||||
|
if (!swiper.isHorizontal()) {
|
||||||
|
ty = tx;
|
||||||
|
tx = 0;
|
||||||
|
}
|
||||||
|
const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0);
|
||||||
|
const targetEl = effectTarget(params, slideEl);
|
||||||
|
targetEl.style.opacity = slideOpacity;
|
||||||
|
targetEl.style.transform = `translate3d(${tx}px, ${ty}px, 0px)`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||||
|
transformElements.forEach(el => {
|
||||||
|
el.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
effectVirtualTransitionEnd({
|
||||||
|
swiper,
|
||||||
|
duration,
|
||||||
|
transformElements,
|
||||||
|
allSlides: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'fade',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
slidesPerView: 1,
|
||||||
|
slidesPerGroup: 1,
|
||||||
|
watchSlidesProgress: true,
|
||||||
|
spaceBetween: 0,
|
||||||
|
virtualTranslate: !swiper.params.cssMode
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectFade as default };
|
|
@ -0,0 +1,20 @@
|
||||||
|
.swiper-fade {
|
||||||
|
&.swiper-free-mode {
|
||||||
|
.swiper-slide {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
transition-property: opacity;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
&,
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
.swiper-flip {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-flip ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.swiper-flip ::slotted(swiper-slide) ::slotted(swiper-slide) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-flip ::slotted(.swiper-slide-active),
|
||||||
|
.swiper-flip ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active) {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
/* Flip slide shadows start *//* Flip slide shadows end */
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-flip-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-flip-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-flip{overflow:visible}.swiper-flip ::slotted(swiper-slide){pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-flip ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-flip ::slotted(.swiper-slide-active),.swiper-flip ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}
|
|
@ -0,0 +1,26 @@
|
||||||
|
.swiper-flip {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.swiper-flip .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.swiper-flip .swiper-slide .swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.swiper-flip .swiper-slide-active,
|
||||||
|
.swiper-flip .swiper-slide-active .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
/* Flip slide shadows start */
|
||||||
|
.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-top,
|
||||||
|
.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-left,
|
||||||
|
.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
/* Flip slide shadows end */
|
|
@ -0,0 +1,28 @@
|
||||||
|
.swiper-flip {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
&,
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Flip slide shadows start */
|
||||||
|
.swiper-flip {
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-top,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-left,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Flip slide shadows end */
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-flip.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/effect-flip.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-flip{overflow:visible}.swiper-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-flip .swiper-slide-active,.swiper-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-bottom,.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-left,.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-right,.swiper-flip .swiper-slide-shadow-flip.swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl,o as getRotateFix}from"../shared/utils.min.mjs";function EffectFlip(e){let{swiper:t,extendParams:s,on:a}=e;s({flipEffect:{slideShadows:!0,limitRotation:!0}});const r=(e,s)=>{let a=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),r=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=createShadow("flip",e,t.isHorizontal()?"left":"top")),r||(r=createShadow("flip",e,t.isHorizontal()?"right":"bottom")),a&&(a.style.opacity=Math.max(-s,0)),r&&(r.style.opacity=Math.max(s,0))};effectInit({effect:"flip",swiper:t,on:a,setTranslate:()=>{const{slides:e,rtlTranslate:s}=t,a=t.params.flipEffect,i=getRotateFix(t);for(let o=0;o<e.length;o+=1){const l=e[o];let f=l.progress;t.params.flipEffect.limitRotation&&(f=Math.max(Math.min(l.progress,1),-1));const n=l.swiperSlideOffset;let p=-180*f,d=0,m=t.params.cssMode?-n-t.translate:-n,c=0;t.isHorizontal()?s&&(p=-p):(c=m,m=0,d=-p,p=0),l.style.zIndex=-Math.abs(Math.round(f))+e.length,a.slideShadows&&r(l,f);const h=`translate3d(${m}px, ${c}px, 0px) rotateX(${i(d)}deg) rotateY(${i(p)}deg)`;effectTarget(a,l).style.transform=h}},setTransition:e=>{const s=t.slides.map((e=>getSlideTransformEl(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:s})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach((e=>{let s=e.progress;t.params.flipEffect.limitRotation&&(s=Math.max(Math.min(e.progress,1),-1)),r(e,s)}))},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}export{EffectFlip as default};
|
||||||
|
//# sourceMappingURL=effect-flip.min.mjs.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"effect-flip.mjs.mjs","names":["createShadow","effectInit","effectTarget","effectVirtualTransitionEnd","getSlideTransformEl","getRotateFix","EffectFlip","_ref","swiper","extendParams","on","flipEffect","slideShadows","limitRotation","createSlideShadows","slideEl","progress","shadowBefore","isHorizontal","querySelector","shadowAfter","style","opacity","Math","max","effect","setTranslate","slides","rtlTranslate","rtl","params","rotateFix","i","length","min","offset","swiperSlideOffset","rotateY","rotateX","tx","cssMode","translate","ty","zIndex","abs","round","transform","setTransition","duration","transformElements","map","forEach","el","transitionDuration","querySelectorAll","shadowEl","recreateShadows","getEffectParams","perspective","overwriteParams","slidesPerView","slidesPerGroup","watchSlidesProgress","spaceBetween","virtualTranslate"],"sources":["0"],"mappings":"YAAcA,iBAAoB,8CACpBC,eAAkB,4CAClBC,iBAAoB,8CACpBC,+BAAkC,8DAClCC,yBAA0BC,iBAAoB,0BAE5D,SAASC,WAAWC,GAClB,IAAIC,OACFA,EAAMC,aACNA,EAAYC,GACZA,GACEH,EACJE,EAAa,CACXE,WAAY,CACVC,cAAc,EACdC,eAAe,KAGnB,MAAMC,EAAqB,CAACC,EAASC,KACnC,IAAIC,EAAeT,EAAOU,eAAiBH,EAAQI,cAAc,6BAA+BJ,EAAQI,cAAc,4BAClHC,EAAcZ,EAAOU,eAAiBH,EAAQI,cAAc,8BAAgCJ,EAAQI,cAAc,+BACjHF,IACHA,EAAejB,aAAa,OAAQe,EAASP,EAAOU,eAAiB,OAAS,QAE3EE,IACHA,EAAcpB,aAAa,OAAQe,EAASP,EAAOU,eAAiB,QAAU,WAE5ED,IAAcA,EAAaI,MAAMC,QAAUC,KAAKC,KAAKR,EAAU,IAC/DI,IAAaA,EAAYC,MAAMC,QAAUC,KAAKC,IAAIR,EAAU,GAAE,EA+DpEf,WAAW,CACTwB,OAAQ,OACRjB,SACAE,KACAgB,aAtDmB,KACnB,MAAMC,OACJA,EACAC,aAAcC,GACZrB,EACEsB,EAAStB,EAAOsB,OAAOnB,WACvBoB,EAAY1B,aAAaG,GAC/B,IAAK,IAAIwB,EAAI,EAAGA,EAAIL,EAAOM,OAAQD,GAAK,EAAG,CACzC,MAAMjB,EAAUY,EAAOK,GACvB,IAAIhB,EAAWD,EAAQC,SACnBR,EAAOsB,OAAOnB,WAAWE,gBAC3BG,EAAWO,KAAKC,IAAID,KAAKW,IAAInB,EAAQC,SAAU,IAAK,IAEtD,MAAMmB,EAASpB,EAAQqB,kBAEvB,IAAIC,GADY,IAAMrB,EAElBsB,EAAU,EACVC,EAAK/B,EAAOsB,OAAOU,SAAWL,EAAS3B,EAAOiC,WAAaN,EAC3DO,EAAK,EACJlC,EAAOU,eAKDW,IACTQ,GAAWA,IALXK,EAAKH,EACLA,EAAK,EACLD,GAAWD,EACXA,EAAU,GAIZtB,EAAQM,MAAMsB,QAAUpB,KAAKqB,IAAIrB,KAAKsB,MAAM7B,IAAaW,EAAOM,OAC5DH,EAAOlB,cACTE,EAAmBC,EAASC,GAE9B,MAAM8B,EAAY,eAAeP,QAASG,qBAAsBX,EAAUO,kBAAwBP,EAAUM,SAC3FnC,aAAa4B,EAAQf,GAC7BM,MAAMyB,UAAYA,CAC7B,GAqBAC,cAnBoBC,IACpB,MAAMC,EAAoBzC,EAAOmB,OAAOuB,KAAInC,GAAWX,oBAAoBW,KAC3EkC,EAAkBE,SAAQC,IACxBA,EAAG/B,MAAMgC,mBAAqB,GAAGL,MACjCI,EAAGE,iBAAiB,gHAAgHH,SAAQI,IAC1IA,EAASlC,MAAMgC,mBAAqB,GAAGL,KAAY,GACnD,IAEJ7C,2BAA2B,CACzBK,SACAwC,WACAC,qBACA,EAQFO,gBAnEsB,KAEtBhD,EAAOsB,OAAOnB,WACdH,EAAOmB,OAAOwB,SAAQpC,IACpB,IAAIC,EAAWD,EAAQC,SACnBR,EAAOsB,OAAOnB,WAAWE,gBAC3BG,EAAWO,KAAKC,IAAID,KAAKW,IAAInB,EAAQC,SAAU,IAAK,IAEtDF,EAAmBC,EAASC,EAAS,GACrC,EA2DFyC,gBAAiB,IAAMjD,EAAOsB,OAAOnB,WACrC+C,YAAa,KAAM,EACnBC,gBAAiB,KAAM,CACrBC,cAAe,EACfC,eAAgB,EAChBC,qBAAqB,EACrBC,aAAc,EACdC,kBAAmBxD,EAAOsB,OAAOU,WAGvC,QAESlC"}
|
|
@ -0,0 +1,111 @@
|
||||||
|
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||||
|
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||||
|
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||||
|
import { e as effectVirtualTransitionEnd } from '../shared/effect-virtual-transition-end.mjs';
|
||||||
|
import { g as getSlideTransformEl, o as getRotateFix } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function EffectFlip(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
on
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
flipEffect: {
|
||||||
|
slideShadows: true,
|
||||||
|
limitRotation: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const createSlideShadows = (slideEl, progress) => {
|
||||||
|
let shadowBefore = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
|
||||||
|
let shadowAfter = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
|
||||||
|
if (!shadowBefore) {
|
||||||
|
shadowBefore = createShadow('flip', slideEl, swiper.isHorizontal() ? 'left' : 'top');
|
||||||
|
}
|
||||||
|
if (!shadowAfter) {
|
||||||
|
shadowAfter = createShadow('flip', slideEl, swiper.isHorizontal() ? 'right' : 'bottom');
|
||||||
|
}
|
||||||
|
if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);
|
||||||
|
if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);
|
||||||
|
};
|
||||||
|
const recreateShadows = () => {
|
||||||
|
// Set shadows
|
||||||
|
swiper.params.flipEffect;
|
||||||
|
swiper.slides.forEach(slideEl => {
|
||||||
|
let progress = slideEl.progress;
|
||||||
|
if (swiper.params.flipEffect.limitRotation) {
|
||||||
|
progress = Math.max(Math.min(slideEl.progress, 1), -1);
|
||||||
|
}
|
||||||
|
createSlideShadows(slideEl, progress);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const setTranslate = () => {
|
||||||
|
const {
|
||||||
|
slides,
|
||||||
|
rtlTranslate: rtl
|
||||||
|
} = swiper;
|
||||||
|
const params = swiper.params.flipEffect;
|
||||||
|
const rotateFix = getRotateFix(swiper);
|
||||||
|
for (let i = 0; i < slides.length; i += 1) {
|
||||||
|
const slideEl = slides[i];
|
||||||
|
let progress = slideEl.progress;
|
||||||
|
if (swiper.params.flipEffect.limitRotation) {
|
||||||
|
progress = Math.max(Math.min(slideEl.progress, 1), -1);
|
||||||
|
}
|
||||||
|
const offset = slideEl.swiperSlideOffset;
|
||||||
|
const rotate = -180 * progress;
|
||||||
|
let rotateY = rotate;
|
||||||
|
let rotateX = 0;
|
||||||
|
let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset;
|
||||||
|
let ty = 0;
|
||||||
|
if (!swiper.isHorizontal()) {
|
||||||
|
ty = tx;
|
||||||
|
tx = 0;
|
||||||
|
rotateX = -rotateY;
|
||||||
|
rotateY = 0;
|
||||||
|
} else if (rtl) {
|
||||||
|
rotateY = -rotateY;
|
||||||
|
}
|
||||||
|
slideEl.style.zIndex = -Math.abs(Math.round(progress)) + slides.length;
|
||||||
|
if (params.slideShadows) {
|
||||||
|
createSlideShadows(slideEl, progress);
|
||||||
|
}
|
||||||
|
const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateFix(rotateX)}deg) rotateY(${rotateFix(rotateY)}deg)`;
|
||||||
|
const targetEl = effectTarget(params, slideEl);
|
||||||
|
targetEl.style.transform = transform;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setTransition = duration => {
|
||||||
|
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||||
|
transformElements.forEach(el => {
|
||||||
|
el.style.transitionDuration = `${duration}ms`;
|
||||||
|
el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {
|
||||||
|
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
effectVirtualTransitionEnd({
|
||||||
|
swiper,
|
||||||
|
duration,
|
||||||
|
transformElements
|
||||||
|
});
|
||||||
|
};
|
||||||
|
effectInit({
|
||||||
|
effect: 'flip',
|
||||||
|
swiper,
|
||||||
|
on,
|
||||||
|
setTranslate,
|
||||||
|
setTransition,
|
||||||
|
recreateShadows,
|
||||||
|
getEffectParams: () => swiper.params.flipEffect,
|
||||||
|
perspective: () => true,
|
||||||
|
overwriteParams: () => ({
|
||||||
|
slidesPerView: 1,
|
||||||
|
slidesPerGroup: 1,
|
||||||
|
watchSlidesProgress: true,
|
||||||
|
spaceBetween: 0,
|
||||||
|
virtualTranslate: !swiper.params.cssMode
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { EffectFlip as default };
|
|
@ -0,0 +1,28 @@
|
||||||
|
.swiper-flip {
|
||||||
|
overflow: visible;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 1;
|
||||||
|
.swiper-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-slide-active {
|
||||||
|
&,
|
||||||
|
& .swiper-slide-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Flip slide shadows start */
|
||||||
|
.swiper-flip {
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-top,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-bottom,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-left,
|
||||||
|
.swiper-slide-shadow-flip.swiper-slide-shadow-right {
|
||||||
|
z-index: 0;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Flip slide shadows end */
|
|
@ -0,0 +1,4 @@
|
||||||
|
.swiper-free-mode > .swiper-wrapper {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/free-mode-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/free-mode-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-free-mode>.swiper-wrapper{transition-timing-function:ease-out;margin:0 auto}
|
|
@ -0,0 +1,4 @@
|
||||||
|
.swiper-free-mode > .swiper-wrapper {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
.swiper-free-mode > .swiper-wrapper {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/free-mode.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/free-mode.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-free-mode>.swiper-wrapper{transition-timing-function:ease-out;margin:0 auto}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import{d as now,k as elementTransitionEnd}from"../shared/utils.min.mjs";function freeMode(e){let{swiper:t,extendParams:o,emit:n,once:s}=e;o({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(t,{freeMode:{onTouchStart:function(){if(t.params.cssMode)return;const e=t.getTranslate();t.setTranslate(e),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})},onTouchMove:function(){if(t.params.cssMode)return;const{touchEventsData:e,touches:o}=t;0===e.velocities.length&&e.velocities.push({position:o[t.isHorizontal()?"startX":"startY"],time:e.touchStartTime}),e.velocities.push({position:o[t.isHorizontal()?"currentX":"currentY"],time:now()})},onTouchEnd:function(e){let{currentPos:o}=e;if(t.params.cssMode)return;const{params:i,wrapperEl:a,rtlTranslate:r,snapGrid:l,touchEventsData:m}=t,c=now()-m.touchStartTime;if(o<-t.minTranslate())t.slideTo(t.activeIndex);else if(o>-t.maxTranslate())t.slides.length<l.length?t.slideTo(l.length-1):t.slideTo(t.slides.length-1);else{if(i.freeMode.momentum){if(m.velocities.length>1){const e=m.velocities.pop(),o=m.velocities.pop(),n=e.position-o.position,s=e.time-o.time;t.velocity=n/s,t.velocity/=2,Math.abs(t.velocity)<i.freeMode.minimumVelocity&&(t.velocity=0),(s>150||now()-e.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=i.freeMode.momentumVelocityRatio,m.velocities.length=0;let e=1e3*i.freeMode.momentumRatio;const o=t.velocity*e;let c=t.translate+o;r&&(c=-c);let d,u=!1;const f=20*Math.abs(t.velocity)*i.freeMode.momentumBounceRatio;let p;if(c<t.maxTranslate())i.freeMode.momentumBounce?(c+t.maxTranslate()<-f&&(c=t.maxTranslate()-f),d=t.maxTranslate(),u=!0,m.allowMomentumBounce=!0):c=t.maxTranslate(),i.loop&&i.centeredSlides&&(p=!0);else if(c>t.minTranslate())i.freeMode.momentumBounce?(c-t.minTranslate()>f&&(c=t.minTranslate()+f),d=t.minTranslate(),u=!0,m.allowMomentumBounce=!0):c=t.minTranslate(),i.loop&&i.centeredSlides&&(p=!0);else if(i.freeMode.sticky){let e;for(let t=0;t<l.length;t+=1)if(l[t]>-c){e=t;break}c=Math.abs(l[e]-c)<Math.abs(l[e-1]-c)||"next"===t.swipeDirection?l[e]:l[e-1],c=-c}if(p&&s("transitionEnd",(()=>{t.loopFix()})),0!==t.velocity){if(e=r?Math.abs((-c-t.translate)/t.velocity):Math.abs((c-t.translate)/t.velocity),i.freeMode.sticky){const o=Math.abs((r?-c:c)-t.translate),n=t.slidesSizesGrid[t.activeIndex];e=o<n?i.speed:o<2*n?1.5*i.speed:2.5*i.speed}}else if(i.freeMode.sticky)return void t.slideToClosest();i.freeMode.momentumBounce&&u?(t.updateProgress(d),t.setTransition(e),t.setTranslate(c),t.transitionStart(!0,t.swipeDirection),t.animating=!0,elementTransitionEnd(a,(()=>{t&&!t.destroyed&&m.allowMomentumBounce&&(n("momentumBounce"),t.setTransition(i.speed),setTimeout((()=>{t.setTranslate(d),elementTransitionEnd(a,(()=>{t&&!t.destroyed&&t.transitionEnd()}))}),0))}))):t.velocity?(n("_freeModeNoMomentumRelease"),t.updateProgress(c),t.setTransition(e),t.setTranslate(c),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,elementTransitionEnd(a,(()=>{t&&!t.destroyed&&t.transitionEnd()})))):t.updateProgress(c),t.updateActiveIndex(),t.updateSlidesClasses()}else{if(i.freeMode.sticky)return void t.slideToClosest();i.freeMode&&n("_freeModeNoMomentumRelease")}(!i.freeMode.momentum||c>=i.longSwipesMs)&&(n("_freeModeStaticRelease"),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}}}})}export{freeMode as default};
|
||||||
|
//# sourceMappingURL=free-mode.min.mjs.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,237 @@
|
||||||
|
import { d as now, k as elementTransitionEnd } from '../shared/utils.mjs';
|
||||||
|
|
||||||
|
function freeMode(_ref) {
|
||||||
|
let {
|
||||||
|
swiper,
|
||||||
|
extendParams,
|
||||||
|
emit,
|
||||||
|
once
|
||||||
|
} = _ref;
|
||||||
|
extendParams({
|
||||||
|
freeMode: {
|
||||||
|
enabled: false,
|
||||||
|
momentum: true,
|
||||||
|
momentumRatio: 1,
|
||||||
|
momentumBounce: true,
|
||||||
|
momentumBounceRatio: 1,
|
||||||
|
momentumVelocityRatio: 1,
|
||||||
|
sticky: false,
|
||||||
|
minimumVelocity: 0.02
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function onTouchStart() {
|
||||||
|
if (swiper.params.cssMode) return;
|
||||||
|
const translate = swiper.getTranslate();
|
||||||
|
swiper.setTranslate(translate);
|
||||||
|
swiper.setTransition(0);
|
||||||
|
swiper.touchEventsData.velocities.length = 0;
|
||||||
|
swiper.freeMode.onTouchEnd({
|
||||||
|
currentPos: swiper.rtl ? swiper.translate : -swiper.translate
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onTouchMove() {
|
||||||
|
if (swiper.params.cssMode) return;
|
||||||
|
const {
|
||||||
|
touchEventsData: data,
|
||||||
|
touches
|
||||||
|
} = swiper;
|
||||||
|
// Velocity
|
||||||
|
if (data.velocities.length === 0) {
|
||||||
|
data.velocities.push({
|
||||||
|
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
|
||||||
|
time: data.touchStartTime
|
||||||
|
});
|
||||||
|
}
|
||||||
|
data.velocities.push({
|
||||||
|
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
|
||||||
|
time: now()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onTouchEnd(_ref2) {
|
||||||
|
let {
|
||||||
|
currentPos
|
||||||
|
} = _ref2;
|
||||||
|
if (swiper.params.cssMode) return;
|
||||||
|
const {
|
||||||
|
params,
|
||||||
|
wrapperEl,
|
||||||
|
rtlTranslate: rtl,
|
||||||
|
snapGrid,
|
||||||
|
touchEventsData: data
|
||||||
|
} = swiper;
|
||||||
|
// Time diff
|
||||||
|
const touchEndTime = now();
|
||||||
|
const timeDiff = touchEndTime - data.touchStartTime;
|
||||||
|
if (currentPos < -swiper.minTranslate()) {
|
||||||
|
swiper.slideTo(swiper.activeIndex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (currentPos > -swiper.maxTranslate()) {
|
||||||
|
if (swiper.slides.length < snapGrid.length) {
|
||||||
|
swiper.slideTo(snapGrid.length - 1);
|
||||||
|
} else {
|
||||||
|
swiper.slideTo(swiper.slides.length - 1);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.freeMode.momentum) {
|
||||||
|
if (data.velocities.length > 1) {
|
||||||
|
const lastMoveEvent = data.velocities.pop();
|
||||||
|
const velocityEvent = data.velocities.pop();
|
||||||
|
const distance = lastMoveEvent.position - velocityEvent.position;
|
||||||
|
const time = lastMoveEvent.time - velocityEvent.time;
|
||||||
|
swiper.velocity = distance / time;
|
||||||
|
swiper.velocity /= 2;
|
||||||
|
if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
|
||||||
|
swiper.velocity = 0;
|
||||||
|
}
|
||||||
|
// this implies that the user stopped moving a finger then released.
|
||||||
|
// There would be no events with distance zero, so the last event is stale.
|
||||||
|
if (time > 150 || now() - lastMoveEvent.time > 300) {
|
||||||
|
swiper.velocity = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
swiper.velocity = 0;
|
||||||
|
}
|
||||||
|
swiper.velocity *= params.freeMode.momentumVelocityRatio;
|
||||||
|
data.velocities.length = 0;
|
||||||
|
let momentumDuration = 1000 * params.freeMode.momentumRatio;
|
||||||
|
const momentumDistance = swiper.velocity * momentumDuration;
|
||||||
|
let newPosition = swiper.translate + momentumDistance;
|
||||||
|
if (rtl) newPosition = -newPosition;
|
||||||
|
let doBounce = false;
|
||||||
|
let afterBouncePosition;
|
||||||
|
const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
|
||||||
|
let needsLoopFix;
|
||||||
|
if (newPosition < swiper.maxTranslate()) {
|
||||||
|
if (params.freeMode.momentumBounce) {
|
||||||
|
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
|
||||||
|
newPosition = swiper.maxTranslate() - bounceAmount;
|
||||||
|
}
|
||||||
|
afterBouncePosition = swiper.maxTranslate();
|
||||||
|
doBounce = true;
|
||||||
|
data.allowMomentumBounce = true;
|
||||||
|
} else {
|
||||||
|
newPosition = swiper.maxTranslate();
|
||||||
|
}
|
||||||
|
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
||||||
|
} else if (newPosition > swiper.minTranslate()) {
|
||||||
|
if (params.freeMode.momentumBounce) {
|
||||||
|
if (newPosition - swiper.minTranslate() > bounceAmount) {
|
||||||
|
newPosition = swiper.minTranslate() + bounceAmount;
|
||||||
|
}
|
||||||
|
afterBouncePosition = swiper.minTranslate();
|
||||||
|
doBounce = true;
|
||||||
|
data.allowMomentumBounce = true;
|
||||||
|
} else {
|
||||||
|
newPosition = swiper.minTranslate();
|
||||||
|
}
|
||||||
|
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
||||||
|
} else if (params.freeMode.sticky) {
|
||||||
|
let nextSlide;
|
||||||
|
for (let j = 0; j < snapGrid.length; j += 1) {
|
||||||
|
if (snapGrid[j] > -newPosition) {
|
||||||
|
nextSlide = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
|
||||||
|
newPosition = snapGrid[nextSlide];
|
||||||
|
} else {
|
||||||
|
newPosition = snapGrid[nextSlide - 1];
|
||||||
|
}
|
||||||
|
newPosition = -newPosition;
|
||||||
|
}
|
||||||
|
if (needsLoopFix) {
|
||||||
|
once('transitionEnd', () => {
|
||||||
|
swiper.loopFix();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Fix duration
|
||||||
|
if (swiper.velocity !== 0) {
|
||||||
|
if (rtl) {
|
||||||
|
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
|
||||||
|
} else {
|
||||||
|
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
|
||||||
|
}
|
||||||
|
if (params.freeMode.sticky) {
|
||||||
|
// If freeMode.sticky is active and the user ends a swipe with a slow-velocity
|
||||||
|
// event, then durations can be 20+ seconds to slide one (or zero!) slides.
|
||||||
|
// It's easy to see this when simulating touch with mouse events. To fix this,
|
||||||
|
// limit single-slide swipes to the default slide duration. This also has the
|
||||||
|
// nice side effect of matching slide speed if the user stopped moving before
|
||||||
|
// lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
|
||||||
|
// For faster swipes, also apply limits (albeit higher ones).
|
||||||
|
const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
|
||||||
|
const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
|
||||||
|
if (moveDistance < currentSlideSize) {
|
||||||
|
momentumDuration = params.speed;
|
||||||
|
} else if (moveDistance < 2 * currentSlideSize) {
|
||||||
|
momentumDuration = params.speed * 1.5;
|
||||||
|
} else {
|
||||||
|
momentumDuration = params.speed * 2.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (params.freeMode.sticky) {
|
||||||
|
swiper.slideToClosest();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.freeMode.momentumBounce && doBounce) {
|
||||||
|
swiper.updateProgress(afterBouncePosition);
|
||||||
|
swiper.setTransition(momentumDuration);
|
||||||
|
swiper.setTranslate(newPosition);
|
||||||
|
swiper.transitionStart(true, swiper.swipeDirection);
|
||||||
|
swiper.animating = true;
|
||||||
|
elementTransitionEnd(wrapperEl, () => {
|
||||||
|
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
|
||||||
|
emit('momentumBounce');
|
||||||
|
swiper.setTransition(params.speed);
|
||||||
|
setTimeout(() => {
|
||||||
|
swiper.setTranslate(afterBouncePosition);
|
||||||
|
elementTransitionEnd(wrapperEl, () => {
|
||||||
|
if (!swiper || swiper.destroyed) return;
|
||||||
|
swiper.transitionEnd();
|
||||||
|
});
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
} else if (swiper.velocity) {
|
||||||
|
emit('_freeModeNoMomentumRelease');
|
||||||
|
swiper.updateProgress(newPosition);
|
||||||
|
swiper.setTransition(momentumDuration);
|
||||||
|
swiper.setTranslate(newPosition);
|
||||||
|
swiper.transitionStart(true, swiper.swipeDirection);
|
||||||
|
if (!swiper.animating) {
|
||||||
|
swiper.animating = true;
|
||||||
|
elementTransitionEnd(wrapperEl, () => {
|
||||||
|
if (!swiper || swiper.destroyed) return;
|
||||||
|
swiper.transitionEnd();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
swiper.updateProgress(newPosition);
|
||||||
|
}
|
||||||
|
swiper.updateActiveIndex();
|
||||||
|
swiper.updateSlidesClasses();
|
||||||
|
} else if (params.freeMode.sticky) {
|
||||||
|
swiper.slideToClosest();
|
||||||
|
return;
|
||||||
|
} else if (params.freeMode) {
|
||||||
|
emit('_freeModeNoMomentumRelease');
|
||||||
|
}
|
||||||
|
if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
|
||||||
|
emit('_freeModeStaticRelease');
|
||||||
|
swiper.updateProgress();
|
||||||
|
swiper.updateActiveIndex();
|
||||||
|
swiper.updateSlidesClasses();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Object.assign(swiper, {
|
||||||
|
freeMode: {
|
||||||
|
onTouchStart,
|
||||||
|
onTouchMove,
|
||||||
|
onTouchEnd
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { freeMode as default };
|
|
@ -0,0 +1,4 @@
|
||||||
|
.swiper-free-mode > .swiper-wrapper {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
.swiper-grid > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.swiper-grid-column > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/grid-element.min.css
vendored
Normal file
1
web/themes/custom/quartiers_de_demain/librairies/swiper/modules/grid-element.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-wrap:wrap;flex-direction:column}
|
|
@ -0,0 +1,7 @@
|
||||||
|
.swiper-grid > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.swiper-grid-column > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
.swiper-grid > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.swiper-grid-column > .swiper-wrapper {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-wrap:wrap;flex-direction:column}
|
|
@ -0,0 +1,2 @@
|
||||||
|
function Grid(e){let i,r,a,t,{swiper:s,extendParams:l,on:o}=e;l({grid:{rows:1,fill:"column"}});const n=()=>{let e=s.params.spaceBetween;return"string"==typeof e&&e.indexOf("%")>=0?e=parseFloat(e.replace("%",""))/100*s.size:"string"==typeof e&&(e=parseFloat(e)),e};o("init",(()=>{t=s.params.grid&&s.params.grid.rows>1})),o("update",(()=>{const{params:e,el:i}=s,r=e.grid&&e.grid.rows>1;t&&!r?(i.classList.remove(`${e.containerModifierClass}grid`,`${e.containerModifierClass}grid-column`),a=1,s.emitContainerClasses()):!t&&r&&(i.classList.add(`${e.containerModifierClass}grid`),"column"===e.grid.fill&&i.classList.add(`${e.containerModifierClass}grid-column`),s.emitContainerClasses()),t=r})),s.grid={initSlides:e=>{const{slidesPerView:t}=s.params,{rows:l,fill:o}=s.params.grid,n=s.virtual&&s.params.virtual.enabled?s.virtual.slides.length:e.length;a=Math.floor(n/l),i=Math.floor(n/l)===n/l?n:Math.ceil(n/l)*l,"auto"!==t&&"row"===o&&(i=Math.max(i,t*l)),r=i/l},unsetSlides:()=>{s.slides&&s.slides.forEach((e=>{e.swiperSlideGridSet&&(e.style.height="",e.style[s.getDirectionLabel("margin-top")]="")}))},updateSlide:(e,t,l)=>{const{slidesPerGroup:o}=s.params,d=n(),{rows:p,fill:c}=s.params.grid,g=s.virtual&&s.params.virtual.enabled?s.virtual.slides.length:l.length;let u,h,m;if("row"===c&&o>1){const r=Math.floor(e/(o*p)),a=e-p*o*r,s=0===r?o:Math.min(Math.ceil((g-r*p*o)/p),o);m=Math.floor(a/s),h=a-m*s+r*o,u=h+m*i/p,t.style.order=u}else"column"===c?(h=Math.floor(e/p),m=e-h*p,(h>a||h===a&&m===p-1)&&(m+=1,m>=p&&(m=0,h+=1))):(m=Math.floor(e/r),h=e-m*r);t.row=m,t.column=h,t.style.height=`calc((100% - ${(p-1)*d}px) / ${p})`,t.style[s.getDirectionLabel("margin-top")]=0!==m?d&&`${d}px`:"",t.swiperSlideGridSet=!0},updateWrapperSize:(e,r)=>{const{centeredSlides:a,roundLengths:t}=s.params,l=n(),{rows:o}=s.params.grid;if(s.virtualSize=(e+l)*i,s.virtualSize=Math.ceil(s.virtualSize/o)-l,s.params.cssMode||(s.wrapperEl.style[s.getDirectionLabel("width")]=`${s.virtualSize+l}px`),a){const e=[];for(let i=0;i<r.length;i+=1){let a=r[i];t&&(a=Math.floor(a)),r[i]<s.virtualSize+r[0]&&e.push(a)}r.splice(0,r.length),r.push(...e)}}}}export{Grid as default};
|
||||||
|
//# sourceMappingURL=grid.min.mjs.map
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue