swiper
Version:
Most modern mobile touch slider and framework with hardware accelerated transitions
11 lines • 486 B
JavaScript
import { createElement, getSlideTransformEl } from './utils.js';
export default function createShadow(params, slideEl, side) {
const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}`;
const shadowContainer = getSlideTransformEl(slideEl);
let shadowEl = shadowContainer.querySelector(`.${shadowClass}`);
if (!shadowEl) {
shadowEl = createElement('div', `swiper-slide-shadow${side ? `-${side}` : ''}`);
shadowContainer.append(shadowEl);
}
return shadowEl;
}