Skip to content

Commit f9255ed

Browse files
committed
show play controls
1 parent 2f19b3b commit f9255ed

4 files changed

Lines changed: 78 additions & 58 deletions

File tree

HomeSpeaker.WebAssembly/Components/Layout/MainLayout.razor

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
</div>
77

88
<main>
9-
<div class="top-row px-md-4">
10-
<div class="col-auto">
11-
<PlayControls />
12-
</div>
13-
</div>
14-
159
<article class="content px-1 px-md-4">
1610
@Body
1711
</article>

HomeSpeaker.WebAssembly/Components/Layout/MainLayout.razor.css

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,23 @@ main {
1313
box-sizing: border-box;
1414
}
1515

16-
.top-row {
17-
background-color: #f7f7f7;
18-
border-bottom: 1px solid #d6d5d5;
19-
justify-content: flex-end;
20-
height: 3.5rem;
21-
display: flex;
22-
align-items: center;
23-
}
24-
25-
.top-row ::deep a, .top-row ::deep .btn-link {
26-
white-space: nowrap;
27-
margin-left: 1.5rem;
28-
text-decoration: none;
29-
}
30-
31-
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
32-
text-decoration: underline;
33-
}
34-
35-
.top-row ::deep a:first-child {
36-
overflow: hidden;
37-
text-overflow: ellipsis;
38-
}
39-
4016
@media (max-width: 1023.98px) {
41-
.top-row:not(.auth) {
42-
display: none;
43-
}
44-
45-
.top-row.auth {
46-
justify-content: space-between;
47-
}
48-
49-
.top-row ::deep a, .top-row ::deep .btn-link {
50-
margin-left: 0;
51-
}
17+
/* Mobile layout adjustments */
5218
}
5319

5420
@media (min-width: 1024px) {
5521
.page {
5622
flex-direction: row;
57-
} .sidebar {
23+
}
24+
25+
.sidebar {
5826
width: 180px;
5927
height: 100vh;
6028
position: sticky;
6129
top: 0;
6230
}
6331

64-
.top-row {
65-
position: sticky;
66-
top: 0;
67-
z-index: 1;
68-
}
69-
70-
.top-row.auth ::deep a:first-child {
71-
flex: 1;
72-
text-align: right;
73-
width: 0;
74-
}
75-
76-
.top-row, article {
32+
article {
7733
padding-left: 2rem !important;
7834
padding-right: 1.5rem !important;
7935
}

HomeSpeaker.WebAssembly/Components/Layout/NavMenu.razor

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
@inject IConfiguration config
66

77
<div class="top-row ps-3 navbar navbar-dark">
8-
<div class="container-fluid"> <div class="navbar-brand">
8+
<div class="container-fluid">
9+
<div class="navbar-brand">
910
<a class="navbar-brand" href="">Home Speaker</a>
1011
@if (showLogs ?? false)
1112
{
1213
<NavLink href="aspire"><img src="/aspire-dashboard.png" width="24" alt="aspire" /></NavLink>
1314
}
1415
</div>
15-
<button class="btn btn-dark d-block d-sm-none" @onclick=stopAsync><span class="oi oi-media-stop top-0"></span></button>
16-
<button class="btn btn-dark d-block d-sm-none" @onclick=skipAsync><span class="oi oi-media-skip-forward top-0"></span></button>
16+
<div class="playback-controls d-flex align-items-center">
17+
<PlayControls />
18+
</div>
1719
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
1820
<span class="navbar-toggler-icon"></span>
1921
</button>

HomeSpeaker.WebAssembly/Components/Layout/NavMenu.razor.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,74 @@
5050
color: white;
5151
}
5252

53+
/* Playback controls styling */
54+
.playback-controls {
55+
flex: 1;
56+
justify-content: center;
57+
gap: 0.25rem;
58+
overflow: hidden; /* Prevent buttons from breaking the layout */
59+
}
60+
61+
.playback-controls ::deep .btn {
62+
border: none;
63+
background: rgba(255, 255, 255, 0.1);
64+
color: white;
65+
padding: 0.375rem 0.5rem;
66+
font-size: 0.875rem;
67+
min-width: 2.25rem;
68+
height: 2.5rem;
69+
flex-shrink: 0; /* Prevent buttons from shrinking too much */
70+
}
71+
72+
.playback-controls ::deep .btn:hover {
73+
background: rgba(255, 255, 255, 0.2);
74+
color: white;
75+
}
76+
77+
.playback-controls ::deep .btn:focus {
78+
box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
79+
}
80+
81+
/* Responsive design for playback controls */
82+
@media (max-width: 991.98px) {
83+
.playback-controls {
84+
gap: 0.125rem;
85+
}
86+
87+
.playback-controls ::deep .btn {
88+
padding: 0.25rem 0.375rem;
89+
font-size: 0.75rem;
90+
min-width: 2rem;
91+
height: 2rem;
92+
}
93+
}
94+
95+
/* Hide buttons only when there's really not enough space */
96+
@media (max-width: 540px) {
97+
/* Hide Clear and Shuffle buttons on smaller screens */
98+
.playback-controls ::deep .btn:nth-child(4),
99+
.playback-controls ::deep .btn:nth-child(5) {
100+
display: none;
101+
}
102+
}
103+
104+
@media (max-width: 420px) {
105+
/* Hide Skip button on very small screens */
106+
.playback-controls ::deep .btn:nth-child(3) {
107+
display: none;
108+
}
109+
}
110+
111+
/* For medium-sized screens like tablets, show all buttons but smaller */
112+
@media (min-width: 541px) and (max-width: 991.98px) {
113+
.playback-controls ::deep .btn {
114+
padding: 0.3rem 0.4rem;
115+
font-size: 0.8rem;
116+
min-width: 2.1rem;
117+
height: 2.2rem;
118+
}
119+
}
120+
53121
@media (min-width: 1024px) {
54122
.navbar-toggler {
55123
display: none;

0 commit comments

Comments
 (0)