Skip to content

Commit a799087

Browse files
committed
Improve the mobile view of hackorum - we now have a burger menue, a single column that automatically adjusts the size and the topic list, that looks and fits
Signed-off-by: Kai Wagner <kai.wagner@percona.com>
1 parent 0a00729 commit a799087

7 files changed

Lines changed: 451 additions & 7 deletions

File tree

app/assets/stylesheets/base/root.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,71 @@ body.sidebar-collapsed .page-layout.with-sidebar > main.container {
7979
.page-layout.with-sidebar > main.container {
8080
grid-area: main;
8181
}
82+
83+
.layout-sidebar-overlay {
84+
display: none;
85+
}
86+
87+
@media (max-width: 900px) {
88+
.container {
89+
padding: 0 var(--spacing-4);
90+
}
91+
92+
.page-layout.with-sidebar {
93+
grid-template-columns: minmax(0, 1fr);
94+
grid-template-areas: "main";
95+
}
96+
97+
body.sidebar-collapsed .page-layout.with-sidebar {
98+
grid-template-columns: minmax(0, 1fr);
99+
}
100+
101+
.page-layout.with-sidebar .layout-sidebar {
102+
position: fixed;
103+
top: var(--nav-height);
104+
left: 0;
105+
height: calc(100vh - var(--nav-height));
106+
width: min(84vw, 360px);
107+
max-width: 360px;
108+
transform: translateX(-110%);
109+
transition: transform var(--transition-normal);
110+
z-index: 200;
111+
box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
112+
}
113+
114+
body.mobile-sidebar-open .page-layout.with-sidebar .layout-sidebar {
115+
transform: translateX(0);
116+
}
117+
118+
body.sidebar-collapsed .page-layout.with-sidebar .layout-sidebar {
119+
visibility: visible;
120+
pointer-events: auto;
121+
}
122+
123+
.page-layout.with-sidebar .layout-sidebar-resizer {
124+
display: none;
125+
}
126+
127+
.layout-sidebar-overlay {
128+
display: block;
129+
position: fixed;
130+
top: var(--nav-height);
131+
left: 0;
132+
right: 0;
133+
bottom: 0;
134+
background: rgba(15, 23, 42, 0.45);
135+
opacity: 0;
136+
pointer-events: none;
137+
transition: opacity var(--transition-normal);
138+
z-index: 150;
139+
}
140+
141+
body.mobile-sidebar-open .layout-sidebar-overlay {
142+
opacity: 1;
143+
pointer-events: auto;
144+
}
145+
146+
body.mobile-sidebar-open {
147+
overflow: hidden;
148+
}
149+
}

app/assets/stylesheets/components/navigation.css

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,35 @@
2121
gap: var(--spacing-4);
2222
}
2323

24+
.nav-burger {
25+
display: none;
26+
align-items: center;
27+
justify-content: center;
28+
width: 44px;
29+
height: 44px;
30+
border-radius: 999px;
31+
border: var(--border-width) solid var(--color-border);
32+
background: var(--color-bg-card);
33+
cursor: pointer;
34+
box-shadow: var(--shadow-sm);
35+
gap: 6px;
36+
transition: background-color var(--transition-fast), transform var(--transition-fast);
37+
}
38+
39+
.nav-burger:hover {
40+
background: var(--color-bg-hover);
41+
transform: scale(1.03);
42+
}
43+
44+
.nav-burger-bar {
45+
width: 18px;
46+
height: 2px;
47+
background: var(--color-text-secondary);
48+
border-radius: 999px;
49+
display: block;
50+
transition: transform var(--transition-fast), opacity var(--transition-fast);
51+
}
52+
2453
.nav-brand {
2554
display: flex;
2655
align-items: center;
@@ -130,3 +159,94 @@
130159
background: var(--color-bg-hover);
131160
}
132161
}
162+
163+
.mobile-nav-panel,
164+
.mobile-nav-overlay {
165+
display: none;
166+
}
167+
168+
@media (max-width: 900px) {
169+
.nav-container {
170+
padding: 0 var(--spacing-4);
171+
}
172+
173+
.tagline {
174+
display: none;
175+
}
176+
177+
.nav-links,
178+
.nav-right {
179+
display: none;
180+
}
181+
182+
.nav-burger {
183+
display: inline-flex;
184+
}
185+
186+
body.mobile-sidebar-open .nav-burger-bar:nth-child(1) {
187+
transform: translateY(6px) rotate(45deg);
188+
}
189+
190+
body.mobile-sidebar-open .nav-burger-bar:nth-child(2) {
191+
opacity: 0;
192+
}
193+
194+
body.mobile-sidebar-open .nav-burger-bar:nth-child(3) {
195+
transform: translateY(-6px) rotate(-45deg);
196+
}
197+
198+
.mobile-nav-panel {
199+
display: block;
200+
position: fixed;
201+
top: var(--nav-height);
202+
left: 0;
203+
width: min(84vw, 360px);
204+
height: calc(100vh - var(--nav-height));
205+
background: var(--color-bg-card);
206+
transform: translateX(-110%);
207+
transition: transform var(--transition-normal);
208+
z-index: 200;
209+
box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
210+
padding: var(--spacing-4);
211+
overflow-y: auto;
212+
}
213+
214+
body.mobile-sidebar-open .mobile-nav-panel {
215+
transform: translateX(0);
216+
}
217+
218+
.mobile-nav-panel .mobile-nav-links {
219+
display: flex;
220+
flex-direction: column;
221+
gap: var(--spacing-3);
222+
}
223+
224+
.mobile-nav-panel .nav-link {
225+
width: 100%;
226+
justify-content: space-between;
227+
}
228+
229+
.mobile-nav-panel .nav-user {
230+
display: block;
231+
padding: 0 var(--spacing-2);
232+
}
233+
234+
.mobile-nav-overlay {
235+
display: block;
236+
position: fixed;
237+
top: var(--nav-height);
238+
left: 0;
239+
right: 0;
240+
bottom: 0;
241+
background: rgba(15, 23, 42, 0.45);
242+
opacity: 0;
243+
pointer-events: none;
244+
transition: opacity var(--transition-normal);
245+
z-index: 150;
246+
}
247+
248+
body.mobile-sidebar-open .mobile-nav-overlay {
249+
opacity: 1;
250+
pointer-events: auto;
251+
}
252+
}

