-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
161 lines (138 loc) · 4.01 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Header</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap-grid.min.css" integrity="sha512-Aa+z1qgIG+Hv4H2W3EMl3btnnwTQRA47ZiSecYSkWavHUkBF2aPOIIvlvjLCsjapW1IfsGrEO3FU693ReouVTA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: black;
overflow-x: hidden !important;
}
header a {
font-size: 17px;
/*transition: .3s all ease-in-out;*/
color: black;
text-decoration: none;
}
header {
background-color: white;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
nav ul {
list-style: none;
display: flex;
}
nav ul li {
margin: 0 5px;
padding: 20px 0px;
}
nav div:first-child a {
font-size: 19px;
font-weight: bold;
}
nav .side_nav ul li a {
border-radius: 10px 0 10px 0;
padding: 15px 15px;
transition: .4s all ease-in-out;
}
header .container-fluid nav i {
cursor: pointer;
color: black;
font-size: 22px;
display: none;
}
nav .side_nav ul li a:hover {
cursor: pointer;
background-color: black;
color: white;
}
@media only screen and (max-width: 650px) {
header nav div {
padding: 15px 0;
}
header .container-fluid {
padding: 0 20px;
}
header .container-fluid nav i {
color: black;
font-size: 22px;
display: block;
}
.side_nav {
position: relative;
left: 51%;
top: -17px;
right: 0;
transform: translateY(-2500%);
transition: transform .5s;
}
.fa-times {
margin: 0 22px;
right: 0;
top: 20px;
position: absolute;
z-index: 22;
transition: .5s all ease-in-out;
}
.fa-times:hover {
transform: rotate(180deg);
}
nav ul {
background-color: white;
top: 4%;
height: 100vh;
right: 0;
padding: 60px 0 0 0;
width: 250px;
position: absolute;
align-items: center;
list-style: none;
display: flex;
justify-content: flex-start;
flex-direction: column;
}
}
</style>
</head>
<body>
<header>
<div class="container-fluid">
<nav>
<div><a href="#">LOGO</a></div>
<div class="side_nav">
<i class="fas fa-times" onclick="hide()"></i>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Career</a></li>
<li><a href="#">Contact us</a></li>
</ul>
</div>
<i class="fas fa-bars" onclick="show()"></i>
</nav>
</div>
</header>
<script>
function show() {
document.querySelector('.side_nav').style.transform = ('none');
}
function hide() {
document.querySelector('.side_nav').style.transform = (' translateY(-2500%)');
}
</script>
</body>
</html>