Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
feat: swiper에 fade effect를 적용할 수 있게 한다
Browse files Browse the repository at this point in the history
  • Loading branch information
john015 committed Jul 1, 2020
1 parent 16ec27a commit a276a2b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
22 changes: 22 additions & 0 deletions docs/components/Swiper.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,25 @@ import { PlayGroundBanner } from '../docsComponents';
</Slide>
</Swiper>
</Playground>

## Fade Effect Swiper

<Playground>
<Swiper effect="fade">
<Slide>
<PlayGroundBanner backgroundColor={Colors.red100} fill>
배너1
</PlayGroundBanner>
</Slide>
<Slide>
<PlayGroundBanner backgroundColor={Colors.blue200} fill>
배너2
</PlayGroundBanner>
</Slide>
<Slide>
<PlayGroundBanner backgroundColor={Colors.orange300} fill>
배너3
</PlayGroundBanner>
</Slide>
</Swiper>
</Playground>
8 changes: 4 additions & 4 deletions src/components/Swiper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import React, { FC, MutableRefObject, ReactNode, useEffect, useRef, useState } f
import { SwiperOptions } from 'swiper';
import {
Autoplay,
EffectFade,
Keyboard,
Lazy,
Navigation,
Pagination,
Swiper as OriginalSwiper,
Virtual,
Lazy,
Keyboard,
} from 'swiper/dist/js/swiper.esm.js';

import { createUniqIDGenerator } from '../../utils/createUniqIDGenerator';
import { DefaultNavigation } from './DefaultNavigation';

OriginalSwiper.use([Navigation, Pagination, Autoplay, Virtual, Lazy, Keyboard]);
OriginalSwiper.use([Navigation, Pagination, Autoplay, Virtual, Lazy, Keyboard, EffectFade]);

export type SwiperInstance = OriginalSwiper;

Expand Down

1 comment on commit a276a2b

@vercel
Copy link

@vercel vercel bot commented on a276a2b Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.