-
Notifications
You must be signed in to change notification settings - Fork 1
/
navbar.css
176 lines (150 loc) · 3.49 KB
/
navbar.css
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
166
167
168
169
170
171
172
173
174
175
176
body {
overflow-x: hidden;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
margin: 0;
}
.menu-container {
position: relative;
display: flex;
align-items: center;
margin-bottom: 30px;
color: white;
padding: 10px 20px 20px 20px;
z-index: 1;
-webkit-user-select: none;
user-select: none;
box-sizing: border-box;
background: linear-gradient(to bottom, rgba(40, 43, 46, 1) 0%, rgba(40, 43, 46, 0) 100%);
}
.menu-logo {
line-height: 0;
margin: 0 20px;
}
.menu-logo img {
max-height: 40px;
max-width: 100px;
flex-shrink: 0;
}
.menu-container a {
text-decoration: none;
font-weight: bold;
color: white;
transition: color 0.3s ease;
}
.menu-container a:hover {
color: #00C6A7;
}
.menu-container input {
display: block;
width: 35px;
height: 25px;
margin: 0;
position: absolute;
cursor: pointer;
opacity: 0;
z-index: 2;
-webkit-touch-callout: none;
}
/* Burger menu */
.menu-container span {
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background: #cdcdcd;
border-radius: 3px;
z-index: 1;
transform-origin: 4px 0px;
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
opacity 0.55s 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);
background: #232323;
}
.menu-container input:checked ~ span:nth-child(4) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
.menu-container input:checked ~ span:nth-child(3) {
transform: rotate(-45deg) translate(-5px,11px);
}
.menu ul {
list-style: none;
}
.menu li {
padding: 10px 0;
font-size: 22px;
}
/* mobile styles */
@media only screen and (max-width: 787px) {
.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: black;
-webkit-font-smoothing: antialiased;
/* to stop flickering of text in safari */
transform-origin: 0% 0%;
transform: translateX(0%);
transition: transform 0.5s 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: 788px) {
.menu-container {
width: 100%;
}
.menu-container a {
color: rgb(255, 255, 255);
}
.menu-container input {
display: none;
}
/* Burger menu */
.menu-container span {
display: none;
}
.menu {
position: relative;
width: 100%;
display: flex;
justify-content: space-between;
}
.menu ul {
display: flex;
padding: 0;
}
.menu li {
padding: 0 20px;
}
}