xxxxxxxxxx
1
<!--Main Navigation-->
2
<header>
3
<!-- Sidenav -->
4
<nav
5
data-mdb-sidenav-init
6
id="sidenav-1"
7
class="sidenav"
8
data-mdb-hidden="false"
9
data-mdb-accordion="true"
10
>
11
<a
12
data-mdb-ripple-init
13
class="d-flex justify-content-center py-4"
14
href="#!"
15
data-mdb-ripple-color="primary"
16
>
17
<img
18
id="MDB-logo"
19
src="https://mdbcdn.b-cdn.net/wp-content/uploads/2018/06/logo-mdb-jquery-small.webp"
20
alt="MDB Logo"
21
draggable="false"
22
/>
23
</a>
24
25
<ul class="sidenav-menu">
26
<li class="sidenav-item">
27
<a class="sidenav-link" href="">
28
<i class="fas fa-chart-area fa-fw me-3"></i
29
><span>Webiste traffic</span></a
30
>
31
</li>
32
<li class="sidenav-item">
33
<a class="sidenav-link"
34
><i class="fas fa-cogs fa-fw me-3"></i><span>Settings</span></a
35
>
36
<ul class="sidenav-collapse">
37
<li class="sidenav-item">
38
<a class="sidenav-link">Profile</a>
39
</li>
40
<li class="sidenav-item">
41
<a class="sidenav-link">Account</a>
42
</li>
43
</ul>
44
</li>
45
<li class="sidenav-item">
46
<a class="sidenav-link"
47
><i class="fas fa-lock fa-fw me-3"></i><span>Password</span></a
48
>
49
<ul class="sidenav-collapse">
50
<li class="sidenav-item">
51
<a class="sidenav-link">Request password</a>
52
</li>
53
<li class="sidenav-item">
54
<a class="sidenav-link">Reset password</a>
55
</li>
56
</ul>
57
</li>
58
</ul>
59
</nav>
60
<!-- Sidenav -->
61
62
<!-- Navbar -->
63
<nav
64
id="main-navbar"
65
class="navbar navbar-expand-lg navbar-light bg-white fixed-top"
66
>
67
<!-- Container wrapper -->
68
<div class="container-fluid">
69
<!-- Toggler -->
70
<button
71
data-mdb-ripple-init
72
data-mdb-toggle="sidenav"
73
data-mdb-target="#sidenav-1"
74
class="btn shadow-0 p-0 me-3 d-block d-xxl-none"
75
aria-controls="#sidenav-1"
76
aria-haspopup="true"
77
>
78
<i class="fas fa-bars fa-lg"></i>
79
</button>
80
81
<!-- Search form -->
82
<form class="d-none d-md-flex input-group w-auto my-auto">
83
<input
84
autocomplete="off"
85
type="search"
86
class="form-control rounded"
87
placeholder='Search (ctrl + "/" to focus)'
88
style="min-width: 225px"
89
/>
90
<span class="input-group-text border-0"
91
><i class="fas fa-search"></i
92
></span>
93
</form>
94
95
<!-- Right links -->
96
<ul class="navbar-nav ms-auto d-flex flex-row">
97
<!-- Notification dropdown -->
98
<li class="nav-item dropdown">
99
<a
100
data-mdb-dropdown-init
101
class="nav-link me-3 me-lg-0 dropdown-toggle hidden-arrow"
102
href="#"
103
id="navbarDropdownMenuLink"
104
role="button"
105
aria-expanded="false"
106
>
107
<i class="fas fa-bell"></i>
108
<span class="badge rounded-pill badge-notification bg-danger"
109
>1</span
110
>
111
</a>
112
<ul
113
class="dropdown-menu dropdown-menu-end"
114
aria-labelledby="navbarDropdownMenuLink"
115
>
116
<li><a class="dropdown-item" href="#">Some news</a></li>
117
<li><a class="dropdown-item" href="#">Another news</a></li>
118
<li>
119
<a class="dropdown-item" href="#">Something else here</a>
120
</li>
121
</ul>
122
</li>
123
124
<!-- Icon -->
125
<li class="nav-item">
126
<a class="nav-link me-3 me-lg-0" href="#">
127
<i class="fas fa-fill-drip"></i>
128
</a>
129
</li>
130
<!-- Icon -->
131
<li class="nav-item me-3 me-lg-0">
132
<a class="nav-link" href="#">
133
<i class="fab fa-github"></i>
134
</a>
135
</li>
136
137
<!-- Icon dropdown -->
138
<li class="nav-item dropdown">
139
<a
140
data-mdb-dropdown-init
141
class="nav-link me-3 me-lg-0 dropdown-toggle hidden-arrow"
142
href="#"
143
id="navbarDropdown"
144
role="button"
145
aria-expanded="false"
146
>
147
<i class="flag-united-kingdom flag m-0"></i>
148
</a>
149
<ul
150
class="dropdown-menu dropdown-menu-end"
151
aria-labelledby="navbarDropdown"
152
>
153
<li>
154
<a class="dropdown-item" href="#"
155
><i class="flag-united-kingdom flag"></i>English
156
<i class="fa fa-check text-success ms-2"></i
157
></a>
158
</li>
159
<li><hr class="dropdown-divider" /></li>
160
<li>
161
<a class="dropdown-item" href="#"
162
><i class="flag-poland flag"></i>Polski</a
163
>
164
</li>
165
<li>
166
<a class="dropdown-item" href="#"
167
><i class="flag-china flag"></i>中文</a
168
>
169
</li>
170
<li>
171
<a class="dropdown-item" href="#"
172
><i class="flag-japan flag"></i>日本語</a
173
>
174
</li>
175
<li>
176
<a class="dropdown-item" href="#"
177
><i class="flag-germany flag"></i>Deutsch</a
178
>
179
</li>
180
<li>
181
<a class="dropdown-item" href="#"
182
><i class="flag-france flag"></i>Français</a
183
>
184
</li>
185
<li>
186
<a class="dropdown-item" href="#"
187
><i class="flag-spain flag"></i>Español</a
188
>
189
</li>
190
<li>
191
<a class="dropdown-item" href="#"
192
><i class="flag-russia flag"></i>Русский</a
193
>
194
</li>
195
<li>
196
<a class="dropdown-item" href="#"
197
><i class="flag-portugal flag"></i>Português</a
198
>
199
</li>
200
</ul>
201
</li>
202
203
<!-- Avatar -->
204
<li class="nav-item dropdown">
205
<a
206
data-mdb-dropdown-init
207
class="nav-link dropdown-toggle hidden-arrow d-flex align-items-center"
208
href="#"
209
id="navbarDropdownMenuLink"
210
role="button"
211
aria-expanded="false"
212
>
213
<img
214
src="https://mdbcdn.b-cdn.net/img/Photos/Avatars/img (31).webp"
215
class="rounded-circle"
216
height="22"
217
alt="Avatar"
218
loading="lazy"
219
/>
220
</a>
221
<ul
222
class="dropdown-menu dropdown-menu-end"
223
aria-labelledby="navbarDropdownMenuLink"
224
>
225
<li><a class="dropdown-item" href="#">My profile</a></li>
226
<li><a class="dropdown-item" href="#">Settings</a></li>
227
<li><a class="dropdown-item" href="#">Logout</a></li>
228
</ul>
229
</li>
230
</ul>
231
</div>
232
<!-- Container wrapper -->
233
</nav>
234
<!-- Navbar -->
235
</header>
236
<!--Main Navigation-->
237
238
239
<!--Main layout-->
240
<main style="margin-top: 58px">
241
<div class="container">
242
<div class="pb-2" style="background-color: hsl(0, 0%, 98%)">
243
<div class="container">
244
<div class="row d-flex justify-content-center align-items-center">
245
<div class="col-lg-6 col-md-8 mb-4 mb-md-0 pt-4">
246
<img
247
src="https://mdbootstrap.com/img/new/avatars/18.jpg"
248
class="rounded-circle float-none float-md-start me-4 mb-3"
249
alt=""
250
style="
251
width: 168px;
252
margin-top: -110px;
253
border: 4px solid hsl(0, 0%, 98%);
254
"
255
/>
256
<h1 class="fw-bold">Anna Doe</h1>
257
<p class="text-muted">
258
Lorem ipsum dolor sit amet consectetur adipisicing elit.
259
Eveniet assumenda, commodi perferendis libero debitis harum ut
260
sed nostrum minima aspernatur. .
261
</p>
262
</div>
263
264
<div class="col-lg-6 col-md-4 mb-4 mb-md-0 text-center text-lg-end">
265
<button type="button" class="btn btn-primary btn-rounded" data-mdb-ripple-init>
266
Edit profile
267
</button>
268
</div>
269
</div>
270
</div>
271
</div>
272
</div>
273
</main>
274
<!--Main layout-->
275
276
277
xxxxxxxxxx
1
@media (min-width: 1400px) {
2
main,
3
header,
4
#main-navbar {
5
padding-left: 240px;
6
}
7
}
xxxxxxxxxx
1
const sidenav = document.getElementById("sidenav-1");
2
const sidenavInstance = mdb.Sidenav.getInstance(sidenav);
3
4
let innerWidth = null;
5
6
const setMode = (e) => {
7
// Check necessary for Android devices
8
if (window.innerWidth === innerWidth) {
9
return;
10
}
11
12
innerWidth = window.innerWidth;
13
14
if (window.innerWidth < 1400) {
15
sidenavInstance.changeMode("over");
16
sidenavInstance.hide();
17
} else {
18
sidenavInstance.changeMode("side");
19
sidenavInstance.show();
20
}
21
};
22
23
setMode();
24
25
// Event listeners
26
window.addEventListener("resize", setMode);
Console errors: 0