-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from T1F5/feat/swiper
test swiper & default layout config
- Loading branch information
Showing
9 changed files
with
125 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import { css } from "@emotion/react"; | ||
import Router from "./Router"; | ||
import styled from '@emotion/styled'; | ||
|
||
function App() { | ||
return ( | ||
<div | ||
css={css` | ||
padding: 32px; | ||
background-color: hotpink; | ||
font-size: 24px; | ||
border-radius: 4px; | ||
`} | ||
> | ||
emotion test | ||
</div> | ||
<> | ||
<Layout> | ||
<Router /> | ||
</Layout> | ||
</> | ||
); | ||
} | ||
|
||
export default App; | ||
|
||
const Layout = styled.div` | ||
max-width: 768px; | ||
width: 100vw; | ||
border-left: 1px solid lightgray; | ||
border-right: 1px solid lightgray; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { Swiper, SwiperSlide } from 'swiper/react'; | ||
import styled from '@emotion/styled'; | ||
import { css } from '@emotion/react' | ||
import 'swiper/css'; | ||
import 'swiper/css/effect-coverflow'; | ||
import 'swiper/css/pagination'; | ||
|
||
import { EffectCards, Pagination } from 'swiper/modules'; | ||
|
||
|
||
const TestSwiper = () => { | ||
return ( | ||
<Swiper | ||
css={css` | ||
width: 100%; | ||
`} | ||
effect={'cards'} | ||
grabCursor={true} | ||
centeredSlides={true} | ||
slidesPerView={1.2} | ||
coverflowEffect={{ | ||
rotate: 10, | ||
stretch: 0, | ||
depth: 500, | ||
modifier: 2, | ||
slideShadows: true, | ||
}} | ||
pagination={false} | ||
modules={[EffectCards, Pagination]} | ||
className="mySwiper" | ||
> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-2.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-3.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-4.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-5.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-6.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-7.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-8.jpg" /> | ||
</StyledSlide> | ||
<StyledSlide> | ||
<img src="https://swiperjs.com/demos/images/nature-9.jpg" /> | ||
</StyledSlide> | ||
</Swiper> | ||
) | ||
} | ||
|
||
export default TestSwiper; | ||
|
||
const StyledSlide = styled(SwiperSlide)` | ||
background-position: center; | ||
background-size: cover; | ||
width: auto; | ||
img { | ||
display: block; | ||
width: 100%; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
html, body { | ||
width: 100%; | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import TestSwiper from "../components/TestSwiper"; | ||
|
||
const A = () => { | ||
return ( | ||
<div> | ||
A | ||
<TestSwiper /> | ||
</div> | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters