_header.scss 2.8 KB
Newer Older
alain's avatar
alain committed
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

.menu-container {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin-bottom: 20px;
  background: #fff;
  color: #000;
  padding: 20px;
  z-index: 1;
  -webkit-user-select: none;
  user-select: none;
  box-sizing: border-box;
  font-weight: 500;
}

.menu-logo {
  margin: 0 20px;
  white-space: nowrap;
  font-size: 44px;
  margin-bottom: 0;
}

.menu-container a {
  text-decoration: none;
  color: #000;
  transition: color 0.1s ease;
  text-transform: lowercase;

  &:hover {
    color: #2FB6BC;
  }
}

.menu-container input {
  display: block;
  width: 30px;
  height: 30px;
  right: 10px;
  top: 10px;
  margin: 0;
  position: absolute;
  cursor: pointer;
  opacity: 0; /* hide this */
  z-index: 2; /* and place it over the hamburger */
  -webkit-touch-callout: none;
}

/* Burger menu */
.menu-container span {
  display: block;
  width: 14px;
  height: 2px;
  margin-bottom: 2px;
  position: relative;
  background: #000;
  border-radius: 2px;
  z-index: 1;
  transform-origin: 3px 0px;
  transition: all 0.1s ease;
}

.menu-container span:first-child { transform-origin: 0% 0%; }

.menu-container span:nth-child(3) { transform-origin: 0% 100%; }

.menu-container input:checked ~ span {
  opacity: 1;
  transform: rotate(45deg) translate(3px,-1px);
}

.menu-container input:checked ~ span:nth-child(4) {
  opacity: 0;
  transform: rotate(0deg) scale(0.1, 0.1);
}

.menu-container input:checked ~ span:nth-child(3) {
  transform: rotate(-45deg) translate(-1px, 6px);
}

.menu {
  list-style: none;
  margin: 0;
}

.menu li {
  margin-bottom: 0;
  padding: 10px 0;
  font-size: 20px;
}

/* mobile styles */
@media only screen and (max-width: 1000px) { 
  .menu-container {
    flex-direction: column;
    align-items: flex-end;
  }
  
  .menu-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .menu-logo img {
    max-height: 30px;
  }

  .menu {
    position: absolute;
    box-sizing: border-box;
    width: 300px;
    right: -300px;
    top: 0;
    margin: -20px;
    padding: 75px 50px 50px;
    background: #eee;
    -webkit-font-smoothing: antialiased;
    /* to stop flickering of text in safari */
    transform-origin: 0% 0%;
    transform: translateX(0%);
    transition: transform 0.1s cubic-bezier(0.77,0.2,0.05,1.0);
  }

  .menu-container input:checked ~ .menu {
    transform: translateX(-100%);
  }
}

/* desktop styles */
@media only screen and (min-width: 1001px) { 
  .menu-container {
    width: 100%;
  }

  .menu-container a {
    color: #000;
  }

  .menu-container input {
    display: none;
  }

  /* Burger menu */
  .menu-container span {
    display: none;
  }

  .menu {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .menu ul {
    display: flex;
    padding: 0;
  }

  .menu li {
    padding: 0 20px;
  }
}