-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.css
123 lines (107 loc) · 2.07 KB
/
header.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
/* header navigation styling */
header {
position: fixed;
width: 100%;
z-index: 100;
background-color: rgba(95, 158, 160, 0.5);
}
header nav ul {
padding: 0.6rem 2rem;
max-width: 640px;
margin-left: auto;
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
}
header ul a {
text-decoration: none;
color: #fff;
padding: 0rem 0.7rem;
text-transform: uppercase;
font-size: 1.1rem;
position: relative;
/* needed for the hover effect to work */
text-shadow: 0 -3px 0 #3b3b3b;
}
header ul a:hover {
cursor: pointer;
}
header ul a::before {
content: '';
position: absolute;
bottom: 0;
width: 0;
left: 50%;
/* Center the underline */
transform: translateX(-50%);
height: 2px;
background-color: white;
transition: width 0.3s ease;
}
header ul a:hover::before {
width: 80%;
}
/* TODO: show hamburger for mobile. Currently not used. */
.hamburger {
padding-left: 1.5rem;
display: none;
}
.hamburger a {
padding: 0;
width: 37px;
height: 37px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
background-color: rgba(73, 118, 117, 0.7);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.hamburger a .bar {
position: relative;
/* allows us to use position absolute for the before and after bars */
width: 52%;
height: 1.5px;
background-color: #fff;
border-radius: 2px;
}
.hamburger a .bar::before,
.hamburger a .bar::after {
content: "";
position: absolute;
left: 50%;
/* centers them */
transform: translateX(-50%);
/* moves them back left by 50% of their width */
width: 70%;
/* 60% of .bar's width */
height: 100%;
/* same height as .bar */
background-color: inherit;
/* same as .bar */
border-radius: 2px;
}
.hamburger .bar::before {
top: -5px;
}
.hamburger .bar::after {
top: 5px;
}
/* footer */
footer {
text-align: center;
}
footer p {
font-size: 0.8rem;
padding: 10px;
}
@media (max-width: 768px) {
header ul a {
font-size: 0.9rem;
}
header nav ul {
padding: 0.6rem 1.2rem;
}
}