-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathsidebar.css
More file actions
93 lines (77 loc) · 1.65 KB
/
sidebar.css
File metadata and controls
93 lines (77 loc) · 1.65 KB
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
* { margin: 0; padding: 0; box-sizing: border-box; }
section {
width: 100%; height: 100vh;
background-color: #eee;
font-family: "Poppins", sans-serif;
}
h1 {
text-transform: uppercase;
color: #272727;
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
font-size: 40px;
}
.hamburger {
position: absolute;
top: 20px; left: 20px;
z-index: 9999;
cursor: pointer;
transition: all 0.5s;
}
.hamburger .line {
display: block;
width: 32px; height: 2px;
background-color: #272727;
transition: all 0.5s;
}
.hamburger .line2 { margin: 8px 0; }
.sidebar {
position: fixed;
top: 0; left: 0;
width: 30%; height: 100%;
transform: translateX(-100%);
background-color: #272727;
display: flex;
align-items: center;
transition: all 0.5s;
opacity: 0;
}
.sidebar-items { list-style: none; }
.sidebar .item {
display: inline-block;
width: 100%;
padding: 10px 0 10px 20px;
font-size: 25px;
color: #eee;
cursor: pointer;
transition: all 0.3s;
}
.sidebar .item:hover {
background-color: #eee;
color: #272727;
transform: translateY(-10px);
}
.sidebar .item:not(:last-child) {
margin-bottom: 40px;
}
.hamburger.clicked {
left: calc(30% - 60px);
}
.hamburger.clicked .line {
background-color: #eee;
}
.hamburger.clicked .line1 {
transform: translateY(10px) rotate(-135deg);
}
.hamburger.clicked .line2 {
transform: rotate(135deg);
opacity: 0;
}
.hamburger.clicked .line3 {
transform: translateY(-10px) rotate(135deg);
}
.sidebar.show {
transform: translateX(0);
opacity: 1;
}