create-shadow.mjs 561 B

1234567891011121314
  1. import { g as getSlideTransformEl, c as createElement } from './utils.mjs';
  2. function createShadow(suffix, slideEl, side) {
  3. const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}${suffix ? ` swiper-slide-shadow-${suffix}` : ''}`;
  4. const shadowContainer = getSlideTransformEl(slideEl);
  5. let shadowEl = shadowContainer.querySelector(`.${shadowClass.split(' ').join('.')}`);
  6. if (!shadowEl) {
  7. shadowEl = createElement('div', shadowClass.split(' '));
  8. shadowContainer.append(shadowEl);
  9. }
  10. return shadowEl;
  11. }
  12. export { createShadow as c };