forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.ts
More file actions
59 lines (51 loc) · 1.08 KB
/
elements.ts
File metadata and controls
59 lines (51 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import styled, { css } from 'styled-components';
import { NextIcon } from './Next';
export const Container = styled.div`
display: flex;
margin: 0 1.5rem;
overflow: hidden;
position: relative;
> div {
&:first-child button {
padding-left: 0px;
}
}
`;
export const ArrowButton = styled.button<{ next?: boolean }>`
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
z-index: 10;
position: absolute;
top: 50%;
margin: 0;
transform: translateY(-50%);
${props =>
props.next &&
css`
left: auto;
right: 0.5rem;
`}
`;
export const Arrow = styled(NextIcon)<{ next?: boolean }>`
transform: rotate(180deg);
${props =>
props.next &&
css`
transform: rotate(0deg);
`}
`;
export const CarrouselWrapper = styled.div`
width: 50%;
flex-grow: 1;
flex-shrink: 0;
margin-bottom: 2rem;
`;
export const Carrousel = styled.div<{ number: number }>`
transition: transform 200ms ease;
transform: ${props => `translateX(-${50 * props.number}%)`};
display: flex;
width: 100%;
`;