app/assets/stylesheets/components/sidebar.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@
4545
}
4646
}
4747

48+
@media (max-width: 900px) {
49+
.sidebar {
50+
position: static;
51+
top: auto;
52+
max-height: none;
53+
height: 100%;
54+
padding-right: 0;
55+
}
56+
}
57+
4858
.sidebar-section {
4959
margin-bottom: var(--spacing-8);
5060
}
@@ -268,3 +278,29 @@
268278
.sidebar .commitfest-committers li + li {
269279
margin-top: var(--spacing-1);
270280
}
281+
282+
.mobile-sidebar-nav {
283+
display: none;
284+
}
285+
286+
@media (max-width: 900px) {
287+
.mobile-sidebar-nav {
288+
display: block;
289+
}
290+
291+
.mobile-sidebar-nav .mobile-nav-links {
292+
display: flex;
293+
flex-direction: column;
294+
gap: var(--spacing-3);
295+
}
296+
297+
.mobile-sidebar-nav .nav-link {
298+
width: 100%;
299+
justify-content: space-between;
300+
}
301+
302+
.mobile-sidebar-nav .nav-user {
303+
display: block;
304+
padding: 0 var(--spacing-2);
305+
}
306+
}

app/assets/stylesheets/components/topics.css

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,120 @@ a.topic-icon {
202202
}
203203
}
204204

205+
@media (max-width: 900px) {
206+
.topics-table {
207+
& table {
208+
display: block;
209+
}
210+
211+
& thead {
212+
display: none;
213+
}
214+
215+
& tbody {
216+
display: block;
217+
}
218+
219+
& tr {
220+
display: grid;
221+
gap: var(--spacing-2);
222+
padding: var(--spacing-3);
223+
border: var(--border-width) solid var(--color-border);
224+
border-radius: var(--border-radius-lg);
225+
background: var(--color-bg-card);
226+
margin-bottom: var(--spacing-3);
227+
}
228+
229+
& td {
230+
display: flex;
231+
flex-direction: column;
232+
gap: var(--spacing-1);
233+
padding: 0;
234+
border-bottom: none;
235+
}
236+
237+
& td::before {
238+
content: attr(data-label);
239+
font-size: var(--font-size-xs);
240+
text-transform: uppercase;
241+
letter-spacing: 0.04em;
242+
color: var(--color-text-muted);
243+
}
244+
245+
& td.topic-title::before {
246+
display: none;
247+
}
248+
249+
& td.topic-activity::before {
250+
display: none;
251+
}
252+
253+
& td.topic-participants {
254+
display: none;
255+
}
256+
257+
& .topic-participants {
258+
text-align: left;
259+
}
260+
261+
& .topic-replies,
262+
& .topic-activity,
263+
& .topic-participants {
264+
width: auto;
265+
}
266+
}
267+
268+
.topic-row {
269+
align-items: center;
270+
}
271+
272+
.topics-table td.topic-title {
273+
display: flex;
274+
flex-direction: row;
275+
align-items: center;
276+
gap: var(--spacing-2);
277+
}
278+
279+
.topic-icon {
280+
padding: 2px;
281+
margin-right: 0;
282+
}
283+
284+
.topic-icon-badge {
285+
min-width: 16px;
286+
height: 16px;
287+
font-size: 10px;
288+
}
289+
290+
.topic-link {
291+
font-size: var(--font-size-base);
292+
line-height: var(--line-height-normal);
293+
flex: 1 1 auto;
294+
min-width: 0;
295+
}
296+
297+
.topics-table td.topic-activity {
298+
align-items: flex-end;
299+
}
300+
301+
.activity-info {
302+
flex-direction: row;
303+
justify-content: space-between;
304+
text-align: left;
305+
gap: var(--spacing-2);
306+
width: 100%;
307+
}
308+
309+
.activity-replies,
310+
.activity-time {
311+
font-size: var(--font-size-2xs);
312+
}
313+
314+
.activity-time {
315+
text-align: right;
316+
}
317+
}
318+
205319
.activity-star {
206320
background-color: var(--color-bg-activity-team);
207321
.topic-icon-badge {

0 commit comments

Comments
 (0)