-
Notifications
You must be signed in to change notification settings - Fork 3
/
menu.css
61 lines (59 loc) · 1.48 KB
/
menu.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
body {
background-color: white;
}
.links {
background-color: rgba(102, 204, 51, 0.781);
box-shadow: 0 0 32px #0003;
font-weight: 500;
}
.links > a {
color: black;
padding: .75em;
text-align: center;
text-decoration: none;
transition: all .5s;
}
.links > a:hover {
background: #ffffff06;
color: black;
}
.links > .line {
background: black;
height: 1px;
}
#header {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 7%;
}
.links {
display: grid;
grid-template-columns: repeat(var(--items), 1fr);
position: relative;
}
.links > .line {
opacity: 0;
transition: all .5s;
position: absolute;
bottom: 0;
left: var(--left, calc(100% / var(--items) * (var(--index) - 1)));
width: var(--width, calc(100% / var(--items)));
--index: 0;
}
.links > a:hover ~ .line {
opacity: 1;
}
.links > a:nth-of-type(1):hover ~ .line { --index: 1; }
.links > a:nth-of-type(2):hover ~ .line { --index: 2; }
.links > a:nth-of-type(3):hover ~ .line { --index: 3; }
.links > a:nth-of-type(4):hover ~ .line { --index: 4; }
.links > a:nth-of-type(5):hover ~ .line { --index: 5; }
.links > a:nth-of-type(6):hover ~ .line { --index: 6; }
.links > a:nth-of-type(7):hover ~ .line { --index: 7; }
.links > a:nth-of-type(8):hover ~ .line { --index: 8; }
.links > a:nth-of-type(9):hover ~ .line { --index: 9; }
.links > a:nth-of-type(10):hover ~ .line { --index: 10; }
.links > a:last-of-type:hover ~ .line { --index: var(--items); }