Skip to content

Commit e107606

Browse files
committed
feat(menu): improve mobile dropdown interaction.
1 parent 4b737e7 commit e107606

2 files changed

Lines changed: 51 additions & 13 deletions

File tree

js/app.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,19 @@ $(document).ready(function () {
202202

203203
});
204204

205+
$('.menu-dropdown-btn').on('click', function(e) {
206+
207+
if ($(window).width() <= 1175) {
208+
209+
e.stopPropagation();
210+
211+
$(this).parent('.menu-dropdown').toggleClass('is-open');
212+
213+
}
214+
215+
});
216+
217+
$(document).on('click', function() { $('.menu-dropdown').removeClass('is-open'); });
218+
205219
});
206220

style.css

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,37 @@
77
color-scheme: dark;
88
}
99

10-
.color-blue { color: #005DD9; }
10+
.color-blue {
11+
color: #005DD9;
12+
}
1113

12-
.color-light-blue { color: #4690F2; }
14+
.color-light-blue {
15+
color: #4690F2;
16+
}
1317

14-
.color-green { color: #28A745; }
18+
.color-green {
19+
color: #28A745;
20+
}
1521

16-
.color-red { color: #DC3545; }
22+
.color-red {
23+
color: #DC3545;
24+
}
1725

18-
.color-yellow { color: #F1C31B; }
26+
.color-yellow {
27+
color: #F1C31B;
28+
}
1929

20-
.color-orange { color: #FD7E14; }
30+
.color-orange {
31+
color: #FD7E14;
32+
}
2133

22-
.color-purple { color: #8A2BE2; }
34+
.color-purple {
35+
color: #8A2BE2;
36+
}
2337

24-
.alone-bold { font-weight: bold; }
38+
.alone-bold {
39+
font-weight: bold;
40+
}
2541

2642
body.body-class {
2743
margin: 0;
@@ -31,7 +47,7 @@ body.body-class {
3147
}
3248

3349
.main-html {
34-
height: 100dvh;
50+
height: 100dvh;
3551
overflow-y: auto !important;
3652
}
3753

@@ -135,20 +151,25 @@ body.body-class {
135151
border-bottom-left-radius: 25px;
136152
}
137153

138-
.menu-dropdown:hover .menu-dropdown-items {
139-
display: block;
140-
}
141-
142154
.menu-mobile {
143155
display: none;
144156
margin-left: 25px;
145157
font-size: 40px;
146158
}
147159

160+
.menu-dropdown.is-open .menu-dropdown-items {
161+
display: block;
162+
}
163+
148164
@media only screen and (min-width: 1175px) {
165+
149166
.menu-item.menu-right {
150167
float: right !important;
151168
}
169+
170+
.menu-dropdown:hover .menu-dropdown-items {
171+
display: block;
172+
}
152173
}
153174

154175
@media only screen and (max-width: 1175px) {
@@ -415,6 +436,7 @@ p.copyright-text a.copyright-link {
415436
opacity: 0;
416437
transform: translateX(-50%) translateY(-15px);
417438
}
439+
418440
to {
419441
opacity: 1;
420442
transform: translateX(-50%) translateY(0);
@@ -435,6 +457,7 @@ header.modalbox-header-class {
435457
font-size: 26px;
436458
cursor: pointer;
437459
}
460+
438461
.modalbox-main-container {
439462
overflow-y: auto;
440463
max-height: calc(90dvh - 100px);
@@ -480,6 +503,7 @@ select,
480503
.modalbox-input::placeholder {
481504
text-indent: 15px;
482505
}
506+
483507
.modalbox-range::-moz-range-thumb {
484508
background: #005DD9;
485509
border: 4px solid #0047A6;

0 commit comments

Comments
 (0)