Skip to content

Commit f869792

Browse files
Merge pull request #114 from CodebreakerApp/92-scrolling-with-lower-vertical-resolution
92 scrolling with lower vertical resolution
2 parents b3f926f + e85ce28 commit f869792

6 files changed

Lines changed: 55 additions & 88 deletions

File tree

src/CodeBreaker.Blazor.Client/Components/Playground.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
{
3838
<div class="selectable-game-buttons">
3939
<FluentButton Appearance="Appearance.Stealth" Disabled="PlayButtonDisabled" OnClick="SetMoveAsync">
40-
<FluentIcon Value="new Icons.Filled.Size48.PlayCircle()" />
40+
<FluentIcon Value="new Icons.Filled.Size48.PlayCircle()" Width="100%" />
4141
</FluentButton>
4242
<FluentButton Appearance="Appearance.Stealth" Disabled="ClearButtonDisabled" OnClick="ResetMove">
43-
<FluentIcon Value="new Icons.Filled.Size48.DismissCircle()" />
43+
<FluentIcon Value="new Icons.Filled.Size48.DismissCircle()" Width="100%" />
4444
</FluentButton>
4545
</div>
4646
}

src/CodeBreaker.Blazor.Client/Components/Playground.razor.css

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,6 @@
3232
}
3333
}
3434

35-
@media only screen and (max-width: 763px) {
36-
.container {
37-
--game-field-width: 2.25rem;
38-
--game-field-height: 2.25rem;
39-
}
40-
}
41-
42-
@media only screen and (max-height: 900px) {
43-
.container {
44-
--game-field-width: 2.25rem;
45-
--game-field-height: 2.25rem;
46-
}
47-
}
48-
49-
@media only screen and (max-width: 599px) and (min-height: 800px) {
50-
.container {
51-
--game-field-width: 2rem;
52-
--game-field-height: 2rem;
53-
}
54-
}
55-
56-
@media only screen and (max-width: 599px) and (max-height: 800px) {
57-
.container {
58-
--game-field-width: 1.5rem;
59-
--game-field-height: 1.5rem;
60-
}
61-
}
62-
6335
.container,
6436
.game-container,
6537
.colors,
@@ -337,33 +309,6 @@
337309

338310

339311

