File tree Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Original file line number Diff line number Diff line change
1
+ @import ' src/scss/mixins' ;
2
+
3
+ .hamburger-menu {
4
+ height : 25px ;
5
+ width : 25px ;
6
+ cursor : pointer ;
7
+ position : relative ;
8
+ z-index : 2 ;
9
+ display : flex ;
10
+ flex-wrap : wrap ;
11
+ align-items : stretch ;
12
+
13
+ & :hover {
14
+ color : $color-light ;
15
+ }
16
+ }
17
+
18
+ .line {
19
+ position : absolute ;
20
+ top : 50% ;
21
+ width : 100% ;
22
+ height : 5px ;
23
+ background-color : $color-base ;
24
+
25
+ & :nth-of-type (2 ) {
26
+ top : calc (44% - 6px );
27
+ }
28
+
29
+ & :nth-of-type (3 ) {
30
+ top : calc (63% + 5px );
31
+ }
32
+ }
33
+
34
+ .transition {
35
+ @include devices {
36
+ .line {
37
+ transition : all 1s ;
38
+
39
+ & :nth-of-type (1 ) {
40
+ top : 50% ;
41
+ transform : rotate (45deg );
42
+ }
43
+
44
+ & :nth-of-type (2 ) {
45
+ display : none ;
46
+ }
47
+
48
+ & :nth-of-type (3 ) {
49
+ top : 50% ;
50
+ transform : rotate (-45deg );
51
+ }
52
+ }
53
+ }
54
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ import cx from 'classnames'
4
+
5
+ import css from './HamburgerMenu.styles.module.scss'
6
+
7
+ export type HamburgerMenuProps = {
8
+ isHamburger : boolean
9
+ className ?: string
10
+ onClick : ( ) => void
11
+ }
12
+
13
+ export const HamburgerMenu = ( { className, onClick, isHamburger } : HamburgerMenuProps ) => {
14
+ return (
15
+ < div
16
+ onClick = { onClick }
17
+ className = { cx ( css . hamburgerMenu , className , {
18
+ [ css . transition ] : isHamburger
19
+ } ) }
20
+ >
21
+ < div className = { css . line } />
22
+ < div className = { css . line } />
23
+ < div className = { css . line } />
24
+ </ div >
25
+ )
26
+ }
Original file line number Diff line number Diff line change
1
+ export * from './HamburgerMenu'
You can’t perform that action at this time.
0 commit comments