Skip to content

Commit 0810b4d

Browse files
committed
optimizing the carousel
1 parent feb25df commit 0810b4d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

components/slack/arrows.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export default function Arrows() {
5151
display: 'flex',
5252
marginTop: 32,
5353
marginBottom: 32,
54-
position: 'relative',
55-
left: 'calc(26vw + 63rem)'
54+
position: 'relative'
5655
}}
5756
>
5857
<div style={{ display: 'flex' }}>

components/slack/project.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ export default function Project({ title, description, color, img, itemId }) {
1818
`linear-gradient(to bottom, ${color[0]}, ${color[1]})`,
1919
color: 'white',
2020
overflow: 'clip',
21-
width: '70rem',
21+
width: ['100vw', '50rem', '70rem'],
2222
height: '100%',
2323
transition: '700ms cubic-bezier(0.075, 0.02, 0.165, 1)',
2424
transformOrigin: 'center',
25-
mx: 16,
26-
ml: `${itemId === 0 ? '26vw' : '0'}`
25+
mx: 16
2726
}}
2827
itemId={itemId}
2928
>

pages/slack.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,20 @@ const SlackPage = () => {
8787
onMouseEnter={disableScroll}
8888
onMouseLeave={enableScroll}
8989
>
90-
<ScrollMenu Footer={Arrows} onWheel={onWheel}>
91-
{projects.map(project => (
92-
<Project
93-
title={project.title}
94-
description={project.description}
95-
img={project.img}
96-
color={project.color}
97-
itemId={project.itemId}
98-
key={project.itemId}
99-
/>
100-
))}
101-
</ScrollMenu>
90+
<Box sx={{ ml: ['2vw', '25vw'] }}>
91+
<ScrollMenu Footer={Arrows} onWheel={onWheel}>
92+
{projects.map(project => (
93+
<Project
94+
title={project.title}
95+
description={project.description}
96+
img={project.img}
97+
color={project.color}
98+
itemId={project.itemId}
99+
key={project.itemId}
100+
/>
101+
))}
102+
</ScrollMenu>
103+
</Box>
102104
</Box>
103105
<Container sx={{ py: [4, 5] }}>
104106
<Box sx={{ gap: '2rem', display: ['grid', 'flex'] }}>

0 commit comments

Comments
 (0)