Skip to content

Commit

Permalink
feat(effect-cards): add rotate parameter
Browse files Browse the repository at this point in the history
fixes #5575
  • Loading branch information
nolimits4web committed Apr 8, 2022
1 parent 213c8fe commit 5f4ca8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/effect-cards/effect-cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default function EffectCards({ swiper, extendParams, on }) {
cardsEffect: {
slideShadows: true,
transformEl: null,
rotate: true,
},
});

Expand Down Expand Up @@ -76,9 +77,10 @@ export default function EffectCards({ swiper, extendParams, on }) {

const scaleString =
progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`;

const transform = `
translate3d(${tX}, ${tY}, ${tZ}px)
rotateZ(${rotate}deg)
rotateZ(${params.rotate ? rotate : 0}deg)
scale(${scaleString})
`;

Expand Down
6 changes: 6 additions & 0 deletions src/types/modules/effect-cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export interface CardsEffectOptions {
* @default true
*/
slideShadows?: boolean;
/**
* Enables cards rotation
*
* @default true
*/
rotate?: boolean;
/**
* CSS selector of the element inside of the slide to transform instead of the slide itself. Useful to use with cssMode
*
Expand Down

0 comments on commit 5f4ca8a

Please sign in to comment.