Skip to content

Commit 39ff3f1

Browse files
authored
Simplify mobile header (hestiacp#3083)
1 parent 5ea42a6 commit 39ff3f1

File tree

11 files changed

+137
-126
lines changed

11 files changed

+137
-126
lines changed

web/css/src/themes/dark.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ strong {
2626
box-shadow: 0 8px 15px rgb(0 0 0 / 25%);
2727
}
2828

29+
.top-bar-usage-inner {
30+
color: #909090;
31+
}
32+
33+
.top-bar-nav-list {
34+
background-color: #454545;
35+
}
36+
2937
.top-bar-nav-link {
3038
&:hover {
3139
color: #dadada;
@@ -53,10 +61,6 @@ strong {
5361
color: #e7e7e7;
5462
}
5563

56-
.top-bar-usage-inner {
57-
color: #909090;
58-
}
59-
6064
.notification-container {
6165
background-color: rgb(50 50 50 / 99%);
6266
text-shadow: 0 1px rgb(0 0 0 / 50%);

web/css/src/themes/default.css

Lines changed: 70 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,18 @@
5959
background-color: #5070a6;
6060
box-shadow: 0 4px 10px rgb(100 100 100 / 40%);
6161
border-bottom: 1px solid #fff;
62-
63-
@media (--viewport-medium) {
64-
position: fixed;
65-
width: 100%;
66-
z-index: 2;
67-
top: 0;
68-
}
62+
position: fixed;
63+
width: 100%;
64+
z-index: 2;
65+
top: 0;
6966
}
7067

7168
.top-bar-inner {
72-
padding-top: 10px;
73-
74-
@media (--viewport-medium) {
75-
display: flex;
76-
height: 40px;
77-
padding-top: 0;
78-
padding-left: 20px;
79-
padding-right: 20px;
80-
justify-content: space-between;
81-
}
69+
display: flex;
70+
height: 40px;
71+
padding-left: 20px;
72+
padding-right: 20px;
73+
justify-content: space-between;
8274

8375
@media (--viewport-large) {
8476
padding-left: 0;
@@ -87,52 +79,88 @@
8779
}
8880

8981
.top-bar-left {
90-
@media (--viewport-medium) {
91-
display: flex;
92-
align-items: center;
93-
}
82+
display: flex;
83+
align-items: center;
9484
}
9585

9686
.top-bar-logo {
9787
display: block;
9888
width: 54px;
99-
margin-left: auto;
100-
margin-right: auto;
89+
margin-right: 30px;
90+
}
10191

102-
@media (--viewport-medium) {
103-
margin-right: 30px;
92+
.top-bar-usage {
93+
display: none;
94+
95+
@media (--viewport-small) {
96+
display: block;
10497
}
10598
}
10699

107-
.top-bar-nav {
108-
margin-top: 10px;
100+
.top-bar-usage-inner {
101+
display: flex;
102+
color: #fff;
103+
text-shadow: 1px 1px rgb(0 0 0 / 25%);
104+
font-weight: 500;
105+
}
109106

110-
@media (--viewport-medium) {
111-
margin-top: 0;
112-
display: flex;
113-
align-self: stretch;
107+
.top-bar-usage-item {
108+
margin-right: 11px;
109+
110+
&:last-child {
111+
margin-right: 0;
112+
}
113+
114+
& .fas {
115+
margin-right: 3px;
114116
}
115117
}
116118

117-
.top-bar-nav-list {
119+
.top-bar-right {
118120
display: flex;
119121
}
120122

121-
.top-bar-nav-item {
123+
.top-bar-notifications {
122124
display: flex;
123125
position: relative;
124-
flex-grow: 1;
126+
}
127+
128+
.top-bar-nav {
129+
display: flex;
130+
position: relative;
131+
}
132+
133+
.top-bar-nav-list {
134+
display: none;
135+
background-color: #4673b6;
136+
box-shadow: 0 3px 20px 0 rgb(0 0 0 / 40%);
137+
position: absolute;
138+
top: 100%;
139+
right: 0;
140+
141+
@media (--viewport-medium) {
142+
display: flex !important; /* NOTE: Overrides inline style set by JS */
143+
background-color: transparent;
144+
box-shadow: none;
145+
position: static;
146+
}
147+
}
148+
149+
.top-bar-nav-item {
150+
@media (--viewport-medium) {
151+
display: flex;
152+
}
125153
}
126154

127155
.top-bar-nav-link {
128156
color: #f7f7f7;
129157
display: flex;
130-
flex-grow: 1;
131158
align-items: center;
132-
justify-content: center;
133159
font-size: 0.8rem;
134160
font-weight: 600;
135161
text-shadow: 1px 1px rgb(0 0 0 / 25%);
162+
background-color: transparent;
163+
border: 0;
136164
border-left: 1px solid transparent;
137165
border-right: 1px solid transparent;
138166
padding: 10px;
@@ -178,45 +206,10 @@
178206

179207
.top-bar-nav-link-label {
180208
margin-left: 6px;
181-
}
182-
183-
.top-bar-right {
184-
@media (--viewport-medium) {
185-
display: flex;
186-
align-items: center;
187-
}
188-
}
189-
190-
.top-bar-usage {
191-
display: none;
192-
193-
@media (--viewport-medium) {
194-
display: flex;
195-
justify-content: center;
196-
margin-top: 10px;
197-
}
209+
white-space: nowrap;
198210

199211
@media (--viewport-medium) {
200-
margin-top: 0;
201-
}
202-
}
203-
204-
.top-bar-usage-inner {
205-
display: flex;
206-
color: #fff;
207-
text-shadow: 1px 1px rgb(0 0 0 / 25%);
208-
font-weight: 500;
209-
}
210-
211-
.top-bar-usage-item {
212-
margin-right: 11px;
213-
214-
&:last-child {
215-
margin-right: 0;
216-
}
217-
218-
& .fas {
219-
margin-right: 3px;
212+
display: none;
220213
}
221214
}
222215

@@ -233,8 +226,8 @@
233226
overflow-y: auto;
234227
position: absolute;
235228
top: 100%;
236-
left: 10px;
237-
width: 330px;
229+
right: 0;
230+
width: 300px;
238231
z-index: 1;
239232
font-size: 0.8rem;
240233
color: #6f6f6f;
@@ -244,9 +237,7 @@
244237
border-top: none;
245238

246239
@media (--viewport-medium) {
247-
left: auto;
248-
right: 0;
249-
width: 390px;
240+
width: 400px;
250241
}
251242
}
252243

@@ -2101,9 +2092,7 @@ body.mobile .l-unit-toolbar__col--right {
21012092
}
21022093

21032094
.l-content {
2104-
@media (--viewport-medium) {
2105-
padding-top: 40px;
2106-
}
2095+
padding-top: 40px;
21072096
}
21082097

21092098
.console-output {

web/css/src/themes/flat.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ strong {
2222
background: #5070a6;
2323
}
2424

25+
.top-bar-usage-inner {
26+
text-shadow: none;
27+
}
28+
2529
.top-bar-nav-link {
2630
text-shadow: none;
2731

@@ -36,10 +40,6 @@ strong {
3640
}
3741
}
3842

39-
.top-bar-usage-inner {
40-
text-shadow: none;
41-
}
42-
4343
.table-header {
4444
box-shadow: none;
4545
background: #fafafa;

web/css/src/themes/vestia.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ strong {
2626
background: #5d5d5d;
2727
}
2828

29+
.top-bar-nav-list {
30+
background-color: #5d5d5d;
31+
}
32+
2933
.top-bar-nav-link {
3034
&:hover,
3135
&:active {

web/css/src/utilities.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,9 @@
146146
white-space: pre !important;
147147
line-height: 1.2 !important;
148148
}
149+
150+
.u-hide-desktop {
151+
@media (--viewport-medium) {
152+
display: none !important;
153+
}
154+
}

web/css/themes/dark.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/css/themes/flat.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/css/themes/vestia.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/init.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,6 @@ $(document).ready(function(){
568568
}
569569

570570
$('.js-notifications').click(function(evt){
571-
evt.preventDefault();
572571
if(!$('.js-notifications').hasClass('active')){
573572
VE.notifications.get_list();
574573
$('.js-notifications').addClass('active');
@@ -578,6 +577,9 @@ $(document).ready(function(){
578577
}
579578
});
580579

580+
$('.js-toggle-top-bar-menu').click(function(evt){
581+
$(this).siblings('.top-bar-nav-list').toggle();
582+
});
581583

582584
$('.button').attr('title','ctrl+Enter');
583585
$('.button.cancel').attr('title','ctrl+Backspace');

0 commit comments

Comments
 (0)