340-
fluent-button::part(button) {
341-
background-color: red;
342-
}
343-
fluent-button::part(.control) {
344-
background-color: red;
345-
}
346-
fluent-button::part(control) {
347-
background-color: red;
348-
}
349-
350-
fluent-button /deep/ button {
351-
background-color: blue;
352-
}
353-
FluentButton::part(button) {
354-
background-color: red;
355-
}
356-
FluentButton::part(button) {
357-
background-color: red;
358-
}
359-
360-
FluentButton::part(.control) {
361-
background-color: red;
362-
}
363-
364-
FluentButton::part(control) {
365-
background-color: red;
366-
}
367-
FluentButton /deep/ button {
368-
background-color: blue;
312+
.selectable-game-buttons ::deep > fluent-button::part(control) {
313+
width: calc(var(--game-field-width) + 7px);
369314
}

src/CodeBreaker.Blazor.Client/Pages/GamePage.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@using CodeBreaker.Blazor.Client.Models
44
@using Codebreaker.GameAPIs.Client.Models
55

6-
<FluentCard>
6+
<FluentCard AreaRestricted="false">
77
@if (_gameStatus == GameMode.NotRunning)
88
{
99
<h2>@Loc["GamePage_Title"]</h2>

src/CodeBreaker.Blazor.Client/Shared/MainLayout.razor

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
@inject IStringLocalizer<Resource> Loc
33
@inject NavigationManager NavigationManager
44

5-
<FluentLayout>
6-
<FluentHeader>
7-
<h1><span id="welcome-message">@Loc["Index_Welcome"]</span> @Loc["AppDisplayName"]</h1>
8-
<FluentSpacer />
9-
<LoginDisplay />
10-
</FluentHeader>
11-
<div id="main-layout-stack">
5+
<div class="layout">
6+
<div class="header-wrapper">
7+
<FluentHeader>
8+
<h1><span id="welcome-message">@Loc["Index_Welcome"]</span> @Loc["AppDisplayName"]</h1>
9+
<FluentSpacer />
10+
<LoginDisplay />
11+
</FluentHeader>
12+
</div>
13+
<div class="main-layout-stack">
1214
@* Desktop navigation *@
13-
<div id="large-navigation">
15+
<div class="large-navigation">
1416
<FluentNavMenu Width="200" Style="box-shadow: var(--elevation-shadow-card-rest); height: 100%;">
1517
@foreach (var navigationItem in _navigationItems)
1618
{
@@ -20,7 +22,7 @@
2022
</div>
2123

2224
@* Mobile navigation *@
23-
<div id="small-navigation">
25+
<div class="small-navigation">
2426
<FluentButton Id="mobile-nav-menu-button" Appearance="Appearance.Stealth" OnClick="ToggleMobileNavMenu" IconStart="@(new Icons.Regular.Size20.Navigation())">
2527
@Loc["NavMenu_Title"]
2628
</FluentButton>
@@ -34,12 +36,12 @@
3436
</FluentMenu>
3537
</div>
3638

37-
<FluentBodyContent>
39+
<div class="body-content">
3840
@Body
3941
<FluentDialogProvider />
40-
</FluentBodyContent>
42+
</div>
4143
</div>
42-
</FluentLayout>
44+
</div>
4345

4446
<FluentDialogProvider />
4547
<FluentMenuProvider />

src/CodeBreaker.Blazor.Client/Shared/MainLayout.razor.css

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,51 @@
99
}
1010
}
1111

12-
#main-layout-stack {
13-
display: flex;
14-
flex-direction: row;
12+
.layout {
1513
height: 100%;
14+
display: grid;
15+
grid-template-areas:
16+
"header"
17+
"rest";
18+
grid-template-rows: auto 1fr;
1619
}
1720

18-
#small-navigation {
19-
display: none;
21+
.layout > .header-wrapper {
22+
grid-area: header;
2023
}
21-
#large-navigation {
22-
height: 100%;
24+
25+
.layout > .main-layout-stack {
26+
grid-area: rest;
27+
display: grid;
28+
grid-template-areas:
29+
"mobile-menu mobile-menu"
30+
"sidenav content";
31+
grid-template-rows: auto 1fr;
32+
grid-template-columns: auto 1fr;
33+
}
34+
35+
.layout > .main-layout-stack > .large-navigation {
36+
grid-area: sidenav;
37+
box-shadow: var(--elevation-shadow-card-rest);
38+
position: sticky;
39+
top: 0;
40+
overflow: hidden;
41+
}
42+
.layout > .main-layout-stack > .small-navigation {
43+
grid-area: mobile-menu;
44+
display: none;
2345
}
2446

2547
@media only screen and (max-width: 1000px) {
26-
#large-navigation {
48+
.layout > .main-layout-stack > .large-navigation {
2749
display: none;
2850
}
29-
#small-navigation {
51+
.layout > .main-layout-stack > .small-navigation {
3052
display: block;
3153
}
32-
#main-layout-stack {
33-
flex-direction: column;
34-
}
54+
}
55+
56+
.layout > .main-layout-stack > .body-content {
57+
grid-area: content;
58+
padding: 1rem;
3559
}

src/CodeBreaker.Blazor/wwwroot/css/app.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ html, body, #app {
4242
background-color: var(--neutral-layer-1);
4343
}
4444

45-
.body-content {
46-
padding: 1rem;
47-
}
48-
4945
:root {
5046
--primary: #8eb8e5ff;
5147
--on-primary: #ffffff;

0 commit comments

Comments
 (0)