Skip to content

Commit 6ad7052

Browse files
authoredMar 12, 2025
Merge pull request #4551 from Roardom/fix-tablet-top-nav
(Fix) Make top nav usable on tablet resolutions
2 parents 0515d16 + 073e888 commit 6ad7052

File tree

3 files changed

+27
-54
lines changed

3 files changed

+27
-54
lines changed
 

‎resources/sass/components/_quick_search.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
flex-grow: 1;
55
z-index: 5;
66

7-
@media screen and (max-width: 1150px) {
7+
@media screen and (max-width: 940px) {
88
display: none;
99
}
1010
}

‎resources/sass/layout/_top_nav.scss

+26-39
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
align-items: center;
77
padding: 0 14px;
88

9+
@media screen and (min-width: 767px) and (max-width: 1400px) {
10+
grid-template: 'ratio-bar ratio-bar ratio-bar ratio-bar ratio-bar ratio-bar' 24px 'left . menus . icon-bar toggle' 48px / 1fr 16px auto 24px 1fr auto;
11+
}
12+
913
&.mobile {
1014
grid-template: 'left toggle' 'menus menus' 'right right' auto / 1fr auto;
1115
max-height: 100vh;
@@ -18,6 +22,10 @@
1822
display: flex;
1923
column-gap: 32px;
2024

25+
@media screen and (min-width: 767px) and (max-width: 1400px) {
26+
column-gap: 12px;
27+
}
28+
2129
@media screen and (max-width: 767px) {
2230
& .top-nav__site-logo,
2331
& .top-nav__branding i {
@@ -33,6 +41,10 @@
3341
column-gap: 40px;
3442
justify-content: end;
3543

44+
@media screen and (min-width: 767px) and (max-width: 1400px) {
45+
display: contents;
46+
}
47+
3648
&.mobile {
3749
display: flex;
3850
flex-direction: column;
@@ -179,6 +191,12 @@
179191
z-index: 1000;
180192
}
181193

194+
@media screen and (min-width: 767px) and (max-width: 1400px) {
195+
.top-nav__dropdown > ul {
196+
top: calc(48px + 24px - 5px);
197+
}
198+
}
199+
182200
.top-nav__dropdown > ul::before {
183201
content: '';
184202
display: block;
@@ -273,7 +291,9 @@
273291
margin: 0;
274292

275293
@media screen and (min-width: 767px) and (max-width: 1400px) {
276-
display: none;
294+
grid-area: ratio-bar;
295+
grid-template-rows: auto;
296+
grid-template-columns: repeat(8, auto);
277297
}
278298

279299
@media screen and (min-width: 2100px) {
@@ -338,10 +358,14 @@
338358
list-style-type: none;
339359
column-gap: 14px;
340360
align-items: center;
341-
grid-area: icon-bar;
342361
margin: 0;
343362
padding: 0;
344363

364+
@media screen and (min-width: 767px) and (max-width: 1400px) {
365+
grid-area: icon-bar;
366+
justify-content: end;
367+
}
368+
345369
@media screen and (max-width: 767px) {
346370
display: none;
347371
}
@@ -412,43 +436,6 @@
412436
border-radius: var(--top-nav-icon-bar-icon-border-radius);
413437
}
414438

415-
/* Stats
416-
******************************************************************************/
417-
418-
.top-nav__stats {
419-
display: none;
420-
grid-template: 'up down ratio' auto 'up down ratio' auto / auto auto auto;
421-
column-gap: 18px;
422-
align-items: center;
423-
flex-direction: column;
424-
grid-area: stats;
425-
list-style-type: none;
426-
font-size: 12px;
427-
color: var(--top-nav-stats-fg);
428-
font-weight: bold;
429-
margin: 0;
430-
padding: 0;
431-
432-
@media screen and (min-width: 1023px) and (max-width: 1400px) {
433-
display: grid;
434-
}
435-
}
436-
437-
.top-nav__stats-up {
438-
grid-area: up;
439-
white-space: nowrap;
440-
}
441-
442-
.top-nav__stats-down {
443-
grid-area: down;
444-
white-space: nowrap;
445-
}
446-
447-
.top-nav__stats-ratio {
448-
grid-area: ratio;
449-
white-space: nowrap;
450-
}
451-
452439
/* Menu toggle
453440
******************************************************************************/
454441

‎resources/views/partials/top_nav.blade.php

-14
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,6 @@ class="progress-bar"
248248
@endif
249249
</ul>
250250
<div class="top-nav__right" x-bind:class="expanded && 'mobile'">
251-
<ul class="top-nav__stats" x-bind:class="expanded && 'mobile'">
252-
<li class="top-nav__stats-up" title="{{ __('common.upload') }}">
253-
<i class="{{ config('other.font-awesome') }} fa-arrow-up text-green"></i>
254-
{{ $user->formatted_uploaded }}
255-
</li>
256-
<li class="top-nav__stats-down" title="{{ __('common.download') }}">
257-
<i class="{{ config('other.font-awesome') }} fa-arrow-down text-red"></i>
258-
{{ $user->formatted_downloaded }}
259-
</li>
260-
<li class="top-nav__stats-ratio" title="{{ __('common.ratio') }}">
261-
<i class="{{ config('other.font-awesome') }} fa-sync-alt text-blue"></i>
262-
{{ $user->formatted_ratio }}
263-
</li>
264-
</ul>
265251
<ul class="top-nav__ratio-bar" x-bind:class="expanded && 'mobile'">
266252
<li class="ratio-bar__uploaded" title="{{ __('common.upload') }}">
267253
<a href="{{ route('users.torrents.index', ['user' => auth()->user()]) }}">

0 commit comments

Comments
 (0)